Skip to main content

Posts

Showing posts with the label Axis2

Develop Carbon application using Axis2 service

In this blog, I’m going to create Carbon Application (C-App) using the Axis2 service (.aar file). http://amalkas.blogspot.com/2014/05/write-your-own-service-and-deploy-into.html References: https://docs.wso2.org/display/Carbon420/C-App+Deployment+Process https://docs.wso2.org/display/Carbon420/Introduction+to+Server+Roles Create the folder structure with .aar file (axis2 service) and artifact files as follows C-App -> artifacts.xml <?xml version="1.0" encoding="UTF-8"?> <artifacts> <artifact name="OrderProcessingServiceCApp" version="1.0.0" type="carbon/application"> <dependency artifact="OrderProcessingService" version="1.0.0" include="true" serverRole="EnterpriseServiceBus"/> </artifact> </artifacts> C-App -> OrderProcessingServiceCApp -> artifact.xml <?xml version="1.0" encoding="UTF...

Implement a client to invoke the service deployed in Axis2

In this blog, I’m going to implement a client to invoke the OrderProcessingService deployed in Axis2  http://amalkas.blogspot.com/2014/05/write-your-own-service-and-deploy-into.html Step 1: Generate the client stubs using wsdl2java tool Go to AXIS2_HOME/bin and execute the following command. >> ./wsdl2java.sh -uri http://localhost:8080/axis2/services/OrderProcessingService?wsdl -o /path/to/OrderProcessingClient -p com.wso2.orderprocessing.client com.wso2.orderprocessing.client.OrderProcessingServiceStub will invoke the operations of the service. Step 2: Implement a client to invoke the OrderProcessingServiceStub package com.wso2.orderprocessing.client; import java.rmi.RemoteException; import com.wso2.orderprocessing.client.OrderProcessingServiceStub.GetPrice; import com.wso2.orderprocessing.client.OrderProcessingServiceStub.Update; public class OrderProcessingClient {    public static void main(String[] args) {  ...

Test the service deployed in Axis2 using SoapUI

In this blog, I’m going to test the OrderProcessingService deployed in Axis2 using soap UI http://amalkas.blogspot.com/2014/05/write-your-own-service-and-deploy-into.html 1. Install and run soaup ui http://www.soapui.org/ 2. Create new soap project and add http://localhost:8080/axis2/services/OrderProcessingService?wsdl 3. Make an update request Request: POST http://localhost:8080/axis2/services/OrderProcessingService.OrderProcessingServiceHttpSoap11Endpoint/ HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "urn:update" Content-Length: 370 Host: localhost:8080 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.1.1 (java 1.5) <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.orderprocessing.wso2.com">   <soapenv:Header/>   <soapenv:Body>       <ser:update>        ...

Write your own service and deploy into Axis2

In this blog, i’m going to implement a simple service “OderProcessingService”, with 2 operations “getPrice” and “update”; and then deploy it into axis2. Step 1: Get your environment ready Download and install Java. Set the JAVA_HOME environment variable to the pathname of the directory into which you installed the JDK release. Download and install Tomcat to the a directory [CATALINA_HOME]; you can access its service at http://localhost:8080 Download the newest version of Axis2; WAR distribution and Standard distribution Install Axis2 WAR distribution on Tomcat; drop the .war file at CATALINA_HOME\webapps and restart Tomcat; make sure the deployment accessing http://localhost:8080/axis2 Install Axis2 standard distribution; upzip the distribution to a directory; [AXIS2_HOME] Add all .jar files in AXIS2_HOME\lib\* to the CLASSPATH Step 2: Create the service package com.wso2.orderprocessing.service; import java.util.HashMap; import java.util.Map; p...