Connecting to SOAP web service requiring WS Security and WS Adressing

0
Dear community,   For a project I need to connect to a SOAP web service that requires WS Security UsernameToken elements with password and username and additionally at least the MessageID from WS Adressing. When building a custom request header Mendix automatically applies the WS Adressing with an Action which is fine for me. But when trying to request a custom header without defining the wsa (like below) an export error is thrown because of an unnamed namespace while Mendix would apply this themselves afterwards. <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">   <wsse:UsernameToken>     <wsse:Username>{1}</wsse:Username>     <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">{2}</wsse:Password>   </wsse:UsernameToken> </wsse:Security> <wsa:MessageID>tag:WS-Gateway_SOAPUI-template_v8,TijmenVerwoert,13 Apr 2022:239630</wsaa:MessageID> <wsa:To></wsa:To>   When I define the wsa again for the 2 elements I need to add (below here), I receive a 500 internal error from the server. <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">   <wsse:UsernameToken>     <wsse:Username>{1}</wsse:Username>     <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">{2}</wsse:Password>   </wsse:UsernameToken> </wsse:Security> <wsaa:MessageID xmlns:wsaa="http://www.w3.org/2005/08/addressing">tag:WS-Gateway_SOAPUI-template_v8,TijmenVerwoert,13 Apr 2022:239630</wsaa:MessageID> <wsaaa:To xmlns:wsaaa="http://www.w3.org/2005/08/addressing">https://ondemand.uat.riskmetrics.com/ondemand/soap/connectivity.connectivityhttpssoap12endpoint/</wsaaa:To>   When I run the request from SoapUI I do get a status 200 with the following request: <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsdl="http://ondemand.riskmetrics.com/WSGateway/Connectivity/1.0/wsdl" xmlns:xsd="http://ondemand.riskmetrics.com/WSGateway/Connectivity/1.0/Ping/xsd"> <soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsu:Timestamp wsu:Id="TS-EA706E41C4997DB99916498386383052"> <wsu:Created> 2022-04-13T08:30:38.305Z </wsu:Created> <wsu:Expires> 2022-04-14T08:30:38.305Z </wsu:Expires> </wsu:Timestamp> <wsse:UsernameToken wsu:Id="UsernameToken-EA706E41C4997DB99916498386382991"> <wsse:Username> FakeUsername </wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"> FakePass </wsse:Password> <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"> WNNE9P32x8udLoWUa+F+aA== </wsse:Nonce> <wsu:Created> 2022-04-13T08:30:38.297Z </wsu:Created> </wsse:UsernameToken> </wsse:Security> <wsa:Action> urn:RiskMetricsWS:1.0:Connectivity:Ping </wsa:Action> <wsa:MessageID> tag:WS-Gateway_SOAPUI-template_v8,TijmenVerwoert,13 Apr 2022:239630 </wsa:MessageID> <wsa:To> https://en0nkdxicugicc.x.pipedream.net/ </wsa:To> </soap:Header> <soap:Body> <wsdl:Ping> World </wsdl:Ping> </soap:Body> </soap:Envelope>   What can I do to get this to work in Mendix?   Any help is much appreciated!   Kind regards,   Tijmen  
asked
2 answers
1

Tough one…

The only thing I see is that the 3rd structure in your first post (where soap ui succeeds with 200) is an other structure than WS Security username token.
What if you try to use the WS Security 2002-04 with Kerberos?
This is the structure Soap UI also uses what I see.

 

 

Furthermore have no knowledge unfortunately about this.

answered
0

Hi Tijmen,

If you connect to their webservice then they have to deliver you the WSDL.
You can easily import it to Mendix:

 

Or you can create your own Published Web Service and export the WSDL to debug.

I’m not sure why your app is not working, but I always ask their WSDL.

answered