Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache CXF - WS addressing how to set From, ReplyTo, Headers

I have a question: we are trying to implement WS-Addressing with Apache CXF. I am able to set some headers like To, or Action, but I don't find the way to set others like From, ReplyTo, or FaultTo.

Does anybody know how to do it?

like image 515
user517663 Avatar asked Mar 17 '23 16:03

user517663


1 Answers

Take a look at http://cxf.apache.org/docs/ws-addressing.html. It's on the end of the page:

AddressingProperties maps = new AddressingPropertiesImpl();
EndpointReferenceType ref = new EndpointReferenceType();
AttributedURIType add = new AttributedURIType();
add.setValue("http://localhost:9090/decoupled_endpoint");
ref.setAddress(add);
maps.setReplyTo(ref);
maps.setFaultTo(ref);

((BindingProvider)port).getRequestContext()
    .put("javax.xml.ws.addressing.context", maps);

kind regards, soilworker

like image 51
soilworker Avatar answered Apr 09 '23 23:04

soilworker