You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Eric-01 <Er...@Atos.net> on 2013/03/04 14:17:31 UTC

RE: Insert elements in soap header?

Hi Andrei, 

thank you. 

The standard interceptor does not generate a mustUnderstand attribute. So do
have do add it via java code or can this be done by policy too? Is there an
extra policy file required or how to add special header elements or
attributes via policy? 

Eric



--
View this message in context: http://cxf.547215.n5.nabble.com/Insert-elements-in-soap-header-tp5712191p5724021.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: Insert elements in soap header?

Posted by Andrei Shakirin <as...@talend.com>.
Hi Erich,

You can enforce mustUnderstand attribute in WSA SOAP headers using CXF AddressingProperties.
AddressingProperties.getMustUnderstand() should contain list of WSA SOAP headers QNames to be extended with mustUnderstand attribute.
AddressingProperties object itself should be available via message property JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES.
Client code can look like:
        Map<String, Object> requestContext = ((BindingProvider) serviceProxy).getRequestContext();
            AddressingProperties maps = new AddressingPropertiesImpl();
            List<QName> mustUnderstandList = maps.getMustUnderstand();
            mustUnderstandList.add(Names.WSA_ACTION_QNAME);
            mustUnderstandList.add(Names.WSA_ADDRESS_QNAME);
            mustUnderstandList.add(Names.WSA_REPLYTO_QNAME);
            mustUnderstandList.add(Names.WSA_MESSAGEID_QNAME);
            requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, maps);

After it all mentioned elements will be sent with mustUnderstand="1".

Of course, you can configure AddressingProperties via Spring/Blueprint for client/endpoint or in interceptors as well.

Regards,
Andrei.

> -----Original Message-----
> From: Eric-01 [mailto:Erich.Gormann@Atos.net]
> Sent: Montag, 4. März 2013 14:18
> To: users@cxf.apache.org
> Subject: RE: Insert elements in soap header?
> 
> Hi Andrei,
> 
> thank you.
> 
> The standard interceptor does not generate a mustUnderstand attribute. So
> do have do add it via java code or can this be done by policy too? Is there an
> extra policy file required or how to add special header elements or attributes
> via policy?
> 
> Eric
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Insert-
> elements-in-soap-header-tp5712191p5724021.html
> Sent from the cxf-user mailing list archive at Nabble.com.