FAQ
Hi,

The requestor doesnt send any additional headers to the request, So I have
to route the messages based on the SoapAction. ( Payload format)

But when I send a request, Soap UI returns this error.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
       <soap:Fault>
          <faultcode>soap:Server</faultcode>
          <faultstring>The given SOAPAction http://test.com/test1/Enquiry
does not match an operation.</faultstring>
       </soap:Fault>
    </soap:Body>
</soap:Envelope>


This is my camel route:

<choice>
  <when>



<xpath>/soapenv:Envelope/soapenv:Header/wsa:Action/text()='http://test.com/test1/Enquiry'</xpath>

   <to
    uri="direct:B" />
  </when>
  <otherwise>
   <setFaultBody>
    <simple>Invalid Operation</simple>
   </setFaultBody>
  </otherwise>
</choice>

Any clues ?

Regards
Guru





--
View this message in context: http://camel.465427.n5.nabble.com/Route-based-on-Soap-Action-tp5749316.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Search Discussions

  • Christian Müller at Mar 25, 2014 at 8:25 pm
    You should share the entire route if you are looking for help...

    Best,

    Christian
    -----------------

    Software Integration Specialist

    Apache Member
    V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
    Apache Incubator PMC Member

    https://www.linkedin.com/pub/christian-mueller/11/551/642

    On Tue, Mar 25, 2014 at 6:31 AM, Gnanaguru S wrote:

    Hi,

    The requestor doesnt send any additional headers to the request, So I have
    to route the messages based on the SoapAction. ( Payload format)

    But when I send a request, Soap UI returns this error.

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <soap:Fault>
    <faultcode>soap:Server</faultcode>
    <faultstring>The given SOAPAction http://test.com/test1/Enquiry
    does not match an operation.</faultstring>
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>


    This is my camel route:

    <choice>
    <when>



    <xpath>/soapenv:Envelope/soapenv:Header/wsa:Action/text()='
    http://test.com/test1/Enquiry'</xpath>

    <to
    uri="direct:B" />
    </when>
    <otherwise>
    <setFaultBody>
    <simple>Invalid Operation</simple>
    </setFaultBody>
    </otherwise>
    </choice>

    Any clues ?

    Regards
    Guru





    --
    View this message in context:
    http://camel.465427.n5.nabble.com/Route-based-on-Soap-Action-tp5749316.html
    Sent from the Camel - Users mailing list archive at Nabble.com.
  • Gnanaguru S at Mar 26, 2014 at 6:28 am
    Hi Chris,

    I solved this issue using the Message format itself, but interestingly the
    soapaction URL comes in a double quote & camel simple components expects a
    single quote around it. After that the choice router delegates the messages
    based on the soap action.

    This is the working code:

    <simple>${in.header.SOAPAction} contains
    '"http://test.com/test1/Enquiry"'</simple>

    By the way, It will be helpful if you can comment on *' How to retrieve the
    soap action in the payload mode ? '*

    My current code:

    <camelContext id="test-gateway" useMDCLogging="true" handleFault="true"
    trace="${camel.context.trace}">
      <propertyPlaceholder id="properties" location="ref:com.test.test1" />

      <endpoint id="log-info" uri="log:com.test?level=INFO" />


      <route id="ws-gateway-request-handler">

       <from uri="cxf:bean:test-ws?dataFormat=PAYLOAD" />
       <log message="recieved ws payload: ${body}" />


       <choice>
        <when>



    <xpath>/soapenv:Envelope/soapenv:Header/wsa:Action/text()='http://test.com/test1/Enquiry'</xpath>

         <to uri="direct:B" />
        </when>
        <otherwise>
         <setFaultBody>
          <simple>Invalid Operation</simple>
         </setFaultBody>
        </otherwise>
       </choice>
       <log message="sent response payload: ${body}" />

      </route>

      <route id="Step-2">
       <from uri="jms:queue:Hop2" />
       <to uri="string-template:samples/adapters/Response.xml" />
      </route>


    </camelContext>

    Regards
    Guru



    --
    View this message in context: http://camel.465427.n5.nabble.com/Route-based-on-Soap-Action-tp5749316p5749363.html
    Sent from the Camel - Users mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedMar 25, '14 at 5:42a
activeMar 26, '14 at 6:28a
posts3
users2
websitecamel.apache.org

2 users in discussion

Gnanaguru S: 2 posts Christian Müller: 1 post

People

Translate

site design / logo © 2022 Grokbase