我有一个由Apache CXF WS生成的WSDL,看起来像这样
<wsdl:service name="MyWS">
<wsdl:port binding="tns:MyWSSoapBinding" name="MyWSImplPort">
<soap:address location="http://someaddress/MyApp/ws/MyWS"/>
</wsdl:port>
</wsdl:service>
我想将soap:address
更改为https
的协议,而不是http
。
这种需要背后的原因。我们在LoadBalancer后面的tomcat服务器上运行SpringBootApp。负载均衡器将在地址https://someaddress/MyApp/ws/MyWs?wsdl
上接收请求,然后通过http
将请求转发给服务器。当Apache CXF自动生成wsdl时,它使用soap:地址生成它,协议为http
而不是https
。
在Application.java中
@Bean
public ServletRegistrationBean servletRegistrationBean() {
CXFServlet servlet = new CXFServlet();
return new ServletRegistrationBean(servlet, "/MyApp/ws/*");
}
@Bean
@Autowired
public Endpoint submitAssessment(ApplicationContext context, MyWS myWS) {
Bus cxfBus = (Bus)context.getBean(Bus.DEFAULT_BUS_ID);
EndpointImpl endpoint = new EndpointImpl(cxfBus, myWS);
endpoint.setAddress("/MyWS");
cxfBus.getInInterceptors().add(new LoggingInInterceptor());
endpoint.publish();
return endpoint;
}
关于我的服务实施
@Service
@WebService(serviceName = "MyWS", name = "MyWSPortType", portName = "MyWSPort", )
public class MyWSImpl implements MyWS {
答案 0 :(得分:1)
参数“publishedEndpointURL”看起来就像您正在搜索的那个。