0
votes

I am using WSO2 ESB to listen on an MQ queue via JMS and then transform a received multi-lines text message into multiple SOAP requests, but unable to make it work without errors.

Error: TID: [0] [ESB] [2014-09-03 13:17:29,198] ERROR {org.apache.axis2.engine.AxisEngine} - The endpoint reference (EPR) for the Operation not found is and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator. {org.apache.axis2.engine.AxisEngine} org.apache.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator. at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:102)

Here is my proxy configuration for reference:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
   <proxy name="StockQuoteJmsProxy"
      transports="jms"
      startOnLoad="true"
      trace="disable">
  <target>
     <inSequence>
        <smooks config-key="smooks-key">
           <input type="text"/>
           <output type="xml"/>
        </smooks>
        <xslt key="transform-xslt-key"/>
        <log level="full"/>
        <iterate xmlns:m0="http://services.samples"
                 preservePayload="true"
                 attachPath="//m0:placeOrder"
                 expression="//m0:placeOrder/m0:order">
           <target>
              <sequence>
                 <header name="Action" value="urn:placeOrder"/>
                 <property name="OUT_ONLY" value="true"/>
                 <send>
                    <endpoint>
                       <address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap11"/>
                    </endpoint>
                 </send>
              </sequence>
           </target>
        </iterate>
     </inSequence>
     <outSequence/>
  </target>
  <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
  <parameter name="transport.jms.ContentType">
     <rules>
        <jmsProperty>contentType</jmsProperty>
        <default>text/plain</default>
     </rules>
  </parameter>
  <parameter name="transport.jms.ConnectionFactory">SQProxyCF</parameter>
   </proxy>
   <localEntry key="transform-xslt-key"
           src="file:repository/samples/resources/smooks/transform.xslt">
  <description/>
</localEntry>
   <localEntry key="smooks-key"
           src="file:repository/samples/resources/smooks/smooks-config.xml">
  <description/>
   </localEntry>
   <sequence name="fault">
  <log level="full">
     <property name="MESSAGE" value="Executing default 'fault' sequence"/>
     <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
     <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
  </log>
  <drop/>
   </sequence>
   <sequence name="main">
  <in>
     <log level="full"/>
     <filter source="get-property('To')" regex="http://localhost:9000.*">
        <send/>
     </filter>
  </in>
  <out>
     <send/>
  </out>
  <description>The main sequence for the message mediation</description>
   </sequence>
</definitions>

Please help on what I have not done correctly in this case. Many thanks in advance!

2

2 Answers

0
votes

You may need to define the document type after translation, but before the . To do this, you can assign the ContentType axis2 property:

<property name="ContentType" value="application/xml" scope="axis2"/>

If that doesn't work, attaching a full stack dump or a wso2carbon.log would help me troubleshoot it.

Thanks, Colin

0
votes

For those who are interested in, here is the working proxy configuration:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
   <proxy name="TextToXmlProxy"
      transports="jms"
      startOnLoad="true"
      trace="disable">
  <target>
     <inSequence>
        <smooks config-key="smooks-key">
           <input type="text"/>
           <output type="xml"/>
        </smooks>
        <xslt key="transform-xslt-key"/>
        <log level="full"/>
        <iterate xmlns:m0="http://services.samples"
                 preservePayload="true"
                 attachPath="//m0:placeOrder"
                 expression="//m0:placeOrder/m0:order">
           <target>
              <sequence>
                 <header name="Action" value="urn:placeOrder"/>
                 <property name="OUT_ONLY" value="true"/>
                 <send>
                    <endpoint>
                       <address uri="http://localhost:9000/services/SimpleStockQuoteService"
                                format="soap11"/>
                    </endpoint>
                 </send>
              </sequence>
           </target>
        </iterate>
     </inSequence>
     <outSequence>
        <send/>
     </outSequence>
     <faultSequence/>
  </target>
  <parameter name="transport.jms.ContentType">
     <rules>
        <jmsProperty>contentType</jmsProperty>
        <default>text/plain</default>
     </rules>
  </parameter>
  <parameter name="transport.jms.ConnectionFactory">SQProxyCF</parameter>
   </proxy>
   <localEntry key="transform-xslt-key"
           src="file:repository/samples/resources/smooks/transform.xslt">
  <description/>
   </localEntry>
   <localEntry key="smooks-key"
           src="file:repository/samples/resources/smooks/smooks-config.xml">
  <description/>
   </localEntry>
   <sequence name="fault">
  <log level="full">
     <property name="MESSAGE" value="Executing default 'fault' sequence"/>
     <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
     <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
  </log>
  <drop/>
   </sequence>
   <sequence name="main">
  <in>
     <log level="full"/>
     <filter source="get-property('To')" regex="http://localhost:9000.*">
        <send/>
     </filter>
  </in>
  <out>
     <send/>
  </out>
  <description>The main sequence for the message mediation</description>
   </sequence>
</definitions>