How to consume webservice given a wsdl file and a method name
843785Jan 22 2009 — edited Jan 22 2009I was given a url: http://test/service?wsdl
When I type it in a browser, I can guess that I am getting a wsdl file.
My code is like this
<code>
String endpoint = "http://test/service";
Service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint)); //is this correct?
call.setOperationName(new QName("", "callMethod"));//what should I put in the first parameter for QName constructor?
String ret = (String) call.invoke(new Object[] {});//code execution doesnt return from here.
</code>
given the xml/wsdl I don't knwo how to extract the correct parameters to pass in my code. Please assist.