cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: How to retreive XML request
Date Wed, 04 Jun 2008 13:45:10 GMT


Short of using an Interceptor/Handler, I'm not sure if you can.   The  
input stream is definitely completely consumed so there wouldn't be  
data from that.     My first thought was to configure the  
SAAJInInterceptor onto the input chain.   That gets you part way as it  
would construct an SAAJ model for the SOAP message.   However, you  
have to delve into some CXF proprietary things to get it:

((WrappedMessageContext 
)getMessageContext()).getWrappedMessage().getContent(SOAPMessage.class);


The only other option would be to write your own interceptors.   You  
could subclass the SAAJInIntereptor (or write an interceptor that runs  
immediately after it), that would just do:

message.put("SAAJ", message.getContext(SOAPMessage.class));
to copy the SAAJ model into the properties where you could then do:
getMessageContext().get("SAAJ");

Dan




On Jun 4, 2008, at 3:00 AM, Sergey Pulyaev wrote:

> I use Jetty6 as container and I want to retrieve the XML request as  
> string if I have exception during the web service run...
>
> Is it possible?
>
>
>
> I tried to use
>
> ((HttpServletRequest)  
> getMessageContext 
> ().get(AbstractHTTPDestination.HTTP_REQUEST)) .getInputStream()
>
> But I'm failed to get information.
>
>
>
> I tried to get the XML document but it contains just soap message  
> with clean
>
>             Message inMessage =  
> msgContext.getWrappedMessage().getExchange().getInMessage();
>
>             xmlRes =  
> XmlUtils 
> .formatXMLDocument(inMessage.getContent(org.w3c.dom.Node.class),  
> true);
>
>
>
> But it returns just that:
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/ 
> " xmlns:ws="http://ws.pc2.takecharge.com/">
>
>    <soapenv:Header/>
>
>    <soapenv:Body/>
>
> </soapenv:Envelope>
>
>
>
> Is there any possibility to get the whole xml of soap request?
>
>
>
> Best regards
>
>                 Sergey
>
>
> --------
> This data is for general information only and shall not be used to  
> produce documents of any kind without same being submitted to,  
> reviewed by, and approved by Intego in writing. All data is subject  
> to change. User assumes all liability relating to the use of this  
> data and agrees to release, indemnify, and hold harmless Intego from  
> any and all claims relating said use. User is responsible to check  
> for any viruses before use.

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog





Mime
View raw message