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/04/16 11:55:40 UTC

Convert a message from saaj to cxf?

Hi all, 
I'm trying to use cxf for my security. 

It's possible converts a saaj's message (javax.xml.soap.SOAPMessage) in to
cxf's message (org.apache.cxf.binding.soap.SoapMessage)? 

Can you help me? 
Thanks
-- 
View this message in context: http://www.nabble.com/Convert-a-message-from-saaj-to-cxf--tp23074793p23074793.html
Sent from the cxf-dev mailing list archive at Nabble.com.


Re: Convert a message from saaj to cxf?

Posted by Eoghan Glynn <eo...@gmail.com>.
Internally in the CXF stack, usually we need to convert the other way
round, i.e. to populate the SAAJ model if its required for example
when a JAX-WS SOAPHandler is installed. This conversion is the
responsibility of the SAAJ{In|Out}Interceptor[1] classes.

However in your case, rather than doing a straight conversion from
SAAJ SOAPMessage to CXF SoapMessage, I wonder could you just wrap the
former inside the latter.

By that I mean create a wrapper class that extends
org.apache.cxf.binding.soap.SoapMessage, but delegates to an embedded
SAAJ SOAPMessage instance where appropriate. So for example
SoapMessage.getHeaders() would map onto
SOAPMessage.getSOAPHeader().examineAllHeaderElements() with mediation
between the CXF SoapHeader type and the corresponding SAAJ
SOAPHeaderElement. I'm not sure if there such a direct correspondence
for everything you'll need, but it might be an idea worth exploring.

Cheers,
Eoghan

[1] http://svn.apache.org/repos/asf/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
http://svn.apache.org/repos/asf/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java

2009/4/16 Kid_79 <ch...@hotmail.com>:
>
> Hi all,
> I'm trying to use cxf for my security.
>
> It's possible converts a saaj's message (javax.xml.soap.SOAPMessage) in to
> cxf's message (org.apache.cxf.binding.soap.SoapMessage)?
>
> Can you help me?
> Thanks
> --
> View this message in context: http://www.nabble.com/Convert-a-message-from-saaj-to-cxf--tp23074793p23074793.html
> Sent from the cxf-dev mailing list archive at Nabble.com.
>
>