Odata HTTP Authentification | HTTP error 560

Hello,   I'm trying to use the Odata service from Opcenter RDnL 2204. I currently have a clean project (from the "Blak Web App" template) that I am editing in Mendix Studio Pro 9.6.1 (this version is recommended for developing applications to be deployed with Siemens Opcenter products).   When I create a new Consumed Odata in the module, I have to set it up. In the Consumed Odata Connection Settings, there is a checkbox that fires the basic authentication method in HTTP. The username and password will also appear here.   Unfortunately, it is not possible to fill in just "MyUserName" and "MyPassword" here, some sort of expression is required. So I tried to enter a slightly odd expression that might help me to get the login credentials: 'IF 1 < 2 THEN 'MyUserName" else 'MyUserName2" but it didn't work :D   In the browser, I got the error message 'POST http://localhost:8080/xas/ 560 (560)' in the console.  What is the correct form of these two expressions that I can use to set the username and password? Do you know? :) Thank you for your advice and tips
2 answers



I solved the problem by few steps:



1) in IIS Default Web Sitesy\OpcenterRDnLGIL\ allow Basic authentification.

2) Switch from Mendix Studio Pro 9.6.1 to Mendix Studio Pro 9.21.0.

3) Choose a template with Mendix SSO (Asset Manager template from Mendix Studio).

4) in connection settings of the Consumed Odata service set up 'MyUser' and 'MyPass'.



Instead of writing

IF 1 < 2 THEN 'MyUserName' else 'MyUserName2'

you can also write


If you click the 'help' button (question mark) at the bottom of the dialog, a browser tab opens on https://docs.mendix.com/refguide/expressions/, which explains more about expressions.