<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Just Thoughts</title>
	<atom:link href="http://blog.padmarag.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.padmarag.com</link>
	<description>SOA and Integration blog</description>
	<lastBuildDate>Tue, 22 Jan 2013 02:31:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.padmarag.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Just Thoughts</title>
		<link>http://blog.padmarag.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.padmarag.com/osd.xml" title="Just Thoughts" />
	<atom:link rel='hub' href='http://blog.padmarag.com/?pushpress=hub'/>
		<item>
		<title>Generic Architecture for Cloud Apps Integration : Integrate multiple apps using JMS Publish &#8211; Subscribe</title>
		<link>http://blog.padmarag.com/2012/10/17/generic-architecture-for-cloud-apps-integration-integrate-multiple-apps-using-jms-publish-subscribe/</link>
		<comments>http://blog.padmarag.com/2012/10/17/generic-architecture-for-cloud-apps-integration-integrate-multiple-apps-using-jms-publish-subscribe/#comments</comments>
		<pubDate>Wed, 17 Oct 2012 07:34:32 +0000</pubDate>
		<dc:creator>Padmarag Lokhande</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.padmarag.com/?p=140</guid>
		<description><![CDATA[With the advent of cloud, the trend is to use cloud-based best of breed software for different needs. Although this provides very good and deep functionality, it also opens up a lot of issues related to data management and integrity. &#8230; <a href="http://blog.padmarag.com/2012/10/17/generic-architecture-for-cloud-apps-integration-integrate-multiple-apps-using-jms-publish-subscribe/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=140&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>With the advent of cloud, the trend is to use cloud-based best of breed software for different needs. Although this provides very good and deep functionality, it also opens up a lot of issues related to data management and integrity.</p>
<p>A very common scenario nowadays is to use SaaS application like Salesforce or SugarCRM for CRM. Then to use SaaS ERP like NetSuite or on-premise ERP. There could also be Quickbooks used for accounting. Besides these there are the HelpDesk apps.</p>
<p>All of these applications have their own internal databases, schemas and representation of your data. A change in one place needs to be reflected in other apps as well. This results in lot of difficulties on how to integrate the apps. Conventional star topology or app-to-app integration fall short.</p>
<p>This is where a Messaging Oriented Middleware (MOM) solution like ESB is very useful. I am presenting a generic architecture for multiple apps to apps integration.</p>
<p><a href="http://padmarag.files.wordpress.com/2012/10/many-to-many-integration.jpg"><img class="alignnone size-full wp-image-142" title="Many to Many integration" alt="" src="http://padmarag.files.wordpress.com/2012/10/many-to-many-integration.jpg?w=640&#038;h=278" height="278" width="640" /></a></p>
<p>Brief explanation of components in the proposed architecure -</p>
<ul>
<li>Purchase Order &#8211; This is the input document that comes to the system. We generally need to update multiple systems based on the docuemnt. The format could be cXML or any custom XML schema. It could be transformed into a standard or canonical format accepted internally.</li>
<li>ActiveMQ JMS &#8211; The document is put on Topic of any messaging application. I have assumed ActiveMQ here, but it could be any MQ system that supports publish-subscribe model.</li>
<li>Transformers &#8211; We have 3 subscribers to this Topic, however each of them accepts different formats. To compensate for this, we have a trasnfromer for each of the subscriber. e.g., the PO to CRM transformer could transform the message from CXML format to SalesForce.com Schema.</li>
<li>Subscribers &#8211; All 3 subscribers receive the message document and update their respective system with the data.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padmarag.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padmarag.wordpress.com/140/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=140&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.padmarag.com/2012/10/17/generic-architecture-for-cloud-apps-integration-integrate-multiple-apps-using-jms-publish-subscribe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7da22f95f51c877ef2490cdda3539caa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">padmarag</media:title>
		</media:content>

		<media:content url="http://padmarag.files.wordpress.com/2012/10/many-to-many-integration.jpg" medium="image">
			<media:title type="html">Many to Many integration</media:title>
		</media:content>
	</item>
		<item>
		<title>Enterprise Integration Patterns (EIP) with OpenESB Part 2 : Dynamic Router</title>
		<link>http://blog.padmarag.com/2012/06/01/enterprise-integration-patterns-eip-with-openesb-part-2-dynamic-router/</link>
		<comments>http://blog.padmarag.com/2012/06/01/enterprise-integration-patterns-eip-with-openesb-part-2-dynamic-router/#comments</comments>
		<pubDate>Fri, 01 Jun 2012 10:33:45 +0000</pubDate>
		<dc:creator>Padmarag Lokhande</dc:creator>
				<category><![CDATA[BPEL]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://blog.padmarag.com/?p=123</guid>
		<description><![CDATA[This is second of the series Enterprise Integration Patterns (EIP) with OpenESB where we will cover Enterprise Integration Patterns using OpenESB. According to Enterprise Integration Patterns, The Dynamic Router is a Router that can self-configure based on special configuration messages &#8230; <a href="http://blog.padmarag.com/2012/06/01/enterprise-integration-patterns-eip-with-openesb-part-2-dynamic-router/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=123&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This is second of the series <a href="http://blog.padmarag.com/2011/09/07/enterprise-integration-patterns-with-openesb/">Enterprise Integration Patterns (EIP) with OpenESB</a> where we will cover Enterprise Integration Patterns using OpenESB.</p>
<hr />
<p>According to <a href="http://www.enterpriseintegrationpatterns.com/">Enterprise Integration Patterns</a>, </p>
<blockquote><p>The <a href="http://www.enterpriseintegrationpatterns.com/DynamicRouter.html">Dynamic Router</a>  is a Router that can self-configure based on special configuration messages from participating destinations.</p></blockquote>
<p><img src="http://www.enterpriseintegrationpatterns.com/img/DynamicRouter.gif" alt="Dynamic Router" /></p>
<p></p>
<p>We can realize this pattern in OpenESB using <a href="http://wiki.open-esb.java.net/Wiki.jsp?page=UsingDynamicPartnerLinksAndDynamicAddressing">Dynamic Addressing</a> which uses <a href="http://www.w3.org/Submission/ws-addressing/">WS-Addressing</a> to dynamically determine the service location at runtime.</p>
<p>To check this in action we need 3 Projects -</p>
<ul>
<li>EJB Module implementing the Web Service &#8211; you can use any WSDL based web service, not necessary to use EJB.
</li>
<li>BPEL &#8211; This will contain the actual code that determines the endpoint at runtime.</li>
<li>JBI / CASA &#8211; This is a composite application necessary to deploy the BPEL.</li>
</ul>
<p><b>Step 1 -</b> We create a web service with 2 operations &#8211; addition and subtraction. Both operations take 2 numbers as input and return result.<br />
Here&#8217;s the xsd &#8211; </p>
<pre class="brush: xml; title: ; notranslate">
&lt;xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
    targetNamespace=&quot;http://xml.aurorite.com/schema/numberBase&quot;
    xmlns:tns=&quot;http://xml.aurorite.com/schema/numberBase&quot;
    elementFormDefault=&quot;qualified&quot;&gt;

    &lt;xsd:element name=&quot;NumbersAdditionRequest&quot; type=&quot;tns:AdditionType&quot;/&gt;
    &lt;xsd:element name=&quot;NumbersAdditionResponse&quot; type=&quot;tns:OperationResultType&quot;/&gt;
    &lt;xsd:element name=&quot;NumbersSubtractionRequest&quot; type=&quot;tns:SubtractionType&quot;/&gt;
    &lt;xsd:element name=&quot;NumbersSubtractionResponse&quot; type=&quot;tns:OperationResultType&quot;/&gt;

    &lt;xsd:complexType name=&quot;AdditionType&quot;&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element name=&quot;number1&quot; type=&quot;xsd:int&quot;/&gt;
            &lt;xsd:element name=&quot;number2&quot; type=&quot;xsd:int&quot;/&gt;
        &lt;/xsd:sequence&gt;
    &lt;/xsd:complexType&gt;

    &lt;xsd:complexType name=&quot;SubtractionType&quot;&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element name=&quot;number1&quot; type=&quot;xsd:int&quot;/&gt;
            &lt;xsd:element name=&quot;number2&quot; type=&quot;xsd:int&quot;/&gt;
        &lt;/xsd:sequence&gt;
    &lt;/xsd:complexType&gt;

    &lt;xsd:complexType name=&quot;OperationResultType&quot;&gt;
        &lt;xsd:sequence&gt;
            &lt;xsd:element name=&quot;result&quot; type=&quot;xsd:int&quot;/&gt;
            &lt;xsd:element name=&quot;processor&quot; type=&quot;xsd:string&quot;/&gt;
        &lt;/xsd:sequence&gt;
    &lt;/xsd:complexType&gt;
&lt;/xsd:schema&gt;
</pre>
<p>and here&#8217;s the wsdl -</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;definitions name=&quot;NumbersOperations&quot;
    targetNamespace=&quot;http://websvcs.aurorite.com/wsdl/NumberOperationSvcs/NumbersOperations&quot;
    xmlns=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
    xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
    xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; 
    xmlns:tns=&quot;http://websvcs.aurorite.com/wsdl/NumberOperationSvcs/NumbersOperations&quot;
    xmlns:ns=&quot;http://xml.aurorite.com/schema/numberBase&quot;
    xmlns:plnk=&quot;http://docs.oasis-open.org/wsbpel/2.0/plnktype&quot;
    xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;&gt;
    &lt;types&gt;
        &lt;xsd:schema targetNamespace=&quot;http://websvcs.aurorite.com/wsdl/NumberOperationSvcs/NumbersOperations&quot;&gt;
            &lt;xsd:import namespace=&quot;http://xml.aurorite.com/schema/numberBase&quot; schemaLocation=&quot;numberBase.xsd&quot;/&gt;
        &lt;/xsd:schema&gt;
    &lt;/types&gt;
    &lt;message name=&quot;additionRequest&quot;&gt;
        &lt;part name=&quot;part1&quot; element=&quot;ns:NumbersAdditionRequest&quot;/&gt;
    &lt;/message&gt;
    &lt;message name=&quot;additionResponse&quot;&gt;
        &lt;part name=&quot;part1&quot; element=&quot;ns:NumbersAdditionResponse&quot;/&gt;
    &lt;/message&gt;
    &lt;message name=&quot;subtractionRequest&quot;&gt;
        &lt;part name=&quot;part1&quot; element=&quot;ns:NumbersSubtractionRequest&quot;/&gt;
    &lt;/message&gt;
    &lt;message name=&quot;subtractionResponse&quot;&gt;
        &lt;part name=&quot;part1&quot; element=&quot;ns:NumbersSubtractionResponse&quot;/&gt;
    &lt;/message&gt;
    &lt;portType name=&quot;NumbersOperationsPortType&quot;&gt;
        &lt;operation name=&quot;addition&quot;&gt;
            &lt;input name=&quot;input1&quot; message=&quot;tns:additionRequest&quot;/&gt;
            &lt;output name=&quot;output1&quot; message=&quot;tns:additionResponse&quot;/&gt;
        &lt;/operation&gt;
        &lt;operation name=&quot;subtraction&quot;&gt;
            &lt;input name=&quot;input2&quot; message=&quot;tns:subtractionRequest&quot;/&gt;
            &lt;output name=&quot;output2&quot; message=&quot;tns:subtractionResponse&quot;/&gt;
        &lt;/operation&gt;
    &lt;/portType&gt;
    &lt;binding name=&quot;NumbersOperationsBinding&quot; type=&quot;tns:NumbersOperationsPortType&quot;&gt;
        &lt;soap:binding style=&quot;document&quot; transport=&quot;http://schemas.xmlsoap.org/soap/http&quot;/&gt;
        &lt;operation name=&quot;addition&quot;&gt;
            &lt;soap:operation/&gt;
            &lt;input name=&quot;input1&quot;&gt;
                &lt;soap:body use=&quot;literal&quot;/&gt;
            &lt;/input&gt;
            &lt;output name=&quot;output1&quot;&gt;
                &lt;soap:body use=&quot;literal&quot;/&gt;
            &lt;/output&gt;
        &lt;/operation&gt;
        &lt;operation name=&quot;subtraction&quot;&gt;
            &lt;soap:operation/&gt;
            &lt;input name=&quot;input2&quot;&gt;
                &lt;soap:body use=&quot;literal&quot;/&gt;
            &lt;/input&gt;
            &lt;output name=&quot;output2&quot;&gt;
                &lt;soap:body use=&quot;literal&quot;/&gt;
            &lt;/output&gt;
        &lt;/operation&gt;
    &lt;/binding&gt;
    &lt;service name=&quot;NumbersOperationsService&quot;&gt;
        &lt;port name=&quot;NumbersOperationsPort&quot; binding=&quot;tns:NumbersOperationsBinding&quot;&gt;
            &lt;soap:address location=&quot;http://localhost:8080/NumbersOperationsService/NumberService&quot;/&gt;
        &lt;/port&gt;
    &lt;/service&gt;
    &lt;plnk:partnerLinkType name=&quot;NumbersOperations&quot;&gt;
        &lt;!-- A partner link type is automatically generated when a new port type is added. Partner link types are used by BPEL processes. 
In a BPEL process, a partner link represents the interaction between the BPEL process and a partner service. Each partner link is associated with a partner link type.
A partner link type characterizes the conversational relationship between two services. The partner link type can have one or two roles.--&gt;
        &lt;plnk:role name=&quot;NumbersOperationsPortTypeRole&quot; portType=&quot;tns:NumbersOperationsPortType&quot;/&gt;
    &lt;/plnk:partnerLinkType&gt;
&lt;/definitions&gt;
</pre>
<p>Here is the implementation of the webservice operations -</p>
<pre class="brush: java; title: ; notranslate">
@WebService(serviceName = &quot;NumbersOperationsService&quot;, portName = &quot;NumbersOperationsPort&quot;, endpointInterface = &quot;com.aurorite.websvcs.wsdl.numberoperationsvcs.numbersoperations.NumbersOperationsPortType&quot;, targetNamespace = &quot;http://websvcs.aurorite.com/wsdl/NumberOperationSvcs/NumbersOperations&quot;, wsdlLocation = &quot;META-INF/wsdl/NumberService/NumbersOperations.wsdl&quot;)
@Stateless
public class NumberService {

    Logger logger = Logger.getLogger(&quot;soa.aurorite.com.NumberService&quot;);

    public com.aurorite.xml.schema.numberbase.OperationResultType addition(com.aurorite.xml.schema.numberbase.AdditionType part1) throws UnknownHostException {
        logger.info(&quot;Running this service at &quot; + InetAddress.getLocalHost().getHostName() + &quot; on port 8080&quot;);
        com.aurorite.xml.schema.numberbase.OperationResultType result = new com.aurorite.xml.schema.numberbase.OperationResultType();
        result.setProcessor(InetAddress.getLocalHost().getHostName());
        try {
            result.setResult(part1.getNumber1() + part1.getNumber2());
        } catch (Exception e){
            result.setResult(0);
        }

        return result;
        //throw new UnsupportedOperationException(&quot;Not implemented yet.&quot;);
    }

    public com.aurorite.xml.schema.numberbase.OperationResultType subtraction(com.aurorite.xml.schema.numberbase.SubtractionType part1) throws UnknownHostException {
        logger.info(&quot;Running this service at &quot; + InetAddress.getLocalHost().getHostName() + &quot; on port 8080&quot;);
        com.aurorite.xml.schema.numberbase.OperationResultType result = new com.aurorite.xml.schema.numberbase.OperationResultType();
        result.setProcessor(InetAddress.getLocalHost().getHostName());
        try {
            result.setResult(part1.getNumber1() - part1.getNumber2());
        } catch (Exception e){
            result.setResult(0);
        }
        return result;
        //throw new UnsupportedOperationException(&quot;Not implemented yet.&quot;);
    }

}
</pre>
<p><b>Note that I&#8217;m returning the machine name in the response. This&#8217;ll help us to determine who actually processed a particular operation.</b></p>
<p>Now to the BPEL. We&#8217;ll create a simple process looking like this -<br />
<a href="http://padmarag.files.wordpress.com/2012/06/eip_dr_1.jpg"><img src="http://padmarag.files.wordpress.com/2012/06/eip_dr_1.jpg?w=640&#038;h=578" alt="Dynamic Router BPEL" title="Dynamic Router BPEL" width="640" height="578" class="alignnone size-full wp-image-130" /></a></p>
<p>In the BPEL, we add these 2 namespace references -</p>
<pre class="brush: xml; title: ; notranslate">
xmlns:sref=&quot;http://docs.oasis-open.org/wsbpel/2.0/serviceref&quot; 
xmlns:wsa=&quot;http://schemas.xmlsoap.org/ws/2004/08/addressing&quot;
    &lt;import namespace=&quot;http://docs.oasis-open.org/wsbpel/2.0/serviceref&quot; location=&quot;ws-bpel_serviceref.xsd&quot; importType=&quot;http://www.w3.org/2001/XMLSchema&quot;/&gt;
    &lt;import namespace=&quot;http://schemas.xmlsoap.org/ws/2004/08/addressing&quot; location=&quot;addressing.xsd&quot; importType=&quot;http://www.w3.org/2001/XMLSchema&quot;/&gt;
</pre>
<p>And now the most important part &#8211; Adding the Service Endpoint Reference</p>
<pre class="brush: xml; title: ; notranslate">
&lt;assign name=&quot;assign_endpoint&quot;&gt;
    &lt;copy&gt;
                        &lt;!--&lt;from&gt;ns2:doXslTransform('urn:stylesheets:wrap2serviceref.xsl', $EPRVariable.eprValue)&lt;/from&gt;--&gt;
        &lt;from&gt;
            &lt;literal&gt;
                &lt;sref:service-ref&gt;
                    &lt;wsa:EndpointReference&gt;
                        &lt;wsa:Address&gt;http://machine2:8080/NumbersOperationsService/NumberService&lt;/wsa:Address&gt;
                        &lt;wsa:ServiceName PortName=&quot;NumbersOperationsPort&quot;
                                        xmlns:serv=&quot;http://websvcs.aurorite.com/wsdl/NumberOperationSvcs/NumbersOperations&quot;&gt;serv:NumbersOperationsService
                        &lt;/wsa:ServiceName&gt;
                    &lt;/wsa:EndpointReference&gt;
                &lt;/sref:service-ref&gt;
            &lt;/literal&gt;
        &lt;/from&gt;
        &lt;to partnerLink=&quot;NumberService&quot;/&gt;
    &lt;/copy&gt;
&lt;/assign&gt;
</pre>
<p>The portname and Service name must match to the ones in target service.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padmarag.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padmarag.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=123&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.padmarag.com/2012/06/01/enterprise-integration-patterns-eip-with-openesb-part-2-dynamic-router/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7da22f95f51c877ef2490cdda3539caa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">padmarag</media:title>
		</media:content>

		<media:content url="http://www.enterpriseintegrationpatterns.com/img/DynamicRouter.gif" medium="image">
			<media:title type="html">Dynamic Router</media:title>
		</media:content>

		<media:content url="http://padmarag.files.wordpress.com/2012/06/eip_dr_1.jpg" medium="image">
			<media:title type="html">Dynamic Router BPEL</media:title>
		</media:content>
	</item>
		<item>
		<title>Enterprise Integration Patterns (EIP) with OpenESB Part 1 : Content-Based Router</title>
		<link>http://blog.padmarag.com/2012/05/30/enterprise-integration-patterns-with-openesb-part-1-content-based-router/</link>
		<comments>http://blog.padmarag.com/2012/05/30/enterprise-integration-patterns-with-openesb-part-1-content-based-router/#comments</comments>
		<pubDate>Wed, 30 May 2012 12:04:13 +0000</pubDate>
		<dc:creator>Padmarag Lokhande</dc:creator>
				<category><![CDATA[BPEL]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://blog.padmarag.com/?p=101</guid>
		<description><![CDATA[This is first of the series Enterprise Integration Patterns with OpenESB where we will cover Enterprise Integration Patterns using OpenESB. According to Enterprise Integration Patterns, The Content-Based Router examines the message content and routes the message onto a different channel based &#8230; <a href="http://blog.padmarag.com/2012/05/30/enterprise-integration-patterns-with-openesb-part-1-content-based-router/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=101&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This is first of the series <a href="http://blog.padmarag.com/2011/09/07/enterprise-integration-patterns-with-openesb/">Enterprise Integration Patterns with OpenESB</a> where we will cover Enterprise Integration Patterns using OpenESB.</p>
<hr />
<p>According to <a href="http://www.enterpriseintegrationpatterns.com/">Enterprise Integration Patterns</a>, </p>
<blockquote><p>The <a href="http://www.enterpriseintegrationpatterns.com/ContentBasedRouter.html">Content-Based Router</a>  examines the message content and routes the message onto a different channel based on data contained in the message. The routing can be based on a number of criteria such as existence of fields, specific field values etc. When implementing a Content-Based Router, special caution should be taken to make the routing function easy to maintain as the router can become a point of frequent maintenance. In more sophisticated integration scenarios, the Content-Based Router can take on the form of a configurable rules engine that computes the destination channel based on a set of configurable rules.</p></blockquote>
<p><img src="http://www.enterpriseintegrationpatterns.com/img/ContentBasedRouter.gif" alt="Content Based Router" /></p>
<p>It can be achieved in OpenESB using &#8220;If&#8221; component.<br />
<a href="http://padmarag.files.wordpress.com/2012/05/eip_cbr_1.jpg"><img src="http://padmarag.files.wordpress.com/2012/05/eip_cbr_1.jpg?w=640&#038;h=305" alt="" title="eip_cbr_1" width="640" height="305" class="alignnone size-full wp-image-110" /></a></p>
<p><a href="http://padmarag.files.wordpress.com/2012/05/eip_cbr_2.jpg"><img src="http://padmarag.files.wordpress.com/2012/05/eip_cbr_2.jpg?w=640&#038;h=390" alt="" title="eip_cbr_2" width="640" height="390" class="alignnone size-full wp-image-111" /></a></p>
<p>In this example it simply checks for the value in &#8220;num:operation&#8221; element.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;soapenv:Envelope xsi:schemaLocation=&quot;http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:num=&quot;http://xml.aurorite.com/schema/NumberOperationSchema&quot;&gt;
  &lt;soapenv:Body&gt;
    &lt;num:OperationRequest&gt;
      &lt;num:operation&gt;ADDITION&lt;/num:operation&gt;
      &lt;num:data&gt;
        &lt;num:number1&gt;20&lt;/num:number1&gt;
        &lt;num:number2&gt;30&lt;/num:number2&gt;
      &lt;/num:data&gt;
    &lt;/num:OperationRequest&gt;
  &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;     
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padmarag.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padmarag.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=101&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.padmarag.com/2012/05/30/enterprise-integration-patterns-with-openesb-part-1-content-based-router/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7da22f95f51c877ef2490cdda3539caa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">padmarag</media:title>
		</media:content>

		<media:content url="http://www.enterpriseintegrationpatterns.com/img/ContentBasedRouter.gif" medium="image">
			<media:title type="html">Content Based Router</media:title>
		</media:content>

		<media:content url="http://padmarag.files.wordpress.com/2012/05/eip_cbr_1.jpg" medium="image">
			<media:title type="html">eip_cbr_1</media:title>
		</media:content>

		<media:content url="http://padmarag.files.wordpress.com/2012/05/eip_cbr_2.jpg" medium="image">
			<media:title type="html">eip_cbr_2</media:title>
		</media:content>
	</item>
		<item>
		<title>Can a SOA be designed with REST?</title>
		<link>http://blog.padmarag.com/2012/05/29/can-a-soa-be-designed-with-rest/</link>
		<comments>http://blog.padmarag.com/2012/05/29/can-a-soa-be-designed-with-rest/#comments</comments>
		<pubDate>Tue, 29 May 2012 11:36:58 +0000</pubDate>
		<dc:creator>Padmarag Lokhande</dc:creator>
				<category><![CDATA[BPEL]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://blog.padmarag.com/?p=94</guid>
		<description><![CDATA[Recently I answered a question on stackoverflow.com asking can a SOA be designed with REST? I&#8217;m cross-posting the answer here. &#160; At a high Level the answer is Yes, however not completely. SOA requires thinking about the system in terms &#8230; <a href="http://blog.padmarag.com/2012/05/29/can-a-soa-be-designed-with-rest/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=94&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Recently I answered a question on <a href="http://stackoverflow.com/questions/10491812/can-a-soa-be-designed-with-rest">stackoverflow.com</a> asking can a SOA be designed with REST? I&#8217;m cross-posting the answer here.</p>
<hr />
&nbsp;</p>
<p>At a high Level the answer is Yes, however not completely.</p>
<p>SOA requires thinking about the system in terms of</p>
<ul>
<li>Services (well-defined business functionality)</li>
<li>Components (discrete pieces of code and/or data structures)</li>
<li>Processes (Service orchestrations. Generally using BPEL)</li>
</ul>
<p>Being able to compose new higher level services or business processes is a basic feature of a good SOA. XML, SOAP based Web Services and related standards are good fit for realizing SOA.</p>
<p>Also SOA has a few accepted principles &#8211; <a href="http://en.wikipedia.org/wiki/Service-oriented_architecture#Principles">http://en.wikipedia.org/wiki/Service-oriented_architecture#Principles</a></p>
<ul>
<li>Standardized service contract – Services adhere to a communications agreement, as defined collectively by one or more service-description documents.</li>
<li>Service Loose Coupling – Services maintain a relationship that minimizes dependencies and only requires that they maintain an awareness of each other.</li>
<li>Service Abstraction – Beyond descriptions in the service contract, services hide logic from the outside world.</li>
<li>Service reusability – Logic is divided into services with the intention of promoting reuse.
<li>Service autonomy – Services have control over the logic they encapsulate.</li>
<li>Service granularity – A design consideration to provide optimal scope and right granular level of the business functionality in a service operation.</li>
<li>Service statelessness &#8211; Services minimize resource consumption by deferring the management of state information when necessary.</li>
<li>Service discoverability – Services are supplemented with communicative meta data by which they can be effectively discovered and interpreted.</li>
<li>Service composability – Services are effective composition participants, regardless of the size and complexity of the composition.</li>
</ul>
<p>A SOA based architecture is expected to have Service Definition. Since RESTful web services lack a definitive service definition (similar to wsdl), it is difficult for a REST based system to fulfill most of the above principles.</p>
<p>To achieve the same using REST, you&#8217;d need to have RESTful Web Services + Orchestration (possible using some lightweight ESB like MuleESB or Camel)</p>
<p>Please also see this resource &#8211; <a href="http://dret.net/netdret/docs/soa-rest-www2009/">From SOA to REST</a></p>
<hr />
Adding this part as clarification for below comment -</p>
<p>Orchestration is required to compose processes. That&#8217;s what provides the main benefit of SOA.</p>
<p>Say you have a order processing application with operations like<br />
-</p>
<ul>
<li>addItem</li>
<li>addTax</li>
<li>calculateTotal</li>
<li>placeOrder</li>
</ul>
<p>Initially you created a process (using BPEL) which uses these operations in sequence. You have clients who use this Composed Service. After a few months a new client comes who has tax exemption, then instead of writing new service, you could just create a new process skipping the addTax operation. Thus you could achieve faster realization of business functionality just by re-using existing service. In practice there are mutiple such services.</p>
<p>Thus BPEL or similar (ESB or routing) technology is essential for SOA. Without business use, a SOA is not really a SOA.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padmarag.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padmarag.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=94&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.padmarag.com/2012/05/29/can-a-soa-be-designed-with-rest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7da22f95f51c877ef2490cdda3539caa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">padmarag</media:title>
		</media:content>
	</item>
		<item>
		<title>Enterprise Integration Patterns (EIP) with OpenESB</title>
		<link>http://blog.padmarag.com/2011/09/07/enterprise-integration-patterns-with-openesb/</link>
		<comments>http://blog.padmarag.com/2011/09/07/enterprise-integration-patterns-with-openesb/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 17:17:15 +0000</pubDate>
		<dc:creator>Padmarag Lokhande</dc:creator>
				<category><![CDATA[Integration]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[enterprise integration patterns openesb soa]]></category>

		<guid isPermaLink="false">https://padmarag.wordpress.com/2011/09/07/enterprise-integration-patterns-with-openesb/</guid>
		<description><![CDATA[This is a series which’ll cover Enterprise Integration Patterns (EIP) using OpenESB. Part 1:Enterprise Integration Patterns (EIP) with OpenESB Part 1 : Content-Based Router<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=74&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This is a series which’ll cover Enterprise Integration Patterns (EIP) using OpenESB.</p>
<p><b>Part 1:</b><a href="http://blog.padmarag.com/2012/05/30/enterprise-integration-patterns-with-openesb-part-1-content-based-router/">Enterprise Integration Patterns (EIP) with OpenESB Part 1 : Content-Based Router</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padmarag.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padmarag.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=74&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.padmarag.com/2011/09/07/enterprise-integration-patterns-with-openesb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7da22f95f51c877ef2490cdda3539caa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">padmarag</media:title>
		</media:content>
	</item>
		<item>
		<title>Siebel CRM On Demand Web Services &#8211; Contact Search using SoapUI</title>
		<link>http://blog.padmarag.com/2011/04/11/siebel-crm-on-demand-web-services-contact-search-using-soapui/</link>
		<comments>http://blog.padmarag.com/2011/04/11/siebel-crm-on-demand-web-services-contact-search-using-soapui/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 09:24:53 +0000</pubDate>
		<dc:creator>Padmarag Lokhande</dc:creator>
				<category><![CDATA[Camel]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Siebel]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[siebel]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[soapui]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://blog.padmarag.com/?p=40</guid>
		<description><![CDATA[Before we begin using Siebel CRM On Demand&#8217;s web services, we require the WSDL files. The WSDL files are specific to the account and can be downloaded by logging in to Siebel COD. Create a new SoapUI project and add &#8230; <a href="http://blog.padmarag.com/2011/04/11/siebel-crm-on-demand-web-services-contact-search-using-soapui/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=40&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Before we begin using Siebel CRM On Demand&#8217;s web services, we require the WSDL files. The WSDL files are specific to the account and can be downloaded by logging in to Siebel COD.</p>
<p>Create a new SoapUI project and add the WSDL as initial WSDL. SoapUI will create a new project with placeholder requests for all operations. Let&#8217;s open ContactQueryPage operation from SoapUI.</p>
<p>The endpoint path will be something like - https://secure-ausoxxxxx.crmondemand.com/Services/Integration<br />
This path is  unique to your instance of Siebel COD.</p>
<p>Next lets remove the body of input and replace it with -</p>
<pre class="brush: xml; title: ; notranslate">
&lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;
&lt;soapenv:Header/&gt;
&lt;soapenv:Body&gt;
     &lt;con:ContactQueryPage_Input xmlns:con=&quot;urn:crmondemand/ws/ecbs/contact/&quot; xmlns:quer=&quot;urn:/crmondemand/xml/Contact/Query&quot;&gt;
        &lt;quer:ListOfContact startrownum=&quot;0&quot; pagesize=&quot;100&quot; recordcountneeded=&quot;true&quot;&gt;
            &lt;quer:Contact searchspec=&quot;[ContactFirstName] LIKE 'John'&quot;&gt;
                &lt;quer:Id/&gt;
                &lt;quer:ContactFirstName/&gt;
                &lt;quer:ContactLastName/&gt;
                &lt;quer:AccountId/&gt;
            &lt;/quer:Contact&gt;
        &lt;/quer:ListOfContact&gt;
    &lt;/con:ContactQueryPage_Input&gt;
&lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;
</pre>
<p>This results in Soap Fault response with Siebel error code SBL-ODU-01006 and message : &#8220;Internal Error: Session is not available. Aborting.&#8221;<br />
This is because we still haven&#8217;t added username/password for authentication. There is another option to first get the session and then pass that value in header of the request. However I prefer to use the Stateless version above, as it separates the responsibility of handling session.</p>
<p>Let&#8217;s make 2 changes to fix this error.<br />
1) Replace first line of the SOAP request with -</p>
<pre class="brush: xml; title: ; notranslate">
&lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:wsse=&quot;http://schemas.xmlsoap.org/ws/2002/07/secext&quot;&gt;
</pre>
<p>2) Add these lines just below the SOAP Envelope element -</p>
<pre class="brush: xml; title: ; notranslate">
&lt;soapenv:Header&gt;
   &lt;wsse:Security&gt;
      &lt;wsse:UsernameToken&gt;
         &lt;wsse:Username&gt;your_siebel_username&lt;/wsse:Username&gt;
         &lt;wsse:Password Type=&quot;wsse:PasswordText&quot;&gt;your_siebel_password&lt;/wsse:Password&gt;
      &lt;/wsse:UsernameToken&gt;
   &lt;/wsse:Security&gt;
&lt;/soapenv:Header&gt;
</pre>
<p>What we&#8217;ve done here is added <a href="http://www.oasis-open.org/committees/wss/">WS-SECURITY</a> headers to the SOAP request.<br />
Now the request should run just fine.</p>
<p>Note -<br />
1) You need to add any fields you need to the request before they can be returned by Siebel CRM. e.g., &lt;ContactFirstName/&gt;<br />
2) Its better to confirm data actually exists by logging through web-console.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padmarag.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padmarag.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=40&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.padmarag.com/2011/04/11/siebel-crm-on-demand-web-services-contact-search-using-soapui/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7da22f95f51c877ef2490cdda3539caa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">padmarag</media:title>
		</media:content>
	</item>
		<item>
		<title>Reading WSDL</title>
		<link>http://blog.padmarag.com/2011/03/11/reading-wsdl/</link>
		<comments>http://blog.padmarag.com/2011/03/11/reading-wsdl/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 12:06:37 +0000</pubDate>
		<dc:creator>Padmarag Lokhande</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false">http://padmarag.wordpress.com/?p=17</guid>
		<description><![CDATA[While SOA offers all the goodies of loose-coupling, it does require understanding of some basic concepts and formats. SOAP and WSDL are the prime candidates (or culprits, depending on your view) SOAP is just a protocol for passing information, important &#8230; <a href="http://blog.padmarag.com/2011/03/11/reading-wsdl/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=17&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>While SOA offers all the goodies of loose-coupling, it does require understanding of some basic concepts and formats.<br />
SOAP and WSDL are the prime candidates (or culprits, depending on your view)</p>
<p>SOAP is just a protocol for passing information, important is WSDL.</p>
<p>A WSDL(Web Service Description Language) file defines the contract for web service. It is just like the menu in a restaurant or a table of contents of a book. It tells about what is offered.</p>
<p>Without wasting more time, lets just get to work &#8211; understanding WSDL.</p>
<p>A WSDL file may be provided to you or it can generally be accessed by appending &#8220;?wsdl&#8221; at the end of a web service address.</p>
<p>A WSDL file is best-read bottom-up. It consists of abstract as well as concrete parts. Important parts to focus are (concrete)-</p>
<ul>
<li>wsdl:service &#8211; this is the tag which tells you about the name of the service. Consider it synonymous with class file.</li>
<li>wsdl:port or port &#8211; this tag tells about the place where you can connect to. There can be multiple ports. Each port will have an &#8220;address&#8221; element. The location attribute specifies the endpoint address of the service. Pay attention the binding attribute of the port.</li>
<li>wsdl:binding &#8211; this tag refers to the actual implementation of the service. It&#8217;ll be further up in the wsdl document. It contains the methods of the service.</li>
<li>wsdl:operation &#8211; this tag refers to the operations provided by the port. wsdl:operation will contain soap:operation or similar tag depending on the binding.</li>
<li>wsdl:input and wsdl:output &#8211; specifies the form of input/output. This is because it can be either literal or encoded.</li>
</ul>
<p>Now focus on the Type attribute of the wsdl:binding, and trace it up in the document. It leads you to portType element. portType is the abstract part of the wsdl.</p>
<ul>
<li>portType &#8211; is something like an Interface, in fact it is called as interface in wsdl 2.0. It&#8217;ll have a no. of operations.</li>
<li>operation &#8211; specifies input and output message variable types. These types are specified further up in the wsdl.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padmarag.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padmarag.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=17&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.padmarag.com/2011/03/11/reading-wsdl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7da22f95f51c877ef2490cdda3539caa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">padmarag</media:title>
		</media:content>
	</item>
		<item>
		<title>Call Oracle PL/SQL procedure with XMLType from Java using JDBC</title>
		<link>http://blog.padmarag.com/2011/03/11/call-oracle-plsql-procedure-with-xmltype-from-java-using-jdbc/</link>
		<comments>http://blog.padmarag.com/2011/03/11/call-oracle-plsql-procedure-with-xmltype-from-java-using-jdbc/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 08:44:24 +0000</pubDate>
		<dc:creator>Padmarag Lokhande</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[oracleaq]]></category>
		<category><![CDATA[plsql]]></category>
		<category><![CDATA[stored procedure]]></category>
		<category><![CDATA[xmltype]]></category>

		<guid isPermaLink="false">http://padmarag.wordpress.com/?p=8</guid>
		<description><![CDATA[Recently I needed to call a stored procedure which had Oracle&#8217;s XMLType as IN and OUT parameters. The first thing to do is add xdb.jar and xmlparserv2.jar file to your application lib. These contain the required class files for Oracle &#8230; <a href="http://blog.padmarag.com/2011/03/11/call-oracle-plsql-procedure-with-xmltype-from-java-using-jdbc/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=8&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Recently I needed to call a stored procedure which had Oracle&#8217;s XMLType as IN and OUT parameters.</p>
<p>The first thing to do is add <strong>xdb.jar</strong> and <strong>xmlparserv2.jar</strong> file to your application lib. These contain the required class files for Oracle XML API. the jars can be found under your installation of oracle client lib folders. Also don&#8217;t forget to add oracle jdbc driver files &#8211; ojdbc6 or ojdbc14.</p>
<p>The code I setup was this -</p>
<pre class="brush: java; title: ; notranslate">
XMLType reqInXml;
XMLType reqOutXML;
String atpInStr = &quot;&quot;;
OpResponse output = null;

try {
   reqInStr = jaxbMarshalRequestToString(input);
   System.out.println(&quot;Input : &quot; + reqInStr);
} catch (JAXBException ex) {
   logger.log(Level.SEVERE, null, ex);
} catch (IOException ex) {
   logger.log(Level.SEVERE, null, ex);
}

//input.getHeader().setNotes(&quot;THIS VALUE RETURNED BY FACADE : &quot; + XXDS);
try {
   Connection con = XXDS.getConnection();
   //The IN parameter for stored proc is Oracle XDB XMLType
   reqInXml = XMLType.createXML(con, reqInStr);
   OracleCallableStatement stmt = (OracleCallableStatement) con.prepareCall(&quot;call DEMO_PROC.ProcessXMLRequest(?, ?, ?, ?)&quot;);
   stmt.setObject(1, reqInXml);

   //set out parameters
   stmt.registerOutParameter (2, OracleTypes.OPAQUE,&quot;SYS.XMLTYPE&quot;);
   stmt.registerOutParameter(3, Types.INTEGER);
   stmt.registerOutParameter(4, Types.VARCHAR);

   stmt.executeQuery();
   int resultCode = stmt.getInt(3);
   String resultMsg = stmt.getString(4);
   System.out.println(&quot;result code : &quot; + resultCode);
   System.out.println(&quot;result msg : &quot; + resultMsg);
   if (resultCode == 101 || resultCode == 100){
      reqOutXML = XMLType.createXML(stmt.getOPAQUE(2));
      System.out.println(&quot;Output from ERP :&quot; + reqOutXML.getStringVal());
      output = jaxbUnmarshalFromString(reqOutXML.getStringVal());
   }
}
....
</pre>
<p>This gave me &#8220;j<strong>ava.lang.ClassCastException: com.sun.gjc.spi.jdbc40.ConnectionHolder40 cannot</strong><br />
<strong> be cast to oracle.jdbc.OracleConnection</strong>&#8221; Exception. The connection was being returned from GlassFish JDBC ConnectionPool and was instance of OracleConnectionPooldataSource.<br />
The FIX proved tricky, but in the end it was simple -<br />
Do this -</p>
<pre class="brush: java; title: ; notranslate">
OracleConnection oraCon = con.unwrap(OracleConnection.class);
//The IN parameter for stored proc is Oracle XDB XMLType
atpInXml = XMLType.createXML(oraCon, atpInStr);
</pre>
<p>Pass the cast instance of OracleConnection to the XMLType API.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padmarag.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padmarag.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=8&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.padmarag.com/2011/03/11/call-oracle-plsql-procedure-with-xmltype-from-java-using-jdbc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7da22f95f51c877ef2490cdda3539caa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">padmarag</media:title>
		</media:content>
	</item>
		<item>
		<title>Connect to GlassFishMQ / OpenMQ from ActiveMQ using Camel configuration</title>
		<link>http://blog.padmarag.com/2010/12/06/connect-to-glassfishmq-openmq-from-activemq-using-camel-configuration/</link>
		<comments>http://blog.padmarag.com/2010/12/06/connect-to-glassfishmq-openmq-from-activemq-using-camel-configuration/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 22:55:22 +0000</pubDate>
		<dc:creator>Padmarag Lokhande</dc:creator>
				<category><![CDATA[Camel]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JMS]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[activemq]]></category>
		<category><![CDATA[camel]]></category>
		<category><![CDATA[glassfishmq]]></category>
		<category><![CDATA[jms]]></category>
		<category><![CDATA[openmq]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://padmarag.wordpress.com/?p=5</guid>
		<description><![CDATA[I was working on a solution based on ActiveMQ where we required to pull messages from GlassFishMQ (based on OpenMQ) and put them on OracleAQ. Now, ActiveMQ uses Camel ESB for internal message routing, this proved useful. However try as &#8230; <a href="http://blog.padmarag.com/2010/12/06/connect-to-glassfishmq-openmq-from-activemq-using-camel-configuration/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=5&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I was working on a solution based on ActiveMQ where we required to pull messages from GlassFishMQ (based on OpenMQ) and put them on OracleAQ.</p>
<p>Now, ActiveMQ uses Camel ESB for internal message routing, this proved useful. However try as I might, I couldn&#8217;t find a simple solution to what I wanted to achieve.</p>
<p>My target was to configure ActiveMQ broker which&#8217;ll act as a message router and decouple the 2 systems. Both would be unaware of its presence. Sounds really good in theory providing loose coupling.</p>
<p>But the difficult part was finding documentation. All the documentation available was about using ActiveMQ as JMS provider in GlassFish. Not what I was looking at.</p>
<p>So finally after much difficulty, I found the solution. It is simple but difficult to find.</p>
<p>Step 1) Copy imq.jar to ActiveMQ lib directory. The jar is found in GLASSFISH_HOME/imq/lib</p>
<p>Step 2) Add below lines to your activemq configuration file -</p>
<p>This line creates a default connectionFactory using host localhost and port 7676</p>
<pre class="brush: xml; title: ; notranslate">
&lt;bean id=&quot;connectionFactoryOpenMQQueue&quot;/&gt;
</pre>
<p>&nbsp;</p>
<p>This part creates a bean with credentials</p>
<pre class="brush: xml; title: ; notranslate">
&lt;bean id=&quot;openMQQueueCredentials&quot;&gt;
&lt;property name=&quot;targetConnectionFactory&quot;&gt;
&lt;ref bean=&quot;connectionFactoryOpenMQQueue&quot;/&gt;
&lt;/property&gt;
&lt;property name=&quot;username&quot;&gt;
&lt;value&gt;admin&lt;/value&gt;
&lt;/property&gt;
&lt;property name=&quot;password&quot;&gt;
&lt;value&gt;admin&lt;/value&gt;
&lt;/property&gt;
&lt;/bean&gt;
</pre>
<p>This part created the actual scheme, namespace identifier for the connection.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;bean id=&quot;openMQQueue&quot;&gt;
&lt;property name=&quot;connectionFactory&quot; ref=&quot;openMQQueueCredentials&quot;/&gt;
&lt;/bean&gt;
</pre>
<p>Step 3) Add the routing instructions</p>
<p>This&#8217;ll consume message from GlassFishMQ and put it on ActiveMQ&#8217;s queue. You can check the messages at <a href="http://localhost:8161/admin" rel="nofollow">http://localhost:8161/admin</a></p>
<pre class="brush: xml; title: ; notranslate">
&lt;route&gt;
&lt;from uri=&quot;openMQQueue:queue:q_user_info&quot; /&gt;
&lt;to  uri=&quot;activemq:queue:amq.temp.userinfo.queue&quot;/&gt;
&lt;/route&gt;
</pre>
<p>Referred to this info on how to configure the ConnectionFactory - <a href="http://docs.sun.com/source/817-0355/adminobj.html">http://docs.sun.com/source/817-0355/adminobj.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padmarag.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padmarag.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=5&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.padmarag.com/2010/12/06/connect-to-glassfishmq-openmq-from-activemq-using-camel-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7da22f95f51c877ef2490cdda3539caa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">padmarag</media:title>
		</media:content>
	</item>
		<item>
		<title>Database Diff / Database Change Management</title>
		<link>http://blog.padmarag.com/2010/08/17/database_change_management/</link>
		<comments>http://blog.padmarag.com/2010/08/17/database_change_management/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 06:59:35 +0000</pubDate>
		<dc:creator>Padmarag Lokhande</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://padmarag.wordpress.com/?p=1</guid>
		<description><![CDATA[Recently we had a situation when two developers were working on same DB package. Delay in submission of deployment request by one dev resulted in package compilation error as a dependent Type was missing. I was looking for solution that &#8230; <a href="http://blog.padmarag.com/2010/08/17/database_change_management/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=1&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Recently we had a situation when two developers were working on same DB package. Delay in submission of deployment request by one dev resulted in package compilation error as a dependent Type was missing.<br />
I was looking for solution that may help us avoid such situations in future.</p>
<p>Using SVN is one option; other is use of Database Change Management / Database Diff<br />
Some tools for that are –</p>
<p><strong>1) Oracle Change Management Pack</strong><br />
From the docs –<br />
There are three core capabilities of Change Management that allow developers and database administrators to manage changes in database environments:<br />
• Baseline &#8211; A point in time of the definition of the database and its associated database objects.<br />
• Comparison &#8211; A complete list of differences between a baseline or a database and another baseline or a database.<br />
• Synchronization &#8211; The process of promoting changes from a database definition capture in a baseline or from a database to a target database</p>
<p>It allows us to take a baseline(snapshot) at a fixed time and then later we can see how the DB schema and objects have changed. The CMP can also generate DDL scripts, though I am not sure we would want to use it.</p>
<p>Details<br />
• <a href="http://download-east.oracle.com/docs/cd/B19306_01/em.102/b31949/change_management.htm">http://download-east.oracle.com/docs/cd/B19306_01/em.102/b31949/change_management.htm</a><br />
•<a href="http://www.oracle.com/technology/products/oem/pdf/change-management-pack-11g-datasheet.pdf">http://www.oracle.com/technology/products/oem/pdf/change-management-pack-11g-datasheet.pdf</a></p>
<p><strong>2) PL/SQL Developer Compare User Objects feature</strong><br />
This is available from Tools -&gt; Compare User Objects</p>
<p><strong>3) Oracle SQL Developer Database Diff feature </strong><br />
This is available from Tools -&gt; Database diff<br />
<a href="http://www.oracle.com/technology/products/database/sql_developer/files/what_is_sqldev.html#copy" rel="nofollow">http://www.oracle.com/technology/products/database/sql_developer/files/what_is_sqldev.html#copy</a> See “Schema Copy and Compare”</p>
<p>#1 looks to be most versatile and flexible but DBA rights may be necessary.<br />
#2 &amp; 3 can be used by any developer. I think Oracle SQL Developer is easier and provides more options.</p>
<p>Using any of the above option can help in –<br />
1) Identifying the changed objects and may also serve as a Check List before requesting deployment.</p>
<p>2) The developers concerned can take ownership of specific changed objects.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/padmarag.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/padmarag.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.padmarag.com&#038;blog=15243829&#038;post=1&#038;subd=padmarag&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.padmarag.com/2010/08/17/database_change_management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7da22f95f51c877ef2490cdda3539caa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">padmarag</media:title>
		</media:content>
	</item>
	</channel>
</rss>
