Hi all, I want to publish a jax-ws service at some runtime-specified machine. And at client side, use the stub class generated by wsdl2java to dynamically connect to this service.
So, at server side, I publish service at https://localhost:8082/Command. And at client side, I use URL serviceAddr = new URL("https", serverAddr, 8082, "/Command?wsdl"); CommandService commandService = new CommandService(serviceAddr); to get client stub object. The main problem in this solution is that the client stub returns the service address as https://localhost:8082/command since the auto-generated wsdl by server has <soap:address location="https://localhost:8082/Command"/> So, the client stub object ref the service at localhost:8082. This prevents the client runing at a different machine than server. My question is: 1. How to make server publish a service at its runtime ip address? That is, when publishing, I only specified port and fragment part, not the server ip part. Or, CXF server dynamically generate wsdl according to the server ip client connect to. 2. Or, how to reset the service ip address in client stub object? Thanks Weihua
