简体   繁体   中英

How To receive response from webservice to wso2 esb proxy service outsequence?

Currently i am sending an xml as jms message from activemq to the wso2 esb proxy service.That message i am aggregating using mediator class and that message i have sent to the external webservice.

so now,How To get response from webservice to wso2 esb proxy outsequence which I have to send it back to the active mq output queue as jms message.

 Here is the proxy service ::-

    <proxy xmlns="http://ws.apache.org/ns/synapse" name="Demo" transports="https,http,jms" statistics="disable" trace="disable" startOnLoad="true">
       <target>
          <inSequence>
             <property name="OUT_ONLY" value="false"/>
             <property name="ContentType" value="text/plain"/>
             <class name="com.test.Mediator1"/>
             <send>
                <endpoint>
                   <address uri="http://localhost:9989/ws/param?wsdl"/>
                </endpoint>
             </send>
          </inSequence>
          <outSequence>
             <send>
                <endpoint>
                   <address uri="jms:/OutputQueue?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616"/>
                </endpoint>
             </send>
          </outSequence>
       </target>
       <parameter name="transport.jms.ContentType">
          <rules>         
             <jmsProperty>contentType</jmsProperty>         
             <default>application/xml</default>      
          </rules>
       </parameter>
       <description></description>
    </proxy>

    This is the message which I got when I invoke webservice through soapui client.

    <?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:getHelloWorldAsStringResponse xmlns:ns2="http://ws.mkyong.com/"><result>true</result></ns2:getHelloWorldAsStringResponse></S:Body></S:Envelope>

    This is the message which I got in activemq output queue.


    <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope>   

You can use callout mediator to call a service and get a response back to the sequence. Please refere [1] [2]

[1] http://docs.wso2.org/wiki/display/ESB460/Callout+Mediator

[2] http://docs.wso2.org/wiki/display/ESB460/Sample+430%3A+Simple+Callout+Mediator+for+Synchronized+Web+Service+Invocation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM