Working With XSLT Service Engine: Part 1

About the XSLT Service Engine The XSLT Service Engine is a Java-based transformation engine that is used to convert XML documents from one data format to another. The XSLT Service Engine makes it easier for users to configure and expose XSL style sheets as web services. Using the XSLT Service Engine requires no special knowledge of XSL, but rather allows any XSL style sheet to be deployed as a JBI service unit. The XSLT Service Engine is not solely responsible for performing transformations. XSL style sheets implement a web service operation (as normally defined in a WSDL). When deployed as JBI service units, these service units correspond to a service endpoint. Each endpoint is activated when the XSLT service unit is deployed. In a sense, the XSLT Service Engine is a container of XSL style sheets, each of which represents a service endpoint in the JBI environment. The following steps highlight the life cycle of a typical message using the XSLT Service Engine: The XSLT service unit is configured with service endpoint information. The service unit is deplopyed, along with the XSL style sheet, to the JBI environment. The XSLT Service Engine compiles the style sheet. A message arrives and the XSLT Service Engine searches for the service endpoint responsible for handling the message. The message is transformed using the service endpoint’s XSL style sheet. A response is sent back via the Normalized Message Router (NMR). XSLT Service Engine Features The XSLT Service Engine supports the following use cases: Request-Reply Service Request-Reply is a standard request-reply scenario. An XML message request is transformed and the result is sent back...

Working with OpenESB WLMSE

Overview Here we will attempt to create simple Application that demonstrate use of WLM Application. Before we begin, quick introduction to WLM is appropriate. WLM stands for Worklist Manager. It allows you to create Web Service Application that require human action/decision (one of pre-defined options) based upon some input data. So, in nutshell, the WLM application can be fed messages (predefined type) and exposes some API’s (can be used to build Web Interface) that allows assigned user’s to see the requests as list of tasks for some actions/decisions. The resulting choice of the user will be sent back as output message (again pre-defined type) to calling service. The service interface is defined using WSDL and the communication is Synchronous. WLM application can be best thought of means to incorporate human step in an automated process. For example, if you need to incorporate human approval step in you BPEL Process, you can achieve this using WLM Application. It also provide features such as Task Escalation, Notification etc. This is what we are going to do in this Helloworld Application. A WLM Application has three components: Please refer to Downloads for required components download Design Time You can use Netbeans (download page) with SOA Modules and create WLM Project type. Using worklist editor, you create task definition wherein the aspects about the task definition is specified. More on this later. Runtime The built project is deployed on Glassfish with JBI Runtime Environment. Project Open-ESB provides a Service Engine called sun-wlm-engine which provide runtime implementation for WLM Projects. Web Application The Users of the Task can log on to Web Console and...

Running Apache Camel in OpenESB – Part 2

In my previous post, I gave a step by step guide on running your first camel application in OpenESB. This entry is continuation to that it shows how to invoke an outbound JBI call from Camel. We will modify the same application to send message to a Glassfish’s JMS Queue instead of ActiveMQ’s queue. 1. To send a message to Glassfish’s Queue, we need a create JMS Binding WSDL Create a WSDL using the Wizard and select JMS Binding. Follow the wizard to provide a queue name, access details, etc. The WSDL should be created in CamelCompAppJBIModule1 project in default package. Choose the jbi2camel.xsd and select input element as msg:AnyMessage. Below is the types part and message part from the wsdl: <types> <xsd:schema targetNamespace="http://openesb.org/jbi2camel/CamelJBIModule1"> <xsd:import schemaLocation="jbi2camel.xsd" namespace="http://openesb.org/jbi2camel/message/CamelJBIModule1"/> </xsd:schema> </types> <message name="JMSInputMessage"> <part name="part1" element="msg:AnyMessag"/> </message> 2. Edit the jbi.xml in CamelCompAppJBIModule1 project to add the consumes element: <consumes service-name="JMSOutService" endpoint-name="jmsTestQueue_OutPort" interface-name="jms:JMSOutPortType" > </consumes> Make sure the service-name, endpoint-name, interface-name are the same ones from the newly created JMS wsdl. 3.  Edit the AppRouteBuilder.java as below:   public void configure() { String jbiJMSTestQueue = "jbi:http://j2ee.netbeans.org/wsdl/CamelJBIModule1/src/jmsTestQueue/JMSOutService/jmsTestQueue_OutPort"; //(A) String jbiURI = "jbi:http://openesb.org/jbi2camel/CamelJBIModule1/CamelJBIModule1_service/jbi2camel_endpoint"; //(B) from(jbiURI).process(new Processor() { //(C) public void process(Exchange exchng) throws Exception { Message inMessage = exchng.getIn(); String strInMsg = inMessage.getBody(String.class); System.out.println("Received in Processor : " + strInMsg); String strOutMsg = strInMsg.replace("My String", "MyReply"); exchng.getOut().setBody(strOutMsg); // (D) }}).to(jbiJMSTestQueue); //(E) } A) The variable “jbiJMSTestQueue” refers to the JMS WSDL’s endpoint. This URL is constructed by concatenating namespace, service name, port name. E). This line sends the message to the new JMS Queue. 4) Right click on Service Assembly node and “Clean” it....

Maven archetype for creating OpenESB Components

This blog shows how to develop OpenESB component project in few steps using maven archetype. New generated projects can be built with OpenESB build process. The project generated using the following maven archetype will be similar to the existing component folder structure and can ONLY be built with OpenESB build process. Following two categories are possible for projects in OpenESB component development. – Plugin project – This project will build with netbeans-soa build process. – Component project – This project will build with ojc-core in openesb-component ====================================== Install Archetypes in Users local repository: ====================================== NOTE: Maven version should be 2.0.9 as same as OpenESB 1 – Checkout Archetype projects from OpenESB git repository: (openesb-componentsmaven-ojc-archeType-v2) maven-archetype-service-engine-v2 maven-archetype-binding-component-v2 maven-archetype-service-engine-plugin-v2 maven-archetype-binding-component-plugin-v2 Archetype of Service Engine ——————————— 1.1) Change directory to maven-archetype-service-engine-v2/ $ mvn clean install Archetype of Binding Component ——————————— 1.2) Change directory to maven-archetype-binding-component-v2/ $ mvn clean install Archetype of Service Engine’s Plugin/Module Project ——————————— 1) Change directory to maven-archetype-service-engine-plugin-v2/ $ mvn clean install Archetype of Binding Component’s Plugin/Module Plugin Project ——————————— 1) Change directory to maven-archetype-binding-component-plugin-v2/ $ mvn clean install ==================Installation complete for all archetype in User’s Local repository============== ================================================= Building Projects from archetypes ================================================= 1) Create new service engine: mvn archetype:generate -DarchetypeGroupId=open-jbi-components -DarchetypeArtifactId=service-engine-ojc-archetype -DarchetypeVersion=2.3.0 -DgroupId=newse -DartifactId=newse –OutPut for above command requires user input [INFO] Scanning for projects… [INFO] Searching repository for plugin with prefix: ‘archetype’. …… [GIVE THE Command line params options as per your wish and openESB configuration. [INFO] Using property: groupId = newse [INFO] Using property: artifactId = newse Define value for property ‘version’: 1.0-SNAPSHOT: [INFO] Using property: package = newse [INFO] Using property: componentName = newse...

Using MTOM in Composite Application

We recently found an issue with MTOM handling in OpenESB 2.2. Where MTOM encoded response was not been send to client as response. I am writing this blog to give the problem in general we might face when we work with MTOM in OpenESB httpbc and a workaround. What is MTOM: (Message Transmission Optimization Mechanism) MTOM is the W3C Message Transmission Optimization Mechanism, a method of efficiently sending binary data to and from Web services. Normally when we send the SOAP response from the web service, where base64 attachment is there in response. SOAP response will include the base64 string as inline. As follows <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:downloadImageResponse xmlns:ns2="http://ws.mkyong.com/"> <return>fsf33089f!ksfof......</return> </ns2:downloadImageResponse> </S:Body> </S:Envelope> Above response is good for small attachment, where payload is less, but some time base64 is not the perfect way for responding larger binary data. With MTOM, the above response will look like : <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:downloadImageResponse xmlns:ns2="http://ws.mkyong.com/"> <return> <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:012eb00e-9460-407c-b622-1be987fdb2cf@example.jaxws.sun.com"> </xop:Include> </return> </ns2:downloadImageResponse> </S:Body> </S:Envelope> //Binary content --uuid:c73c9ce8-6e02-40ce-9f68-064e18843428Content-Id: <012eb00e-9460-407c-b622-1be987fdb2cf@example.jaxws.sun.com> Content-Type: image/png Content-Transfer-Encoding: binary As you can see it will have xop XML-Binary Optimized Packaging (XOP) technique : which is more appropriate standard for web service response with attachment. For more detail you can read it online specification and examples, there are lot of material present there in detail. Using MTOM in OpenESB There could be two scenario while uisng MTOM in Composite Application ExternalClient ————–>htttpbc————>bpel( or any JBI Component) bpel( or any JBI Component)———>httpbc———–>ExternalWebservice The first scenario works fine where httpbc is provisioning the service, However the second scenarion in which  an user want to use MTOM while making an Outgoing CALL (invoking...