Ilmija Asani · Feb 18, 2020

Create a SOAP Envelope


we are trying to figure out if there's a way to create a SOAP Envelope by using SOAP classes.

Right now we use a string to define the envelope element.

The string looks like :

<soap:Envelope xmlns:soap='' xmlns='urn:oasis:names:tc:SAML:2.0:assertion'>
        <add:Action xmlns:add=''>urn:rve:AuthenticateAndGetAssertionRequest</add:Action>
        <add:MessageID xmlns:add=''>urn:uuid:_MessageID_</add:MessageID>
        <add:To xmlns:add=''>_Addressing_</add:To>
        <wsse:Security xmlns:wsse=''>
            <wsse:UsernameToken xmlns:utp=''>
                <wsse:Password Type='rve:PasswordEncrypted'>_token_</wsse:Password>


There's a way to build up the SOAP Envelope and get the same result as our string but by using a class?

0 400
Discussion (2)1
Log in or sign up to continue

The answer to this question really depends on the context and where in the process you are at. If you would like to have a more in-depth discussion with someone about that, I would suggest that you reach out to your InterSystems account team or Support.

Typically when you are sending SOAP requests from an InterSystems product, you would get a WSDL from the SOAP service endpoint and use our SOAP Wizard to generate client classes. Then those client classes can be used at the object level to send requests. You can find documentation on the SOAP wizard here. To use the generated SOAP client classes, see our documentation here. Then this section in the documentation discusses how to add security elements to your SOAP request.

If you would just like a more object-friendly way to build up XML you can consider using the %XML.Writer API's, documented here and here.

Thanks for your suggestions, we have resolved our issue by using the XSLT Transformer. 

Kind regards.