Versions Compared

Key

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

...

  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 using a rest client.

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

    You will see receive the following on the ESB logresponse:

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

...