Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to invoke a Web Service using Java

I am new to Web services. I need to invoke a web service whose definition is in http://api.search.live.net/search.wsdl . I need to do a search of any keyword by using this web service. I search on the net but could not find any solution. Any idea how to invoke the web service. I need to use Java.

like image 807
erencan Avatar asked Nov 04 '22 19:11

erencan


1 Answers

Download axis2.

After extracting it, under the bin folder there is a tool called wsdl2java, this is used to generate stubs from the WSDL that can communicate with the webservice.

A sample usage would be:

WSDL2Java -uri http://api.search.live.net/search.wsdl  -d xmlbeans -s

look here for more details on that tool.

Besides stubs it will also generate all the objects you need.

Here is a tutorial using axis2 and Eclipse IDE.

like image 105
Tomer Avatar answered Nov 09 '22 09:11

Tomer