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

how to get the soap body from exchange.

Team,

In Webservice proxy(MESSAGE format) , want to separate the soap body alone.
How to do it?

I tried below but its not worked. advise pls.

//		SOAPMessage soapMessage = (SOAPMessage)
exchange.getIn().getBody(List.class).get(0);
//		System.out.println("Inside RealResFormatProcessor :SOAPMessage :
"+soapMessage);
//        try {
//            SOAPPart sp = soapMessage.getSOAPPart();
//            SOAPEnvelope se = sp.getEnvelope();
//            SOAPBody sb = se.getBody();
//            String responseText = sb.getTextContent();
//            System.out.println("Inside RealResFormatProcessor :String :
"+responseText);            
//        } catch (Exception e) {
//            e.printStackTrace(); 
//        }

Regards
Jayendran



--
View this message in context: http://camel.465427.n5.nabble.com/how-to-get-the-soap-body-from-exchange-tp5767050.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how to get the soap body from exchange.

Posted by Henryk Konsek <he...@gmail.com>.
Hi,

Try the following approach:

   SOAPMessage soapMessage = exchange.getIn(SOAPMessage.class);

The message contains the body. The message is not a body :) .

Cheers.

śr., 13.05.2015 o 09:59 użytkownik jainmcs03 <to...@gmail.com>
napisał:

> Team,
>
> I tried additional ways below, but getting SOAPMessage as null.
>
> //              SOAPMessage soapMessage =
> exchange.getIn().getBody(SOAPMessage.class);
> //              SOAPMessage soapMessage =
> exchange.getIn().getHeader(CxfConstants.CAMEL_CXF_MESSAGE,
> SOAPMessage.class);
> //              SOAPMessage soapMessage = (SOAPMessage)
> exchange.getIn().getBody(List.class).get(0);
> //              System.out.println("Inside RealResFormatProcessor
> :soapMessage :
> "+soapMessage);
>
>
> Regards
> Jayendran
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/how-to-get-the-soap-body-from-exchange-tp5767050p5767052.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: how to get the soap body from exchange.

Posted by jainmcs03 <to...@gmail.com>.
Team,

I tried additional ways below, but getting SOAPMessage as null.

//		SOAPMessage soapMessage = exchange.getIn().getBody(SOAPMessage.class);
//		SOAPMessage soapMessage =
exchange.getIn().getHeader(CxfConstants.CAMEL_CXF_MESSAGE,
SOAPMessage.class);
//		SOAPMessage soapMessage = (SOAPMessage)
exchange.getIn().getBody(List.class).get(0);
//		System.out.println("Inside RealResFormatProcessor :soapMessage :
"+soapMessage);


Regards
Jayendran



--
View this message in context: http://camel.465427.n5.nabble.com/how-to-get-the-soap-body-from-exchange-tp5767050p5767052.html
Sent from the Camel - Users mailing list archive at Nabble.com.