Apache CXF - WS解决了如何设置From,ReplyTo,Headers的问题

use*_*663 4 cxf ws-addressing

我有一个问题:我们正在尝试使用Apache CXF实现WS-Addressing.我可以设置一些像To或Action这样的标题,但我找不到设置其他像From,ReplyTo或FaultTo的方法.

有谁知道怎么做?

soi*_*ker 6

请查看http://cxf.apache.org/docs/ws-addressing.html.它在页面的末尾:

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);
Run Code Online (Sandbox Code Playgroud)

亲切的问候,土工