Apache CXF - WS 解决如何设置 From、ReplyTo、Headers

2024-05-02

我有一个问题:我们正在尝试使用 Apache CXF 实现 WS-Addressing。我可以设置一些标头,例如“To”或“Action”,但我找不到设置其他标头(例如“From”、“ReplyTo”或“FaultTo”)的方法。

有人知道该怎么做吗?


看一眼http://cxf.apache.org/docs/ws-addressing.html 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);

亲切的问候,土壤工人

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Apache CXF - WS 解决如何设置 From、ReplyTo、Headers 的相关文章

随机推荐