Search code examples
javaweb-servicescxfapache-axis

Consume SOAP webservice in java, only WSDL in hand


I need to consume a web service in java/jsp code. Only the WSDL is available for me to start.

I understand I need to convert the WSDL into java client JAR file using AXIS2 / CXF but I cannot build the whole application on this.

Can someone provide a simple example or basic steps for me to start on this?

I am not able to join the dots here. WSDL, java client JAR, AXIS2.... All online tutorials point on 'creating' a web service.


Solution

  • WSDL is just the conract for the web service. You need to generate client code using it, later you can implement your code to call the web service. Like @maerics pointed out, you should use wsdl2java to generate your client code for AXIS2 and use your client to consume the web service.

    You can check this link for an example of client stub generation for AXIS2.