Reputation: 197
I have a WSDL that is being generated by Apache CXF WS that looks like this
<wsdl:service name="MyWS">
<wsdl:port binding="tns:MyWSSoapBinding" name="MyWSImplPort">
<soap:address location="http://someaddress/MyApp/ws/MyWS"/>
</wsdl:port>
</wsdl:service>
I would like to change the soap:address
to have the protocol of https
instead of http
.
The reason behind this need. We are running a SpringBootApp on a tomcat server behind a LoadBalancer. The load balancer will receive the request on address https://someaddress/MyApp/ws/MyWs?wsdl
and then forwards the request to the server through http
. When the wsdl is autogenerated by Apache CXF, it is generating it with the soap:address with the protocol of http
instead of https
.
In the 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;
}
On my Service implementation
@Service
@WebService(serviceName = "MyWS", name = "MyWSPortType", portName = "MyWSPort", )
public class MyWSImpl implements MyWS {
Upvotes: 9
Views: 9741
Reputation: 3367
The parameter "publishedEndpointURL" looks like the one you're searching for.
See: http://cxf.apache.org/docs/jax-ws-configuration.html
Upvotes: 4