Need to access tags submitted via a SOAP Header for a Published Web Service

0
Hello,   I am developing a published web service that is being called by an external system.  The external system submits two header tags which I need to be able to access, Operation and UniqueID, as per below simplified example.  How do I access these two tags from the SOAP Header on my Published web service?  I only know how to access the tags submitted in the Body.   <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">   <SOAP-ENV:Header>     ....     <Operation>New_Entry</Operation>     <UniqueID>1234567890</UniqueID>   </SOAP-ENV:Header>   <SOAP-ENV:Body>     <MessageData>     ....     </MessageData>   </SOAP-ENV:Body> </SOAP-ENV:Envelope>   Many Thanks
asked
1 answers
2

By default you can't access these headers as I know. What you can do is pass the httpresponse to a XML import mapping.

Because Mendix is not compatible with the AnyAttribute in schemas stated in the documentation (https://docs.mendix.com/refguide/xml-schema-support#1-introduction) which is used in the SOAP reference schema(https://schemas.xmlsoap.org/soap/envelope/) you need to create a specific one.

  1. Create and specific XSD with one of your SOAP XML examples here: https://www.liquid-technologies.com/online-xml-to-xsd-converter 
  1. Create a XSD schema in your Mendix app by importing the schema your generated
  1. Use this XSD schema in your import mapping
  1. Pass the httpresponse content to this mapping and retrieve your header info and process it further.


Hope this helps :) 

cheers! 

 

answered