0

So I´m trying to build a proxy based on a wsdl. This proxy will listen on hhtp/https and transform the incoming SOAP message into JSON sending it over JMS to the end-point. And of course the way back that is from JSON to SOAP needs to be considered as well.

Can somebody please help me how to do that. I´ve tried sample 440 on ESB 4.5.1 just switching the "in_transform" with "out_transform", also some other recipes found here in stackoverflow but none of them seems to do the job. In all cases I get an empty JMS message at the end-point.

Here´s a copy of my proxy

<proxy xmlns="http://ws.apache.org/ns/synapse" name="Tarjetas" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <log level="full"/>
         <property name="messageType" value="application/json" scope="axis2"/>
      </inSequence>
      <outSequence>
         <log level="full"/>
         <xslt key="out_transform"/>
         <property name="messageType" value="text/xml" scope="axis2"/>
         <send/>
      </outSequence>
      <endpoint>
         <address uri="jms:/FORTALEZA.BRIDGE.MOBILE.QUEUE?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
      </endpoint>
   </target>
   <publishWSDL uri="file:repository/wsdl/Debito.wsdl"/>
   <description></description>
</proxy>

and here´s my localEntry for out_transform

   <localEntry key="out_transform">
      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                      xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
                      xmlns:m0="http://services.samples"
                      version="2.0"
                      exclude-result-prefixes="m0 fn">
         <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
         <xsl:template match="*">
            <xsl:element name="{local-name()}" namespace="http://services.samples">
               <xsl:copy-of select="attribute::*"/>
               <xsl:apply-templates/>
            </xsl:element>
         </xsl:template>
      </xsl:stylesheet>
   </localEntry>

and I´m using the following within axis2.xml

<messageFormatter contentType="application/json"
                        class="org.apache.axis2.json.JSONStreamFormatter"/>

<messageBuilder contentType="application/json"
                        class="org.apache.axis2.json.JSONStreamBuilder"/>

I really appreciate all the help I can get.

4

1 に答える 1

0

axis2.xml で次のメッセージ フォーマッタとメッセージ ビルダを使用する必要があります。

    <messageFormatter contentType="application/json"
                      class="org.apache.axis2.json.JSONMessageFormatter"/>


    <messageBuilder contentType="application/json"
                    class="org.apache.axis2.json.JSONBuilder"/>

スクリプト メディエーターを使用して JSON メッセージを作成する場合は、StreamFormatter を使用できます。それ以外の場合は、上記のフォーマッター/ビルダーが要件に対応します。コメントを外した StreamFormatters をコメントアウトする必要があります。

于 2013-06-12T04:18:53.300 に答える