You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by chaituu <ya...@gmail.com> on 2015/04/08 03:13:30 UTC

how to get the value from cxf request payload

<from
uri="cxf:bean:OrderEndPoint?loggingFeatureEnabled=true&amp;dataFormat=MESSAGE"
/>
        <to uri="bean:enrichBean"/>
			
I am hitting below SOAP request in SOAP UI and in the enrich bean I need to
get the orderId value?If I do doc.getElementsByTagName("v1:orderId") then
the value
will come but I cannot hardcoded the prefix before the name("v1:orderId")
because namespace prefix can be dynamic.it cannot be always v1.I need the
orderId value from the payload?


		<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:v1="http://xx.xx/xx">
   <soapenv:Header/>
   <soapenv:Body>
      <v1:orderRequest>
         <v1:orderId>abcd</v1:orderId>
      </v1:orderRequest>
   </soapenv:Body>
</soapenv:Envelope>


public class EnrichBean {

    public Document enrich(Document doc) {
        Node node = doc.getElementsByTagName("orderId").item(0);
        String orderId = node.getTextContent();

        System.out.println("orderId was " + orderId );

        return doc;
    }
}



--
View this message in context: http://camel.465427.n5.nabble.com/how-to-get-the-value-from-cxf-request-payload-tp5765452.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how to get the value from cxf request payload

Posted by yogu13 <yo...@gmail.com>.
Try exploring CXF InInterceptors for this.

Regards,
-Yogesh



--
View this message in context: http://camel.465427.n5.nabble.com/how-to-get-the-value-from-cxf-request-payload-tp5765452p5765459.html
Sent from the Camel - Users mailing list archive at Nabble.com.