如何使用WS-Addressing并获取messageId



我被困在Apache CXF的WS-Addressing上。我在网上找到的所有东西都试过了,但效果都不好。有两个应用程序,一个服务器和一个客户端,通过WS-Addressing进行通信。我要做的是获取messageid;字段,这样我就可以在日志中输出。

你能帮我一下吗?我尝试了两种不同的解决方案,但没有结果 使用EndpointImpl
public static void main(String[] args) {
ChangeStudentDetailsImpl implementor =  new ChangeStudentDetailsImpl();
EndpointImpl ep = (EndpointImpl) Endpoint.create(implementor);
ep.getFeatures().add(new WSAddressingFeature());
ep.publish("http://localhost:8087/MidtermServer/Implementor");
}
  1. 使用Apache CXF

我真的不明白如何使用WS寻址功能获得参数传递,使用客户端应用程序或SoapUI

感谢您的帮助

经过一些测试,我发现我可以使用apache CXF并通过

获得请求
@Resource
private WebServiceContext ctx;
...
ctx.getMessageContext(); //into the function called

最新更新