Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Prefix used to get a SOAP 1.1 or 1.2 envelope level element. For example, to get the body element from the SOAP envelope, use the expression $env/*[local-name()='Body'].

Example of $url $env usage:

  1. Create an API with the following configuration. For information on how to create an API, see Creating APIs.

    Code Block
    languagexml
    <api context="/soapEnvelopeTest" name="SoapEnvelopeTest">
            <resource url-mapping="/*">
                <inSequence>
                    <loopback/>
                </inSequence>
                <outSequence>
                    <property name="messageType" scope="axis2" value="application/xml"/>
                    <payloadFactory media-type="xml">
                        <format>
                            <theData xmlns="http://some.namespace">
                                <item>$1</item>
                            </theData>
                        </format>
                        <args>
                            <arg evaluator="xml" expression="$env/*[local-name()='Body']/*[local-name()='jsonObject']/*"/>
                    </payloadFactory>
                    <property name="messageType" scope="axis2" value="application/json"/>
                    <send/>
                </outSequence>
            </resource>
    </api>
  2. Send a post request to the API you created (i.e.,http://localhost:8280/soapEnvelopeTest) with the following json payload.

    Code Block
    languagexml
     {"content":{ "paramA": "ValueA", "paramB": "valueB" }}

    You will see the following on the ESB log:

    Code Block
    languagexml
    {"theData":{"item":{"content":{"paramA":"ValueA","paramB":"valueB"}}}}

...