Hello!
Thanx.
I tried Colm's solution:

bindingProvider.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES,
maps);

and ist working.

Thanx!
Csaba

On 2018-07-20 20:08, Daniel Kulp wrote:
This is now implemented.   The next set of snapshots should have it working.

Dan




On Jul 20, 2018, at 12:40 PM, Daniel Kulp <[email protected] <mailto:[email protected]>> wrote:

The was:addressing feature element does have a addressingRequired=true/false attribute that I was HOPING would turn on the MustUnderstand header.  However, it’s not.   It’s currently only used on the server side to make sure the client sent addressing headers.   I’m going to poke around and see if it’s something that can be changed.

Dan


On Jul 18, 2018, at 11:43 AM, Tóth Csaba <[email protected] <mailto:[email protected]>> wrote:

Hello!

I have a (proxy) client inside a server environment. (I have more clients) And, need to turn on the WSA, and the mustUnderstand attribute in some fields (not all, and not for all client)

I already set up the config:

 <jaxws:client id="ClientRegistry"
       serviceClass="myServicePortType"
       address="http://myEndpoint";>
       <jaxws:binding>
       <soap:soapBinding version="1.2" mtomEnabled="false" />
       </jaxws:binding>
       <jaxws:features>
           <wsa:addressing xmlns:wsa="http://cxf.apache.org/ws/addressing"/>
         </jaxws:features>
     </jaxws:client>

Its create the WSA elements into the header, but no clue how to set some to mustUnderstand.

I found a solution (https://mail-archives.apache.org/mod_mbox/cxf-users/201504.mbox/%[email protected]%3E):

  final MessageContext mc = wsContext.getMessageContext();

  AddressingProperties maps = new AddressingPropertiesImpl();
  List<QName> mustUnderstandList = maps.getMustUnderstand();
  mustUnderstandList.add(Names.WSA_ACTION_QNAME);
  mustUnderstandList.add(Names.WSA_TO_QNAME);
  mc.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, maps);


but for that, I need a MessageContext, but in my code I have only BindingProvider (after cast the myServicePortType class).

There are more solution to create the header WSA nodes by code:

      List<Header> headers = new ArrayList<Header>();
       // action:
       Header actionHeader = new Header(new QName("http://www.w3.org/2005/08/addressing";, "Action"), "myaction",
               new JAXBDataBinding(String.class));
       headers.add(actionHeader);
bindingProvider.getRequestContext().put(Header.HEADER_LIST, headers);

But I think with the features is more elegant.

I looking the  BindingProvider version of the first solution...

Thanx

Csaba


ps: there is a method to turn on the outgoing message multipart if needed (if there is a binary payload, and not for always?)



--
Daniel Kulp
[email protected] <mailto:[email protected]> <mailto:[email protected]> - http://dankulp.com/blog <http://dankulp.com/blog>
Talend Community Coder - http://talend.com <http://coders.talend.com/>

--
Daniel Kulp
[email protected] <mailto:[email protected]> - http://dankulp.com/blog
Talend Community Coder - http://talend.com <http://coders.talend.com>


Reply via email to