如何解决在 Spring WebService 中设置 wsa:To:
我需要在 wsa:To
标头中设置一个与扩展 WebServiceGatewaySupport 的客户端不同的值,即端点的 URL。
现在我是这样使用服务的:
public class HelloClient extends WebServiceGatewaySupport {
public GetHelloResponse getHello(GetHelloRequest request) throws URISyntaxException {
ActionCallback callback = new ActionCallback(
new URI("urn","test:mdm:system:epage:b2b:logs:hello",null),new Addressing10()
);
return (GetHelloResponse) getwebservicetemplate()
.marshalSendAndReceive(request,callback);
}
}
在 Soap 客户端配置类中:
@Bean
public HelloClient getHelloClient() throws Exception {
HelloClient helloClient = new HelloClient();
helloClient.setMarshaller(getMarshaller());
helloClient.setUnmarshaller(getMarshaller());
helloClient.setDefaultUri(env.getProperty("uri.gethelloclient"));
ClientInterceptor[] interceptors = new ClientInterceptor[] {
securityInterceptor()
};
helloClient.setInterceptors(interceptors);
return helloClient;
}
在 SOAP Header 中,结果是这样的:
<SOAP-ENV:Header>
...
<wsa:To SOAP-ENV:mustUnderstand="1">http://localhost:8080/ws/hello</wsa:To>
<wsa:Action>urn:antel:mdm:system:epagos:b2b:comercio:hola</wsa:Action>
<wsa:MessageID>urn:uuid:27774d62-5867-47ec-b463-f50f702f4ae8</wsa:MessageID>
</SOAP-ENV:Header>
我阅读了官方文档中的 reference,但没有提到这一点。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。