Working with XSLT Service Engine: Part 2

Project summary: In This project, I am going to do xml to xml transformation using Service Bridge. Please Check working with XSLT Service Engine Part 1 for more details about XSLT Service engine and sample project for Request-Reply service of XSLT service Engine. In this sample project I am going to take customer information like Name , Address , Personal Data in separate node and then merge all above info in single node. Creating Sample Project Using   Service Bridge (xml to xml transformation) In Service Bridge we can apply multiple xml transformation on request xml and then send output back to source. We need to have same number of wsdl operation as number of transformation we want to do. In this project I am going to apply two xml transformations. So I need to create two wsdl as webservice operation to perform transformation. Let’s  say Request1 and response 1 – first operation Request2 and response 2 – second operation Client will send request via request 1 and response 1 will get back to client but over all process will something like this . (Client input xml)Request1–>apply xsl on input to generate request2–>  request 2àappy xsl on request 2 generate response 2–>  response 2 –> apply xsl on response2 to generate response1 –> response 1(client output xml). Create XSLT Module: Please refer to part 1 for details to create XSLT module. Create XSD for request and reply operation <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://xml.netbeans.org/schema/CustomerDetails" xmlns:tns="http://xml.netbeans.org/schema/CustomerDetails" elementFormDefault="qualified"> <xsd:complexType name="CustomerName"> <xsd:sequence> <xsd:element name="firstName" type="xsd:string"/> <xsd:element name="lastName" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="CustomerAddress"> <xsd:sequence> <xsd:element name="HomeAddress"/> <xsd:element name="OfficeAddress"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="PersonalData"> <xsd:sequence> <xsd:element name="gender" type="xsd:string"/> <xsd:element...

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...

SSL, Keystore, Truststore and Mutual Authentication

For the past four days I was trying to configure 2 instances of OpenESB instances with SSL Mutual authentication. I initially thought it is straightforward that I just need to import their respective certificates in the truststore of their counterparts. But it proved more difficult than that. This blog entry is my notes on one of the hurdle I faced and how I resolved it. What is Mutual Authentication? In General, SSL authentication is used in websites to authenticate the server. Which means that the server has to authenticate to the client by sending a digital certificate signed by a well known trusted CA. If the CA is trusted by the browser, the website is safe and you will see the address bar highlighed in green. In Mutual Authentication, in addition to server authentication, the client also has to present its certificate to the server. The server verifies it by checking if it is signed by a trusted CA and if it is tampered. If both server and client authenticated themselves, then SSL authentication is a success. How does mutual authentication actually works in Java? Keystores and truststores are the important pieces to get this work. Both keystores and truststores are storage files for private keys, public keys and certificates. But there is a big difference. Keystore: Typically, it stores the identity information about the subject. In our case we need to store the server’s certificate along with its private key and certificate chain. Truststore: This holds the various certificates of Certifying Authorities. It need not store an individual’s certificate or a server’s certificate. Although technically they can be...

Receiving alerts in OpenESB

  Introduction: An Alert is a machine-to-person communication that is triggered when a specified condition occurs in a Project component. The condition might represent a problem that must be corrected, or the condition might be informational. An alert may also contain user-requested content such as a reminder (important), a notification (urgent), and ultimately an alert (important and urgent). An alert notification is triggered when a specified condition occurs in a component or a service unit. The condition might represent a problem that must be corrected, or the condition might be informational. Alert Notification severities could be one of the following: Fatal Critical Major Minor Warning Info Alerting in Open ESB The Alert Management is embedded in Glassfish ESB’s JBI Runtime. The alerts can be generated from various sources – BPEL, EJB, a POJO, etc. The project developer also can raise alerts at certain events when it occurs in the composite application / BPEL/Java code. These alerts can then be managed and monitored from a Alert Client. UseCases The below are the usecases where Alert Management is useful: Capture Alert Event Notifications from Composite Applications, Java EE components, the JBI runtime, JBI Component Containers, and JMS Servers Allow the Alert Client to enable/disable the persistence of events generated by the Composite application. Allow the client to define a policy that will remove alerts from the persistence to prevent persistence from degrading system performance. An Alert removal policy can define the alert max age, the alert level to discard and the total number of alerts allowed to be persisted. Allow the client to enable/disable the policy mentioned above Allow the client...

GlassFish – Configuring JMS Connection Factory to connect to MQ Cluster

Recently, I was trying to find out how to configure a JMS Connection Factory to connect to MQ Cluster. I wanted to send and receive messages from MQ Cluster. It was very hard to find this information in one place. I found that this information is scattered and buried with other info. This blog is to help others to make this information easily available. I assume that you will be already knowing how to configure a JMS Connection Factory from admin console. So in this blog I will directly get to the point where you will change an  existing JMS Connection Factory to connect to MQ cluster. In Glassfish, for every JMS Connection Factory we create, the application server automatically creates a Connector Resource. It also creates a Connector Connection Pool with the same name and associates the connector resource with this connection pool. The connector connection pool is by default for the resource adapter called “jmsra”. For connecting to MQ Cluster we are going to create a new connector connection pool for resource adapter, “sun-jms-adapter” and associate this connection pool to the connector resource. Create a new Connector Connection Pool In admin console, go to Resources –> Connectors –> Connector Connection Pools. Click on New. Please make sure that you  select “sun-jms-adapter” as Resource Adapter. Click Next. Scroll down to the properties section. Add the properties as below: set the ConnectionURL property with comma separated URLs of MQ brokers. For example: mq://system1:7676,mq://system1:7677 Click on Finish. Now you can associate this connector connection pool to the connector resource. Locate the connector resource for the corresponding JMS Connection Factory. Go...