设置wsa:to:在SpringWebService中

qkf9rpyu  于 2021-07-23  发布在  Java
关注(0)|答案(0)|浏览(309)

我要把电视放进去 wsa:To header,与扩展webservicegatewaysupport的客户端(端点的url)不同的值。
现在我这样使用服务:

  1. public class HelloClient extends WebServiceGatewaySupport {
  2. public GetHelloResponse getHello(GetHelloRequest request) throws URISyntaxException {
  3. ActionCallback callback = new ActionCallback(
  4. new URI("urn", "test:mdm:system:epage:b2b:logs:hello", null),
  5. new Addressing10()
  6. );
  7. return (GetHelloResponse) getWebServiceTemplate()
  8. .marshalSendAndReceive(request, callback);
  9. }
  10. }

在soap客户端配置类中:

  1. @Bean
  2. public HelloClient getHelloClient() throws Exception {
  3. HelloClient helloClient = new HelloClient();
  4. helloClient.setMarshaller(getMarshaller());
  5. helloClient.setUnmarshaller(getMarshaller());
  6. helloClient.setDefaultUri(env.getProperty("uri.gethelloclient"));
  7. ClientInterceptor[] interceptors = new ClientInterceptor[] {
  8. securityInterceptor()
  9. };
  10. helloClient.setInterceptors(interceptors);
  11. return helloClient;
  12. }

在soap头中,结果如下:

  1. <SOAP-ENV:Header>
  2. ...
  3. <wsa:To SOAP-ENV:mustUnderstand="1">http://localhost:8080/ws/hello</wsa:To>
  4. <wsa:Action>urn:antel:mdm:system:epagos:b2b:comercio:hola</wsa:Action>
  5. <wsa:MessageID>urn:uuid:27774d62-5867-47ec-b463-f50f702f4ae8</wsa:MessageID>
  6. </SOAP-ENV:Header>

我阅读了官方文件中的参考资料,但没有提到这一点。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题