Axis Web Service

Axis is widely use web service framework in SOA, because of its simplicity. It help developer to write only business related code, rest of them, will take care by axis api's. Axis allows us to customize api to our extended classes/objects, So its depends on application level, how to customize!!!!!!!! :)

Source code Repository Location : - http://code.google.com/p/wikipoc/
Here is basic example of axis web service, when service definition is defined in a WSDL file.
This example have an "account service", and service contains basic CURD operations.
.
Create Service Definition First (account service wsdl file)
      • Open Eclipse
        • Create a dynamic web project
          • apache-axis2-ws

Now click on Finish Button

    Once project created, please create source structure of your project.

    Please select resource and go to new
    • Other


    Once you clicked on other, you will get below mention menu
    • Web Services
        • WSDL
    Select WSDL and click on Next Button


    In target name space you have to provide namespace for you schema and service. You have to also provide protocol and binding style for service.


    This wizard will give you basic structure of WSDL file, now you have to customize it; as below mention structure.

    Please find below account service definition.
    • wsdl
      • definitions
        • types : Contains element definition and XSD element definitions.
          • Inside type we have request response types along with sub element of request response.
        • message : Contains input and output message details.
        • port type : port details along with associated web service operation.
        • binding : Contains binding of web service operation.
        • service : service definition and binding details.
    WSDL : To view wsdl file, Please Click on below mention link.
    Once WSDL definition completed, so we can proceed for service skeleton generation.

    Generate Service Skeleton

    To Generate Service Skeleton, you must have Apache Axis2 Distribution Bundle.
    Download axis distribution from below mention location.
    Once download complete, please unzip/extract it.

    Set AXIS 2 preferences in eclipse and configure axis2 run time setting.

    In eclipse -> Go to Window -> Preferences

    Here you have to provide location of axis 2 home location.
    once you will get "Axis2 run time loaded successfully" go to another tab and set Axis2 preferences.



    Please configure Axis2 Preferences according to you need. Once every thing set and configure , press Apply and Ok Button.




    To Generate skeleton, Please select project and go to new
    • Other



    Please Select Top Down Approach (WSDL to Java Code Generation) and provide WSDL path as input of service definition.

    Please click on Next button.



    Here you have to select Skeleton folder where all service related code to be generate.



    Click on Start Server button.



    Once Server started, Next button will be enable , please click on Next button.



    Web Service Explore window will open along with operation.


    Please click on Finish button.



    Go to Page 2

    Comments

    Popular Posts