3

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..

John Saunders
  • 160,644
  • 26
  • 247
  • 397
freemnd76
  • 31
  • 2

4 Answers4

1

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.
bezmax
  • 25,562
  • 10
  • 53
  • 84
1

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.

andyczerwonka
  • 4,230
  • 5
  • 34
  • 57
1

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
  • 305,152
  • 44
  • 369
  • 561
  • SOAPUI can be configured to invoke the WSDL2JAVA tools provided by the standard Java web frameworks like Apache Axis2 + CXF – Mark O'Connor Jun 15 '10 at 19:14
  • But it's not necessary to use either of those to communicate with web services. I never do any of that stuff. – duffymo Jun 15 '10 at 22:17
0

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:

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

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185