You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Marco Pas <ma...@gmail.com> on 2012/06/25 16:18:51 UTC

How to override/modify a specific incoming SOAP header value?

Hi there,

i have a need for which i need to override a soap header value. In the
receiving soap message there is a value like:

<wsa:ReplyTo>
      <wsa:Address>http://<dummy - url>/WSACallBackHandler</wsa:Address>
</wsa:ReplyTo>


I need to change the value of the wsa:Address field..
<wsa:ReplyTo>
      <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
</wsa:ReplyTo>

Can this be done? And if so how?

/Marco

Re: How to override/modify a specific incoming SOAP header value?

Posted by Marco Pas <ma...@gmail.com>.
Hi Glen,

thanks for your reply, i tried to code from the blog. But using CXF
2.6.1 i always seem to get a nullpointer on the line:
SOAPMessage sm = message.getContent(SOAPMessage.class);

the variable 'sm' always stays null..?


So i tried some other things..

I was able to read the headers with some other code, but have no clue
on how to modify the values.
Header h = soapMessage.getHeader(new
QName("http://www.w3.org/2005/08/addressing", "ReplyTo"));

Any suggestion on how to take it further?

Thanks in advance!

2012/6/25 Glen Mazza <gm...@talend.com>:
> Interim solution, you can use a JAX-WS Handler or CXF interceptor (links
> 43-44: http://www.jroller.com/gmazza/entry/blog_article_index) to alter any
> part of the incoming SOAP message.  There may be a simpler way--if
> wsa:address is kept in a context property you may be able to modify that
> value directly (hopefully someone else who knows can answer that for you.)
>
> Glen
>
>
> On 06/25/2012 10:18 AM, Marco Pas wrote:
>>
>> Hi there,
>>
>> i have a need for which i need to override a soap header value. In the
>> receiving soap message there is a value like:
>>
>> <wsa:ReplyTo>
>>       <wsa:Address>http://<dummy - url>/WSACallBackHandler</wsa:Address>
>> </wsa:ReplyTo>
>>
>>
>> I need to change the value of the wsa:Address field..
>> <wsa:ReplyTo>
>>
>> <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
>> </wsa:ReplyTo>
>>
>> Can this be done? And if so how?
>>
>> /Marco
>
>
>
> --
> Glen Mazza
> Talend Community Coders
> coders.talend.com
> blog: www.jroller.com/gmazza
>

Re: How to override/modify a specific incoming SOAP header value?

Posted by Glen Mazza <gm...@talend.com>.
Interim solution, you can use a JAX-WS Handler or CXF interceptor (links 
43-44: http://www.jroller.com/gmazza/entry/blog_article_index) to alter 
any part of the incoming SOAP message.  There may be a simpler way--if 
wsa:address is kept in a context property you may be able to modify that 
value directly (hopefully someone else who knows can answer that for you.)

Glen

On 06/25/2012 10:18 AM, Marco Pas wrote:
> Hi there,
>
> i have a need for which i need to override a soap header value. In the
> receiving soap message there is a value like:
>
> <wsa:ReplyTo>
>        <wsa:Address>http://<dummy - url>/WSACallBackHandler</wsa:Address>
> </wsa:ReplyTo>
>
>
> I need to change the value of the wsa:Address field..
> <wsa:ReplyTo>
>        <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
> </wsa:ReplyTo>
>
> Can this be done? And if so how?
>
> /Marco


-- 
Glen Mazza
Talend Community Coders
coders.talend.com
blog: www.jroller.com/gmazza