Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to consume webservice given a wsdl file and a method name

843785Jan 22 2009 — edited Jan 22 2009
I 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 19 2009
Added on Jan 22 2009
8 comments
999 views