camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chaituu <yarlagadd...@gmail.com>
Subject how to get the value from cxf request payload
Date Wed, 08 Apr 2015 01:13:30 GMT
<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.

Mime
View raw message