Search code examples
javaapacheapache-axis

How to use axis2 code generator?


I want to build a web service client and after some research i tried to use axis2Java in Eclipse.

I wonder how this works, I have the WSDL of the web service I want to access and i went through all the steps in the wizard of code generator, including the success popup at the end.

I thought it would generate some Java classes in order to be used in the construction of the SOAP request to the web service but I don't seem to find any.

I wonder what am I doing wrong with this? Any help?

Thanks


Solution

  • It sounds to me that you only imported the WSDL-file but did not create the Web Service client itself.

    Here is what you have to do to make this work in Eclipse:

    First open the "Import"-Dialog

    • File => Import => General => File System
    • Click "Next"

    Select the WSDL you want to import

    • Click the "Browse"-Button next to the "From directory" drop down menu.
    • Select the folder which contains the WSDL and click "OK"
    • Check the WSDL file in the right window (Make sure the file has the ending ".wsdl" so Eclipse recognizes it as such)
    • Click "Finish"

    Create a Webservice Client

    • File => New => Other => Web Services => Web Service Client
    • Click "Next"
    • Click the "Browse"-Button next to the "Service definition" drop down menu
    • Click another "Browse"-Button next to the URI-Textfield
    • In the Resource browser open your project and select the previously imported WSDL-file and click "OK"
    • Click "OK" and "Finish"

    Now the classes should be available in your src-directory.