Apache Axis2 and JAX-WS Tools

Content

Apache Axis2 Artifact

To create a Apache Axis2 Service Artifact, right click on the CApp project and select Axis2 Service from the menu.



New Server Runtime



There are three ways to create an Apache Axis2 Service Artifact.



New Server Runtime



Create an Apache Axis2 Service Artifact pointing a class file in the workspace

This option will be selected by default. If you already have a service class in your workspace, select Browse button and type the class name you want to specify.



New Server Runtime



You can create a new class from the scratch as well. To point a new service class, select New button. Now you will see, general java class creation page of Eclipse appears.



New Server Runtime



In the class creation wizard page give necessary information and click Finish.



New Server Runtime



Now you will see that the given information has been filled in to Apache Axis2 Service artifact creation wizard page. Then click Next.



New Server Runtime



Give a name to the Apache Axis2 Service artifact. This field will be filled automatically. If not, give a name you preferred. Then click Finish.





New Server Runtime



Now you will see axis2 artifact is created under artifacts folder. You can see HelloWorld.service and services.xml files also have been created.





New Server Runtime



Now we will add a method to HelloWorld java class.





New Server Runtime



Generate WSDL

This option is available under Generate category, if you right click on a .aar file or a .service file.





New Server Runtime







New Server Runtime



WSDL file will be created in the workspace.





New Server Runtime



Generate Apache Axis2 Client

This option is available under Generate category, if you right click on a .aar file, WSDL file or a .service file.





New Server Runtime







New Server Runtime







New Server Runtime



After selecting the option, in the next wizard page, it will automatically fill the source folder of the project, where your WSDL file or .service file or .aar file included. If you want to change the source folder, you can do it using Browse button. After selecting the Source folder, click Next.





New Server Runtime



Select the necessary Client Generation Options available in the next page and click Finish.





New Server Runtime



Now you will see, client classes has been created in the selected Source folder that you have given previously.





New Server Runtime



Generate Apache Axis2 Client for Online WSDL Resources

This option is available under ApplicationServer category of WSO2 main category when you follow File => New => Other (Ctrl+N) steps. file.





New Server Runtime







New Server Runtime



You can select Generate Axis2 Client from url wsdl and click on Next. Then you will get the Wizard shown below.





New Server Runtime



In this wizard page you can point to a WSDL file in your Workspace,File System or you can provide the online URL for the service using the option WSDL URI. Once you provide a valid WSDL URI via option WSDL URI, Next button of the wizard will be enabled to continue the wizard.





New Server Runtime



Click on Next. Now you will get another wizard page to select the location to generate the client. Here you have the option of using an existing project or create a new project in the workspace to generate the client.





New Server Runtime



You can use Browse button to select an existing project in the workspace to generate the client.





New Server Runtime



You can use Create a new Project link to create a new project in workspace to generate the client.





New Server Runtime



When you select a valid location for client generation, Next and Finish buttons in the wizard will be enabled.





New Server Runtime



If you click on Finish, it will trigger the client generation process with some default parameters. If you want to customize these parameters, you can click on Next.





New Server Runtime



After customizing these client generation options, you need to click on Finish. Then it will trigger the client generation process and it'll generate the client in the location you selected.





New Server Runtime



Generate Apache Axis2 Archive (AAR)

You can generate an Axis2 Service Archive(.aar) by pointing to an existing service(.service) file. Right click on your .service file. Select Generate menu. Then Select Apache Axis2 Archive (AAR). This will pop up a file system browser dialog. Then browse to the place where you want generate your Axis2 Archive file and select OK.





New Server Runtime



Generate Apache Axis2 Java Skeleton

This option is available under Generate category, if you right click on a .aar file or a WSDL file.





New Server Runtime







New Server Runtime



After selecting the option, in the next wizard page, it will automatically fill the source folder of the project, where your WSDL file or .aar file included. If you want to change the source folder, you can do it using Browse button. After selecting the Source folder, click Next.





New Server Runtime



Select the necessary Client Generation Options available in the next page and click Finish.





New Server Runtime



You can also create an Axis2 artifact using the skeleton classes that were generated. When Finish is pressed the following dialog will be displayed.





New Server Runtime



If you selected to create an Axis2 artifact you will have to select a Carbon Application Project to create the Axis2 artifact .





New Server Runtime



Now you will see, client classes have been created in the selected Source folder that you have given previously. Also the created Axis2 artifact have been created in the selected project as shown below.





New Server Runtime



Generate Apache Axis2 Java Skeleton for Online WSDL Resources

This option is available under ApplicationServer category of WSO2 main category when you follow File => New => Other (Ctrl+N) steps. file.





New Server Runtime







New Server Runtime



You can select Generate Axis2 Skeleton from url wsdl and click on Next. Then you will get the Wizard shown below.





New Server Runtime



In this wizard page you can point to a WSDL file in your Workspace,File System or you can provide the online URL for the service using the option WSDL URI. Once you provide a valid WSDL URI via option WSDL URI, Next button of the wizard will be enabled to continue the wizard.





New Server Runtime



Click on Next. Now you will get another wizard page to select the location to generate the skeleton. Here you have the option of using an existing project or create a new project in the workspace to generate the skeleton.





New Server Runtime



You can use Browse button to select an existing project in the workspace to generate the skeleton.





New Server Runtime



You can use Create a new Project link to create a new project in workspace to generate the skeleton.





New Server Runtime



When you select a valid location for skeleton generation, Next and Finish buttons in the wizard will be enabled.





New Server Runtime



If you click on Finish, it will trigger the skeleton generation process with some default parameters. If you want to customize these parameters, you can click on Next.





New Server Runtime



After customizing these skeleton generation options, you need to click on Finish. Then it will trigger the skeleton generation process and it'll generate the skeleton in the location you selected.





New Server Runtime



Apache Axis2 Service in the workspace

This is the second option to create an Axis2 Service artifact. If you already have a Web Services project in your workspace, you can create a service from that as well.



Note: This option will not be supported in our future releases.





New Server Runtime



Apache Axis2 archive(aar) in the file system

This is the third option to create an Axis2 Service artifact. With this option, you have to give the location of Apache Axis2 archive(aar) file in your file system.





New Server Runtime



Now you have successfully created an Apache Axis2 Service artifact from WSO2 Carbon Studio. You can deploy the created service to WSO2 Application Server and test. Detailed description of how to deploy any type of artifact to a Carbon Server can be found here.

Apache Axis2 Service with Contract First Approach

You can create an Apache Axis2 Service pointing a WSDL file, using WSO2 Carbon Studio. To create Apache Axis2 Service, first add the WSDL file in to your workspace.





New Server Runtime



Before creating the service, add a Carbon Server. You can find information regardig how to add a Carbon Server from here.

After adding the carbon server, right click on the WSDL file and select Generate Java Bean Skeleton from Web Services category.





New Server Runtime



Now you will see the Web Service wizard has been pop up.





New Server Runtime



Under Configuration, you will see added Carbon Server has been listed. Click on that.

Select Server runtime as the added Carbon Server and Web service runtime as WSO2 Carbon Server Runtime and click Next.





New Server Runtime



In the next page, you can specify other options like Port Name, Databinding Name etc.





New Server Runtime



In the next page, you will ask to start the server. Unless you start the server, it will allow to proceed.





New Server Runtime



After some time, you will see that the server has been started.





New Server Runtime



Now you will see, new Web Services Project has been created which contains the generated stubs for the WSDL you have pointed.





New Server Runtime



Now you can export this Web Services Project to Apache Axis2 Archive (aar) file with the Export option.





New Server Runtime



In the Export wizard, select Axis2 Service Archive [AAR] from WSO2 Exporter and click Next.





New Server Runtime



In the next page, you will see that the Axis2 Service Project has been filled up. Now click Finish.





New Server Runtime



Give a location where you want to save the Axis2 Archive. Now you have successfully created a Apache Axis2 Archive in contract first approach.

JAX-WS Artifact

To create a JAX-WS Artifact, right click on the CApp project and select JAX-WS from the menu.





New Server Runtime



There are four ways to create a JAX-WS Artifact.

  1. Create a JAX-WS Artifact from a class file in the workspace
  2. Create a JAX-WS from to a project in the workspace
  3. Create a JAX-WS from to a jar in the file system
  4. Create a JAX-WS from to a jar in the registry




New Server Runtime



With the first option, you can create new JAX-WS annotated class or select Create or JAX-WS annotated class from workspace, click on New.. to create new JAX-WS annotated class or , click on Browse to browse JAX-WS annotated class from workspace



new class dialog







browse class dialog



With the Create a JAX-WS from to a project in the workspace, you can select a project which contains JAX-WS annotated classes, this options help you to expose all JAXWS classes as service without pointing a specific class





new class dialog



With the Create a JAX-WS from to a jar in the file system, you can point to a jar file in the file system.





New Server Runtime



With the Create a JAX-WS Pointing to a jar in the registry, you can browse resources of the registry instance that you have already created or you can create a new registry instance as well. After selecting the registry instance, click on Browse to browse resources in registry.





New Server Runtime



Select the CApp project you want to create JAX-WS and click Finish.





New Server Runtime



Now you will see new JAX-WS artifact is created under the selected CApp project.





New Server Runtime