Question

I am getting service endpoint as input SOAP request to WSO2 esb, based on that need to send payload data to that endpoint and response to client. Please advise how to send payload to that endpoint. I tried Header mediator but no luck. Following is the SOAP XML request coming to ESB which has service endpoint reference, under property element.

<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"> <soapenv:Body> <resources> <resource>
<properties> <property name="location" value="http://localhost:8280/services/echo.echoHttpSoap11Endpoint"/> </properties> </resource> </resources> </soapenv:Body> </soapenv:Envelope>

Was it helpful?

Solution

First retrieve the address value using the expression "//properties/property/@value". Then set the To address of the header mediator and send the message.

         <property name="address" expression="//properties/property/@value"/>
         <header name="To" expression="get-property('address')"/>
         <payloadFactory>
          <format>
           <p:echoInt xmlns:p="http://echo.services.core.carbon.wso2.org">
              <in xmlns="">$1</in>
           </p:echoInt>
         </format>
          <args>
           <arg value="1"/>
         </args>
        </payloadFactory>
     <send/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top