Apache CXF - WS addressing how to set From, ReplyT

2019-06-24 02:12发布

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条回答
仙女界的扛把子
2楼-- · 2019-06-24 02:40

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

查看更多
登录 后发表回答