0

目前,我正在将 xml 作为 jms 消息从 activemq 发送到 wso2 esb 代理服务。我正在使用中介类聚合该消息,并且该消息已发送到外部 Web 服务。

所以现在,如何从 webservice 获得对 wso2 esb 代理 outsequence 的响应,我必须将它作为 jms 消息发送回活动的 mq 输出队列。

 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>   
4

1 回答 1

0

您可以使用 callout mediator 调用服务并获得对序列的响应。请参考 [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

于 2013-03-09T01:41:00.777 回答