views:

41

answers:

4

Hi All,

I am new to web services. I have a requirement in my project. I have to consume the web services of our vendor in my project. All he has shared with me is a WSDL file and a document about the description of the the different operations. Question:- 1: What do I need to do consume these web services in my java project? I have been advised to use axis2, eclipse with tomcat6. 2: Do I need to ask for some other files/information from WS vendor OR wsdl file is enough to consume these web services? 3: Do I need to write a java WS client (using axis2 plugin) or another webservice which will talk to vendor web service?

Please suggest the best possible way.

I am sorry if the question sounds like a naive..

+1  A: 

Axis is a solid choice for such application.

  1. You need to generate an axis client based on the provided WSDL. Then you import the generated client and use it's methods. You can see the details of this process here (read whole page or starting from the linked section): http://ws.apache.org/axis2/1_0/userguide3.html#Writing_Web_Service_Clients_using_Code_Generation_with_Data_Binding_Support
  2. You could also need some entry-point (WebService URL).
  3. You need to generate a client, not a webservice. See point 1.
Max
+1  A: 

Don't use Axis if you need ambient authentication in a Windows environment. I went down that path and ended up going with Apache CXF - which seems better to me anyhow.

arcticpenguin
+1  A: 

You can use SOAP UI to test the web service. It'll read the WSDL, let you create requests by filling in values, and display the response that you get back. It might help you get a better understanding of what the service does before you start writing your classes.

duffymo
SOAPUI can be configured to invoke the WSDL2JAVA tools provided by the standard Java web frameworks like Apache Axis2 + CXF
Mark O'Connor
But it's not necessary to use either of those to communicate with web services. I never do any of that stuff.
duffymo
A: 

You don't need to create a new web service in order to consume a web service, you need to write a web service client.

Similar question to this one:

http://stackoverflow.com/questions/2559074/steps-in-creating-a-web-service-using-axis2-the-client-code

All the standard web frameworks have a command (normally called wsdl2java) that will read the WSDL and then generate a java based client object.

I can recommend Axis2, but another popular choice is CXF

Mark O'Connor