I deployed a JAX-WS Service and use wsimport to generate client code. Because I run wsimport on localhost, I got the client code with binind on "localhost" address.
But I want to reuse those client code on other computers which access my deployed service with a public IP y.y.y.y. How can dynamically use those (once) generated client code to access my service. (The ip of service may change...)
A web services client is an application capable of sending and receiving SOAP messages. Such an application serializes or deserializes the SOAP messages to a programming language type system enabling programmatic processing.
This is covered in the FAQ of JAX-WS:
Q. How can I change the Web Service address dynamically for a request ?
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "...");
Sure. Take a look at the JBoss example. Here's the relevant code snippet:
BindingProvider bp = (BindingProvider) port;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://your.wsdl.location");
Usually the WSDL is generated and therfore the WS provider inserts the relevant URLs into the WSDL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With