How to start cxf service on localhost but return external address in wsdl?

I use cxf and the berth behind apache to expose the web service through soap. The goal is to launch the berth at http: // localhost: 9000 in all cases and have an Apache proxy, but auto-generated wsdl shows soap: address (e.g. http://api.testing.example.com , http: //api.uat.example.com , https://api.example.com ). It seems that the generated wsdl2java * Service class accepts the URL for wsdl and should serve both as a "location" for the start and as a string returned in soap: address. This should be customizable, but it’s not obvious, so advice is welcome.

A little more clarity - I pass "WsdlURL" to the constructor of the Service class via Spring (so far only http: // localhost: 9000 is working). I need the solution to this problem to be a configuration change, either in cxf.cml, cxf-.xml, Spring, or in another configuration file, and not in the code, since this parameter will change depending on the environment it is deployed to.

+3
source share
2 answers

There is "publishedEndpointURL" in the jaxws: endpoint configuration file, which is used instead of the address, if one is specified. In knowledge, the servlet uses this correctly, and is not 100% sure of the berth. They have a lot of code, so they CAN work.

+2

@WebService(wsdlLocation="http://yourdesiredlocation"). , .

0

Source: https://habr.com/ru/post/1723138/


All Articles