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

3.2k views Asked by At

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?

1

There are 1 answers

1
soilworker On

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