Skip to main content

Posts

Showing posts from May, 2014

FORCE_ERROR_ON_SOAP_FAULT property in ESB 4.02

Is it possible to provide a patch for wso2 esb 4.0.2 version for using the above property. We are having requirements which we are not able to solve because of the restrictions in the current version FORCE_ERROR_ON_SOAP_FAULT property supports for ESB 4.5.0 onward versions. So we can have an alternative to do the required task using ESB filter mediator. Following example shows the configurations for proxy which filters for SOAP faults in outsequence and handover it to log if there is an SOAP fault. You can use the same configuration to handover the fault responses to appropriate sequence according to your scenario   <proxy name="testProxy" transports="https http" startOnLoad="true" trace="disable">         <target>             <inSequence>                 <send>                     <endpoint>                         < address uri=" http://localhost:8080/ axis2/services/ SimpleStockQuoteS

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

Monitoring SOAP messages using TCPMon

How to Monitor SOAP messages using TCPMon Let's assume you want to monitor the request and response SOAP message which are passing in the the http://amalkas.blogspot.com/2014/05/apache-axis2-hello-world.html http://www.mkyong.com/tomcat/how-to-change-tomcat-default-port/ Step 6: Monitoring the messages To view the request and response SOAP messages we can use the tcpmon tool. We can start the SimpleHTTPServer on port 9090 and make the tcpmon listen on port 8080 and forward the requests to port 9090. Using "-p9090" as an additional argument in starting the SimpleHTTPServer we can start it on port 9090. Example: sh http-server.sh /path/to/my-axis2-repo -p9090 Now when we run the client once again we can view the messages.

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) {        OrderProcessingSe

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>                 <ser:args0>IBM&l

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