You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Kid_79 <ch...@hotmail.com> on 2009/02/07 19:33:19 UTC

Convert SOAPMessage from cxf to saaj

Hi all, 
I'm trying to use cxf and xwss for security. 
In the my example, on cliend side I'm using an interceptor to apply a
security, but I've this problem:

in my interceptor I have a handleMessage(Message message) method where
Message is a cxf's message (org.apache.cxf.message.Message) while operating
a security I need to SOAPMessage of saaj (javax.xml.soap.SOAPMessage).

How can I convert a cxf's message in to saaj's message?
Can you help me?
Thanks
-- 
View this message in context: http://www.nabble.com/Convert-SOAPMessage-from-cxf-to-saaj-tp21891388p21891388.html
Sent from the cxf-dev mailing list archive at Nabble.com.


Re: Convert SOAPMessage from cxf to saaj

Posted by Daniel Kulp <dk...@apache.org>.
The easiest way is in your interceptor, do:

    private SOAPMessage getSOAPMessage(Message msg) {
        SOAPMessage doc = msg.getContent(SOAPMessage.class);
        if (doc == null) {
            new SAAJInInterceptor().handleMessage(msg);
            doc = msg.getContent(SOAPMessage.class);
        }
        return doc;
    }

Dan




On Sat February 7 2009 1:33:19 pm Kid_79 wrote:
> Hi all,
> I'm trying to use cxf and xwss for security.
> In the my example, on cliend side I'm using an interceptor to apply a
> security, but I've this problem:
>
> in my interceptor I have a handleMessage(Message message) method where
> Message is a cxf's message (org.apache.cxf.message.Message) while operating
> a security I need to SOAPMessage of saaj (javax.xml.soap.SOAPMessage).
>
> How can I convert a cxf's message in to saaj's message?
> Can you help me?
> Thanks

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

Re: Convert SOAPMessage from cxf to saaj

Posted by Kid_79 <ch...@hotmail.com>.
Hi all, I try this example
(http://www.jroller.com/0xcafebabe/entry/securing_spring_ws_client_with1)
but I don't know how can it works!

Can you help me?


Kid_79 wrote:
> 
> Hi all, 
> I'm trying to use cxf and xwss for security. 
> In the my example, on cliend side I'm using an interceptor to apply a
> security, but I've this problem:
> 
> in my interceptor I have a handleMessage(Message message) method where
> Message is a cxf's message (org.apache.cxf.message.Message) while
> operating a security I need to SOAPMessage of saaj
> (javax.xml.soap.SOAPMessage).
> 
> How can I convert a cxf's message in to saaj's message?
> Can you help me?
> Thanks
> 

-- 
View this message in context: http://www.nabble.com/Convert-SOAPMessage-from-cxf-to-saaj-tp21891388p21909483.html
Sent from the cxf-dev mailing list archive at Nabble.com.