I am consuming a webservice soa, with netbeans (jax-ws) i use netbeans auto generate client, and all run fine, but i see that the wsdl is always downloading while the client
There are several ways, of which I will tell you two:
Save a copy of the WSDL document file and the schemma files to your project.
ClassLoader classloader = Thread.currentThread().getContextClassLoader();
URL wsdlLocation = classloader.getResource("MyHelloService.wsdl");
QName serviceName= new QName("http://test.com/", "MyHelloService");
MyHelloService service = new MyHelloService(wsdlLocation, serviceName);
service.sayHello("Test");
You may combine the WSDL document file with the schema files.
This solution requires the client generated.
QName qname = new QName("http://thenamespace", "FooService");
FooService service = new FooService(null, qname); // null for ignore WSDL
Foo port = service.getFooPort();
BindingProvider bindingProvider = (BindingProvider) port;
bindingProvider.getRequestContext()
.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://foo.com/soap/fooBean");
// Use the service
String result = port.doSomething(param);