Apache CXF-WS寻址如何设置From,ReplyTo,Headers [英] Apache CXF - WS addressing how to set From, ReplyTo, Headers

查看:117
本文介绍了Apache CXF-WS寻址如何设置From,ReplyTo,Headers的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题:我们正在尝试使用Apache CXF实现WS-Addressing.我可以设置一些标头,如收件人"或动作",但找不到找到诸如发件人",答复收件人"或故障收件人"之类的标头的方法.

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.

有人知道怎么做吗?

推荐答案

看看 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);

亲切的问候,土壤工

这篇关于Apache CXF-WS寻址如何设置From,ReplyTo,Headers的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆