SAP OData 401 (Unauthorized error)

0
Hi Everyone, We are trying to connect a Mendix app running in the SAP cloud platform to an existing SAP back-end using the SAP OData connector. We have used to SAP OData model creator to generate a domain model using the $metadata.xml file and imported it into our app. So we are first calling request Params, for which we add basic authentication, and now we have also tried to add the Header for Authorization : (Username:Password). For both the Basic Authentication and add header actions we get true as a result. After all of this we then call get list. The get list fails and returns error message 401 (unauthorized)   816b7787-735c-4c32-9bb7-1690a51aafcd|GET|Response code: 401, Response text: <html><head><title>Logon Error Message</title><META http-equiv="Content-Type" content="text/html;charset=UTF-8"><style type="text/css">body { font-family:tahoma,helvetica,sans-serif;color:#333333;background-color:#FFFFFF; }td { font-family:tahoma,helvetica,sans-serif;font-size:70%;color:#333333; }h1 { font-family:tahoma,helvetica,sans-serif;font-size:160%;font-weight:bold;margin-top:15px;margin-bottom:3px;color:#003366; }h2 { font-family:verdana,helvetica,sans-serif;font-size:120%;font-style:italic;font-weight:bold;margin-top:6px;margin-bottom:6px;color:#999900; }p { font-family:tahoma,helvetica,sans-serif;color:#333333;margin-top:4px;margin-bottom:4px; }ul { font-family:tahoma,helvetica,sans-serif;color:#333333;list-style-type:square;margin-top:8px;margin-bottom:8px; }li { font-family:tahoma,helvetica,sans-serif;color:#33333;margin-top:4px; }.emphasize { color:#333333;background-color:#C8E3FF;padding:5px;}.note { color:#CC6600; }a { font-family:tahoma,helvetica,sans-serif;text-decoration:underline;color:#336699; }a:visited { color:#001166; }a:hover { text-decoration:none; }</style></head><body><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><h1>Anmeldung fehlgeschlagen</h1></td></tr></table></body></html>  
asked
2 answers
1

Hi Ryan,

I don't know if this is necessary when using the Get List action from the SAP OData Connector, but if you call a Webservice via the Cloud Connector, you have to pass some additional parameters. I first have to use the Get Cloud Connector Info action, and then pass that data to the Webservice call action. I have to activate the Use Proxy option, and pass the proxy host and port from the CC. I also have to manually add the Proxy-Authorization header (beware: there is a space after Bearer). See the screenshots below.

answered
0

Hi Everyone,

Kinda forgot about this post, but it turns out our implementation was correct, the issue was in the configuration of the SAP cloud and on premise systems.

answered