SOA / Web Services / Java

A Technology Blog

Download MQMON tool

Posted by Vivek on January 21, 2012

1. Download the following file.
2. Change the extension to .zip from .odt format
3. Extract the zip file on your local machine and use the tool. (No installation required)

MQMONTool

Posted in IBM Websphere MQ, Middleware | Tagged: , , | 1 Comment »

Download Free SOA Knowledge Kit

Posted by Vivek on January 8, 2012

PushToTest is offering free SOA knowledge kit that includes comparison of top middleware vendor products. Follow this link:

http://www.pushtotest.com/a-guide-to-the-soa-knowledge-kit

Registration Link – http://www.pushtotest.com/soa

 

 

Posted in integration, Middleware, SOA | Tagged: , | Leave a Comment »

JSON vs XML in REST WS

Posted by Vivek on January 8, 2012

One distinctive feature of REST web service is that it supports message formats other than XML or SOAP.  In a REST based web service, resources are identified by a unique URI and can support formats such as XML, JSON, HTML, CSV etc. However, XML and JSON (JavaScript Object Notation) have gained more visibility and are widely used formats. While XML is still the preferred choice, JSON is not far behind than XML.

1. XML is verbose and causes performance bottlenecks. The primary objective behind adoption of REST is to increase the performance of services and XML does not provide good support here.

2. Those using Java can easily parse JSON as it is well supported by javascript clients. Nowadays, all browsers support javascript and browsers like firefox 4 and IE8 also provide special support for parsing JSON. Afterall, JSON is a subset of javascript. Note that not all browsers support encoding and decoding of JSON.

3. There is support in leading XML editors like XML Spy for JSON. Other editors will soon follow the same. However, this will take some time. JSON schema is not widely accepted and is still evolving.

4. Processing JSON requires less effort and is not memory intensive. Fewer lines of code without any dependency on external JARs reduces overhead.

5. JSON can pose several security problems if the processing program contains insecure scripts. There is no standard security mechanism that can be used. JSON is a preferred approach only when the data and parsers are from a trusted source.

6. A variety of XML processors are available in the market. Also, there are techniques to compress XML or accelerate XML processing. JSON has a limted playing field.

 

Posted in Java/J2EE, Miscellaneous, Web Services | Tagged: , , | Leave a Comment »

Checklist for a new interface in integration

Posted by Vivek on January 8, 2012

While integrating several systems, interfaces are created based on the technical requirements. The interface is defined by a set of parameters, which form building blocks of any interface design.

1. Name: This involves name of the requesting application as well as the service provider or name of the systems involved in the conversational process. Ex. ABCProvider_WeatherService
2. Integration Style: This includes information such as Batch or Real-Time.
3. Integration Technology Framework: This includes information such as ETL (eg Datastage, Ab Initio, Informatica), Web Services, EAI, B2B
4. Invocation Style: It includes the way in which the integration application will be invoked. Invocation could be through Database trigger or Change Data Capture, Manual or through sequencer (in case of ETL).
5. Message Exchange Pattern: It includes information about the way in which messages are exchanged such as Request-Reply, Fire and forget, Pub-Sub topology
6. Message Domain: It includes details such as HL7 for Healthcare, ACORD for Insurance etc
7. Message Format: It includes details such as XML, CSV, Pipe delimited messages, SOAP including web service standards such as WS-Addressing, WS-RM, WS-BaseNotification
8. Messaging Style: Messages could be transported using HTTP, SMTP, MQ etc.
9. Service Contract: It can be WSDL for SOAP based web services, WADL for REST
10. Security: It includes non-functional requirements such as Authentication, Authorizarion, Confidentiality, Integrity and Non-Repudiation.
11. Security level: This can be Message level or Transport level.
12. Security Implementation: It can be WS-Security username token for authentication, SSL, Canonicalization algorithm for encryption/ descryption etc.

If these parameters are clearly defined, then it is possible to build the interfaceand use this information as metadata in governing the services in future.

Posted in integration, SOA, Web Services | Tagged: , | Leave a Comment »

Identifying services in SOA

Posted by Vivek on January 8, 2012

Perhaps the most critical task before embarking on a SOA journey is to identify and build the right set of services. This exercise requires not only technical knowledge but also functional knowledge as the services might span across business and techical domain of the enterprise. Based on the business and technical requirements, services can be classified into one of the four major categories.

1. Infrastructure or Utility services: Services falling under this category and mostly techical and discrete in nature and provide reusable functionalities and are internal to an enterprise. If there is a need to execute a piece of logic which is difficult to be rewritten and/ or is readily available on the other side of the firewall or business domain or is offered by a third party, then building a wrapper or client or choreographing the service with ESB provide easy access to the information saving a considerable amount of effort and cost. For example- a credit check service can be used by billing, HR or insurance domain within an enterprise. Similarly, authentication or authorization services can be reused across an organization.

2. Application services: These services are designed and developed to address a sepecific set of requirements. They can be composite and encompass the domain or functional logic within. These services are not generally accessed directly by the user. example: a packaging application service that packages and ships order.

3. Business Services: These services are exposed to the consumer and is composed by choreographing one or more application services. Example: An order service that takes an order, sends it for approval, confirms payment mode, processes transaction and triggers shipment.

4. Process Services: These services are used mostly by management and business analyst to make the business more agile. Process services involve orchestration of services and other components and typically take the form of a workflow. Example: A loan processing service which spans across HR, Finance, Insurance departments. Loan interest rate might change from time to time and a rule engine can serve the pupose for management.

Posted in SOA, Web Services | Leave a Comment »

Execution Group properties of a local/remote WMB

Posted by Vivek on September 10, 2011

Those using IBM WMB sometimes face issues when they have to connect to a remote broker and deploy their code to an execution group.  The utility (mqsireportproperties) provided by IBM Websphere Message Broker does not allow to read the properties of a remote broker and it is sometimes not possible to log on to a remote broker machine to execute the mqsireportproperties command. Common problems faced by users in such situation are -

1. User requires MB toolkit/ MQ Explorer 7 to connect to broker and see EG details. It is difficult for a user who does not have these tools on his/her machine.

2. User cannot see/ set the properties like debug port, HTTP port on an execution group.

Most user do not know that they can leverage the ConfiguarionManagerProxy APIs as a workaround mainly because WMB users are not generally java savvy. Here is a utility (Simple Java Program) which will help to set and report the properties on a local or remote broker. It is easy to alter and run from command line.

Prerequisites:

1. Java 6

2. Following jars are added in  classpath – ConfigManagerProxy.jar (located at ../MQSI/7.0/classes), com.ibm.mq.jmqi.jar (located at ../Websphere MQ/Java/lib) and com.ibm.mq.jar (located at …/Websphere MQ/Java/lib)

import java.util.Enumeration;

import com.ibm.broker.config.proxy.BrokerConnectionParameters;

import com.ibm.broker.config.proxy.BrokerProxy;

import com.ibm.broker.config.proxy.ConfigManagerProxyLoggedException;

import com.ibm.broker.config.proxy.ConfigManagerProxyPropertyNotInitializedException;

import com.ibm.broker.config.proxy.ExecutionGroupProxy;

import com.ibm.broker.config.proxy.MQBrokerConnectionParameters;

import com.ibm.broker.config.proxy.MessageFlowProxy;

/**

 * This utility connect to a broker and reports the properties on an execution

 * group.

 *

 * @author vivek

 *

 */

public class EGStatusReport {

      public static void main(String args[]) {

            try {

                  BrokerConnectionParameters bcp = new MQBrokerConnectionParameters(

                              “localhost”, 1425, “MYQMGR”);

                  BrokerProxy b = BrokerProxy.getInstance(bcp);

                  Enumeration<ExecutionGroupProxy> listEG = b

                              .getExecutionGroups(null);

                  while (listEG.hasMoreElements()) {

                        ExecutionGroupProxy egIter = listEG.nextElement();

                        // Get Execution Group Name

                        System.out

                                    .println(“Execution Group Name – ” + egIter.getName());

                        //GetDebugPort

                        System.out.println(“Debug Port of EG – “

                                    + egIter.getDebugPort());

                        //GetHTTPPort

                        System.out.println(“HTTP port enabled on EG – “

                                    + egIter.getRuntimeProperty(“HTTPConnector/port”));

                        // Get List of Message Flows and their details

                        Enumeration<MessageFlowProxy> listMsgFlow = egIter

                                    .getMessageFlows(null);

while (listMsgFlow.hasMoreElements()) {

                              MessageFlowProxy msgFlow = listMsgFlow.nextElement();

                              // Get name of message flow

                              System.out.println(“Messsage Flow Name – “

                                          + msgFlow.getName());

                              // Get BAR File Name

                              System.out.println(“BAR File Name – “

                                          + msgFlow.getBARFileName());

                              // Get time of deployment

                              System.out.println(“Deployed at – “

                                          + msgFlow.getDeployTime());

                              // Get run status of Message Flow

                              System.out.println(“Is run enabled? – “

                                          + msgFlow.isRunEnabled());

                        }

                        // Get number of deployed objects

                        System.out.println(“No of deployed objects – “

                                    + egIter.getDeployedObjectsCount(null));

                  }

            } catch (ConfigManagerProxyLoggedException e) {

                  e.printStackTrace();

            } catch (ConfigManagerProxyPropertyNotInitializedException e) {

                  e.printStackTrace();

            }

      }

}

Refer to the following URL for complete list of methods: 

http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.cmp.doc%2Fcom%2Fibm%2Fbroker%2Fconfig%2Fproxy%2Fpackage-overview.html

Posted in IBM Websphere Message Broker, integration, Java/J2EE | Leave a Comment »

Adapter and Façade – The Design Patterns of SOA

Posted by Vivek on August 6, 2011

Adapter:

This design pattern helps to take advantage of the existing technology or aplications. One of the principles of SOA is reuse. Adapter fosters reusability by integrating legacy or packaged applications with your ecosystem. Application built using mainframe technologies like CICS, COBOL etc still have a place in today’s IT infrastructure. Capabilities and usage of packaged applications like Siebel CRM, Peoplesoft HRM, Portal billing, SAP CRM etc are not limited because of technical implementations. One of the well known adapters is JCA (Java Connector Architecture) adapter.

Façade:

A right level of granularity is essential when designing services. Services, in context of SOA, can be considered as a unit of logic. SOA recommeds use of coarse granular services. Reason is simple – It avoids making multiple calls to service and hence increases network throughput. But sometimes it is difficult to avoid designing and developing low-level services (mostly utility services). Façade helps in providing coarse granurality by encapsulating low level services. Façade pattern also abstracts client from the implementation details of a service. Most of the times, changes in a service does not impact client because of usage of Façade pattern.

 

 

Posted in SOA, Web Services | Tagged: , , | 1 Comment »

Open Source is NEXT

Posted by Vivek on August 6, 2011

I am a big fan of some of the open source technologies. Some of the open source tools available in market are as good as or even better than vendor products/ tools.
While i always look out for new tools, this is a great site which enlists all open source tools.

http://olex.openlogic.com/library/certified

Posted in Uncategorized | Tagged: , | 1 Comment »

MQMON – MQ Tool for Admins and Testers

Posted by Vivek on May 7, 2011

You might have come across many tools which allow you to communicate with message queues. Reading a message from queue and writing a message to queue are very common operations especially in projects where guaranteed messaging is extremely important. However, handling messages in queue is sometimes cumbersome.

Some of the tedious operations are reading a message which is somewhere in the middle (as queue operates in LIFO fashion). Putting messages in bulk into the queue and getting/ browsing multiple messages at a time are handy. Indexing is also important to identify the position of message in queue. It is imperative that an MQ tool should support all these features.

Those who install IBM MQ use MQ explorer wizard but it does not offer features mentioned above. Nor does it allow to view the message properly.

One can use RFHUtil to read/ write/ browse messages but it does not allow bulk insertion/ retrieval of messages. RFHUtil can be download from IBM site: http://www-01.ibm.com/support/docview.wss?uid=swg24000637

Performance testing cannot be performed unless messages can be published in bulk. Also, it is always better to save the Queue Manager settings to save some time and effort. These are some of the benefits that are offered by MQ Monitor tool (Also known as MO71) It can be downloaded from IBM site http://www-01.ibm.com/support/docview.wss?uid=swg24000142.

It provides a simplified GUI and is a very useful tool for Administrators and testers. Here is how it can be used and has an edge over other tools.

1. A freeware, this tool allows you to create connections to queue managers and save them for future use.

2. Allows you to index the messages and export them to a file.

3. Able to read the file and insert messages in queue based on index. This makes it simpler to modify any message in file and put it back in queue.

4. Searching an element/ word/ value  in message is easy when the message is written to a file.

5. Easy to navigate through all the queues. (List of queues can be seen using Queue List option. Search and filter options can be used)

6. Statistics can be easily calculated. Channel administration is supported.

Download MQMON from here – http://oracled.wordpress.com/2012/01/21/download-mqmon-tool/

Posted in integration, Middleware | Tagged: | Leave a Comment »

Dynamically upload files using JQuery

Posted by Vivek on April 10, 2011

If you developing a web page and you have a requirement that multiple files need to selected and uploaded, then conventional file upload mechanisms do not work. You might see a lot of web applications which allow you to upload files but the file upload limit is pre-determined. In cases, where the number of files to be selected is not known, these solutions do not work or adds more complexity to the code. JQuery is one way to achieve the desired result and the advantage is that it is an advanced form of Javascript and is easy to understand and allows writing less code.   

The following example demonstrates how JQuery can be used to upload files dynamically. You just need to import some javascript files and that’s it.

<!DOCTYPE html PUBLIC ‘-//W3C//DTD XHTML 1.0 Transitional//EN’ ‘http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd’>

<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>

<head>

<title>Imporing XSDs</title>

<script src=’http://jquery-multifile-plugin.googlecode.com/svn/trunk/jquery.js’ type=”text/javascript”></script>

<script src=’http://jquery-multifile-plugin.googlecode.com/svn/trunk/documentation.js’ type=”text/javascript”></script>

<link href=’http://jquery-multifile-plugin.googlecode.com/svn/trunk/documentation.css’ type=”text/css” rel=”stylesheet”/>

<script type=”text/javaScript” src=”http://www.fyneworks.com/jquery/project/chili/jquery.chili-2.0.js”></script>

 <script type=”text/javascript”>try{ChiliBook.recipeFolder=”/jquery/project/chili/”}catch(e){}</script>

<script src=’http://jquery-multifile-plugin.googlecode.com/svn/trunk/jquery.form.js’ type=”text/javascript” language=”javascript”></script>

<script src=’http://jquery-multifile-plugin.googlecode.com/svn/trunk/jquery.MetaData.js’ type=”text/javascript” language=”javascript”></script>

<script src=’http://jquery-multifile-plugin.googlecode.com/svn/trunk/jquery.MultiFile.js’ type=”text/javascript” language=”javascript”></script>

<script src=’http://jquery-multifile-plugin.googlecode.com/svn/trunk/jquery.blockUI.js’ type=”text/javascript” language=”javascript”></script></head>

<body> 

Import Files

<br></br>

<form action=”upload.jsp” method=”post” enctype=”multipart/form-data” name=”form1″ id=”form1″>

<input type=”file”/>

<br /><br />

<input type=”submit” name=”Submit” value=”Submit” />

</form></body></html>

 
 Learn more about JQuery at http://docs.jquery.com/How_jQuery_Works.

 

Posted in Java/J2EE | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.