You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Smith, Mitchell" <mi...@cwc.com> on 2012/08/29 20:50:28 UTC

Intercept and Alter SOAP XML in CXF

Hi,

I have a requirement to add a XML digital signature to soap requests in my
client.

The service provider has chosen to not use WS-Security, but instead insist
on a XML digital signature, being added to the soap request (I have no idea
why)

Is there anyway, I can use interceptors or transformers, to then sign the
the RAW XML of the SOAP request once formatted prior to sending this to the
server?

Thanks

-- 
*Mitchell
*

The information contained in this email (and any attachments) is confidential and may be privileged. If you are not the intended recipient
and have received this email in error, please notify the sender immediately by reply email and delete the message and any attachments.
If you are not the named addressee, you must not copy, disclose, forward or otherwise use the information contained in this email.
Cable & Wireless Communications Plc and its affiliates reserve the right to monitor all email communications through their networks to
ensure regulatory compliance.
 
Cable & Wireless Communications Plc is a company registered in England & Wales with number:
07130199 and offices located at 3rd Floor, 26 Red Lion Square, London WC1R 4HQ

Re: Intercept and Alter SOAP XML in CXF

Posted by ychawla <pr...@yahoo.com>.
Hi Mitchell,
I have had strange requirements like before as well.  I tend to use Camel
and CXF endpoints inside of Camel.  There is a Crypto component provided by
Camel that might help simplify this:

http://camel.apache.org/crypto-digital-signatures.html

However, if you don't want to use Camel, you will probably have to implement
this manually in an interceptor.

Best of luck.

-Yogesh



--
View this message in context: http://cxf.547215.n5.nabble.com/Intercept-and-Alter-SOAP-XML-in-CXF-tp5713339p5713341.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Intercept and Alter SOAP XML in CXF

Posted by Daniel Kulp <dk...@apache.org>.
On Aug 29, 2012, at 2:50 PM, "Smith, Mitchell" <mi...@cwc.com> wrote:

> Hi,
> 
> I have a requirement to add a XML digital signature to soap requests in my
> client.
> 
> The service provider has chosen to not use WS-Security, but instead insist
> on a XML digital signature, being added to the soap request (I have no idea
> why)
> 
> Is there anyway, I can use interceptors or transformers, to then sign the
> the RAW XML of the SOAP request once formatted prior to sending this to the
> server?

The easiest way to do this is likely to just mimic what the WSS4J stuff does for WS-Security.  Basically write a couple interceptors that would:

1) Make sure the SAAJOutInterceptor is on the chain.   This causes the output to build up into a DOM/SAAJ model

2) Just before the SAAJOut's ending interceptor, grab the DOM and use Santuario (or whatever other XML sig library you want) to sign the DOM.

3) Let the SAAJOut thing then write it out to the stream.



Dan



> 
> Thanks
> 
> -- 
> *Mitchell
> *
> 
> The information contained in this email (and any attachments) is confidential and may be privileged. If you are not the intended recipient
> and have received this email in error, please notify the sender immediately by reply email and delete the message and any attachments.
> If you are not the named addressee, you must not copy, disclose, forward or otherwise use the information contained in this email.
> Cable & Wireless Communications Plc and its affiliates reserve the right to monitor all email communications through their networks to
> ensure regulatory compliance.
> 
> Cable & Wireless Communications Plc is a company registered in England & Wales with number:
> 07130199 and offices located at 3rd Floor, 26 Red Lion Square, London WC1R 4HQ

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com