<?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/"
	>

<channel>
	<title>Oracle .. Java .. OpenSource .. SOA</title>
	<atom:link href="http://www.xenta.nl/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xenta.nl/blog</link>
	<description></description>
	<lastBuildDate>Mon, 06 Feb 2012 11:49:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Oracle Service Bus 11g Development Cookbook has been published!</title>
		<link>http://www.xenta.nl/blog/2012/01/24/oracle-service-bus-11g-development-cookbook-has-been-published/</link>
		<comments>http://www.xenta.nl/blog/2012/01/24/oracle-service-bus-11g-development-cookbook-has-been-published/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 16:28:03 +0000</pubDate>
		<dc:creator>Eric Elzinga</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[osb]]></category>

		<guid isPermaLink="false">http://www.xenta.nl/blog/?p=1604</guid>
		<description><![CDATA[Good news today from the publisher! The book of which i&#8217;m coauthor of has been published! After months of hard work it&#8217;s finally there. Oracle Service Bus 11g Development Cookbook : http://www.packtpub.com/oracle-service-bus-11g-development-cookbook/book I hope you will all like it. Thanks to the other authors (Guido, Edwin, Jan and Mischa) for all their hard work and [...]]]></description>
			<content:encoded><![CDATA[<p>Good news today from the publisher!<br />
The book of which i&#8217;m coauthor of has been published! After months of hard work it&#8217;s finally there. </p>
<p><strong>Oracle Service Bus 11g Development Cookbook</strong> : <a href="http://www.packtpub.com/oracle-service-bus-11g-development-cookbook/book" title="Oracle Service Bus 11g Development Cookbook" target="_blank">http://www.packtpub.com/oracle-service-bus-11g-development-cookbook/book</a></p>
<p>I hope you will all like it.</p>
<p>Thanks to the other authors (Guido, Edwin, Jan and Mischa) for all their hard work and for the great few months of working together to establish this great piece of work.<br />
Special thanks go out to Guido for guiding the whole process of making this book. All the hours of hard work and organizing everything, i hope it was worth it!</p>
<h3>The book</h3>
<p>Something about the book (which i nicely copy/pasted from Guido his blog)</p>
<p>The book contains more than 80 practical recipes to develop service- and message-oriented solutions on the Oracle Service Bus 11g.</p>
<p>This cookbook is full of immediately usable recipes showing how to efficiently develop on the Oracle Service Bus. In addition to its cookbook style, which ensures the solutions are presented in a clear step-by-step manner, the explanations go into great detail, which makes it good learning material for everyone who has experience with the OSB and wants to improve. Most of the recipes are designed in such a way that each recipe is presented as a separate, standalone entity and reading of prior recipes is not required. The finished solution of each recipe is also made available electronically.</p>
<p>The 80+ recipes are organized into the following chapters (the digit behind the title showing the number of recipes in that chapter):</p>
<ul>
<li>Creating a basic OSB service (13)</li>
<li>Working efficiently with OSB artifacts in Eclipse OEPE (7)</li>
<li>Messaging with JMS transport (9)</li>
<li>Using EJB and JEJB transport (5)</li>
<li>Using HTTP transport (5)</li>
<li>Using File and Mail transports (5)</li>
<li>Using JCA adapter to communicate to the database (6)</li>
<li>Using SOA Direct transport to communicate with SOA Suite (4)</li>
<li>Communication, Flow Control and Message Processing (10)</li>
<li>Reliable communication with OSB (5)</li>
<li>Handling Message-Level Security requirements (9)</li>
<li>Handling Transport-Level Security requirements (4)</li>
</ul>
<p><a href="http://www.xenta.nl/blog/wp-content/uploads/2012/01/osb_book.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2012/01/osb_book-237x300.png" alt="" title="osb_book" width="237" height="300" class="aligncenter size-medium wp-image-1608" /></a></p>
<p>Happy reading!</p>
<h3>Reviews</h3>
<p>AMIS blog : <a href="http://technology.amis.nl/blog/15276/review-of-oracle-service-bus-11g-development-cookbook-packt-publishing-by-edwin-biemond-guido-schmutz-eric-elzinga-et-al" title="Review of Oracle Service Bus 11g Development Cookbook (Packt Publishing) by Edwin Biemond, Guido Schmutz, Eric Elzinga et. al." target="_blank">Review of Oracle Service Bus 11g Development Cookbook (Packt Publishing) by Edwin Biemond, Guido Schmutz, Eric Elzinga et. al.</a><br />
<a href="http://orasoa.blogspot.com/2012/01/osb-cookbook.html" title="Oracle Service Bus Developer Cookbook" target="_blank">SOA@Oracle SCA, BPEL, BPM &#038; Service Bus blog</a></p>
<img src="http://www.xenta.nl/blog/?ak_action=api_record_view&id=1604&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.xenta.nl/blog/2012/01/24/oracle-service-bus-11g-development-cookbook-has-been-published/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Service Bus : Using custom xpath functions in xslt</title>
		<link>http://www.xenta.nl/blog/2012/01/09/oracle-service-bus-using-custom-xpath-functions-in-xslt/</link>
		<comments>http://www.xenta.nl/blog/2012/01/09/oracle-service-bus-using-custom-xpath-functions-in-xslt/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 21:39:54 +0000</pubDate>
		<dc:creator>Eric Elzinga</dc:creator>
				<category><![CDATA[osb]]></category>

		<guid isPermaLink="false">http://www.xenta.nl/blog/?p=1582</guid>
		<description><![CDATA[One of the readers of my blog post &#8216;Oracle Service Bus 11g, Using Custom Xpath Functions asked we can reuse the custom xpath functions in a xsl transformation. It&#8217;s possibel to reuse the jar and calll the custom functions from within a xsl transformation. Starting with creating the resources needed for the custom xpath function [...]]]></description>
			<content:encoded><![CDATA[<p>One of the readers of my blog post &#8216;<a href="http://www.xenta.nl/blog/2010/05/10/oracle-service-bus-11g-using-custom-xpath-functions/" title="Oracle Service Bus 11g, Using Custom Xpath Functions" target="_blank">Oracle Service Bus 11g, Using Custom Xpath Functions</a> asked we can reuse the custom xpath functions in a xsl transformation.</p>
<p>It&#8217;s possibel to reuse the jar and calll the custom functions from within a xsl transformation.</p>
<p>Starting with creating the resources needed for the custom xpath function :</p>
<ol>
<li>XML Configuration file (osb-custom.xml)</li>
<li>Property file (optional, osb-custom.properties)</li>
<li>Custom Function Class (jar package)</li>
</ol>
<p>Restart the osb service so the new jar will get loaded.</p>
<p>- Create a new osb project<br />
- Create a new xslt</p>
<pre class="brush: xml">
	&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot; xmlns:cust=&quot;xalan://nl.xenta.osb.custom.functions.OsbUtils&quot;&gt;
		&lt;xsl:variable name=&quot;param1&quot; select=&quot;string(&#039;the beginning&#039;)&quot;/&gt;
		&lt;xsl:variable name=&quot;param2&quot; select=&quot;string(&#039;the end&#039;)&quot;/&gt;
		&lt;xsl:template match=&quot;/&quot;&gt;
			&lt;xsl:variable name=&quot;my_custom_concat&quot; select=&quot;cust:customConcat($param1,$param2)&quot; /&gt;
			&lt;the_result&gt;&lt;xsl:value-of select=&quot;$my_custom_concat&quot;/&gt;&lt;/the_result&gt;
		&lt;/xsl:template&gt;
	&lt;/xsl:stylesheet&gt;
</pre>
<p>To be able to call a custom xpath function with the Xalan engine we need to add a new namespace_prefix + definition the the xsl</p>
<pre class="brush: xml">
xmlns:cust=&quot;xalan://tests.pipeline.CustomXQFunctions&quot;
</pre>
<p>- Start with <b>xalan://</b><br />
- Then the <b>java package + classname</b>, nl.xenta.osb.custom.functions.OsbUtils<br />
- In the select of the value-of we eventually use the <b>namespace-prefix + java method interface</b> to call the java method, cust:customConcat($param1,$param2)</p>
<p>Create a new proxy service and use the xsl in for example an assing activity.<br />
Deploy the service and use the testconsole to test it.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2012/01/test_console.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2012/01/test_console-300x105.png" alt="" title="test_console" width="300" height="105" class="aligncenter size-medium wp-image-1583" /></a></p>
<img src="http://www.xenta.nl/blog/?ak_action=api_record_view&id=1582&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.xenta.nl/blog/2012/01/09/oracle-service-bus-using-custom-xpath-functions-in-xslt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle SOA Suite : import in xsl from mds location</title>
		<link>http://www.xenta.nl/blog/2012/01/09/oracle-soa-suite-import-in-xsl-from-mds-location/</link>
		<comments>http://www.xenta.nl/blog/2012/01/09/oracle-soa-suite-import-in-xsl-from-mds-location/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 12:16:55 +0000</pubDate>
		<dc:creator>Eric Elzinga</dc:creator>
				<category><![CDATA[soasuite]]></category>

		<guid isPermaLink="false">http://www.xenta.nl/blog/?p=1561</guid>
		<description><![CDATA[In one of my xsl transformations i needed to import a generic xsl from the mds store. For this i created a new jdeveloper application with a soa sar deployment descriptor and jar descriptor in it. Contents of the jar : SharedMDSResources/generic.xsl When i browse the mds repository i see the SharedMDSResources folder in the [...]]]></description>
			<content:encoded><![CDATA[<p>In one of my xsl transformations i needed to import a generic xsl from the mds store.<br />
For this i created a new jdeveloper application with a soa sar deployment descriptor and jar descriptor in it.</p>
<p>Contents of the jar : </p>
<pre class="brush: xml">
	SharedMDSResources/generic.xsl
</pre>
<p>When i browse the mds repository i see the SharedMDSResources folder in the root of the tree (instead of in the apps folder).</p>
<p>For testing i deployed the jar manually in the EM.</p>
<p><a href="http://www.xenta.nl/blog/wp-content/uploads/2012/01/mds1.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2012/01/mds1-300x278.png" alt="" title="mds1" width="300" height="278" class="aligncenter size-medium wp-image-1563" /></a><br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2012/01/mds2.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2012/01/mds2-300x83.png" alt="" title="mds2" width="300" height="83" class="aligncenter size-medium wp-image-1564" /></a></p>
<p>In my xsl i use the next import :</p>
<pre class="brush: xml">
  &lt;xsl:import href=&quot;oramds:/SharedMDSResources/generic.xsl&quot;/&gt;
</pre>
<p>Resulting in the next stacktrace :</p>
<pre class="brush: xml">
The following exception occurred while attempting to execute operation copy at line 389
&lt;exception class=&quot;com.collaxa.cube.xml.xpath.XPathException&quot;&gt;
&lt;parsererror style=&quot;display: block; white-space: pre; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black&quot;&gt;
&lt;h3&gt;This page contains the following errors:&lt;/h3&gt;
&lt;div style=&quot;font-family:monospace;font-size:12px&quot;&gt;
error on line 7 at column 1: Extra content at the end of the document
&lt;/div&gt;
&lt;h3&gt;Below is a rendering of the page up to the first error.&lt;/h3&gt;
&lt;/parsererror&gt;
XPath expression failed to execute.
An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc(&#039;xsl/format_dates.xsl&#039;, $csvXml).
The XPath expression failed to execute; the reason was: XML-22000: (Fatal Error) Error while parsing XSL file (oramds:/deployed-composites/default/mycomposite_rev1.0/xsl/my_process.xsl&lt;Line 3, Column 46&gt;: XML-22002: (Fatal Error) Error while processing include XSL file (oramds:/SharedMDSResources/generic.xsl).)..
Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
&lt;stack&gt;
&lt;f&gt;com.collaxa.cube.xml.xpath.BPELXPathUtil.evaluate#262&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.ext.bpel.common.BPELWMPHelper.evalFromValue#339&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.ext.bpel.v1.wmp.BPEL1AssignWMP.__executeStatements#137&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.ext.bpel.common.wmp.BaseBPELActivityWMP.perform#158&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.CubeEngine._performActivity#2463&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.CubeEngine.performActivity#2334&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.CubeEngine.handleWorkItem#1115&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal#73&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage#220&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory#328&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.CubeEngine.endRequest#4350&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.CubeEngine.endRequest#4281&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.CubeEngine.createAndInvoke#679&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke#654&lt;/f&gt;
&lt;f&gt;com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke#293&lt;/f&gt;
&lt;f&gt;sun.reflect.GeneratedMethodAccessor944.invoke&lt;/f&gt;
&lt;f&gt;...&lt;/f&gt;
&lt;/stack&gt;
&lt;/exception&gt;
</pre>
<h3>Problem</h3>
<p>Since i deployed the jar manually from within the EM the SharedMDSResources folder will not be created in the apps-dir but in the root of the tree.<br />
The oramds imports can only import from within the apps folder structure.</p>
<h3>Solution</h3>
<p>When manually creating the jar archive make sure the contributor has the apps-directory already in the path<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2012/01/jar1.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2012/01/jar1-300x214.png" alt="" title="jar1" width="300" height="214" class="aligncenter size-medium wp-image-1562" /></a></p>
<p>Path : <strong>d:\SharedMDS\apps\SharedMDSResources\</strong></p>
<p>After the import the mds repository will contain the path &#8216;oramds:/apps/SharedMDSResources/generic.xsl&#8217;</p>
<p>Or keep the jar as it was (folder/file structure = SharedMDSResources/generic.xsl) and use the scripts from for example <a href="http://biemond.blogspot.com/2009/11/soa-suite-11g-mds-deploy-and-removal.html" title="MDS Deployment" target="_blank">Edwin</a> and setup the &#8216;mds.reposistory&#8217; correctly (ending with the apps-directory in it).</p>
<img src="http://www.xenta.nl/blog/?ak_action=api_record_view&id=1561&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.xenta.nl/blog/2012/01/09/oracle-soa-suite-import-in-xsl-from-mds-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invitation to Fusion Middleware Partner Community Forum</title>
		<link>http://www.xenta.nl/blog/2011/12/25/invitation-to-fusion-middleware-partner-community-forum/</link>
		<comments>http://www.xenta.nl/blog/2011/12/25/invitation-to-fusion-middleware-partner-community-forum/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 11:50:03 +0000</pubDate>
		<dc:creator>Eric Elzinga</dc:creator>
				<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://www.xenta.nl/blog/?p=1534</guid>
		<description><![CDATA[INVITATION TO FUSION MIDDLEWARE PARTNER COMMUNITY FORUM&#160;SOA&#160;&#38;&#160;WebCenter&#160;&#38;&#160;BPM&#160;&#38;&#160;WebLogic&#160;Partner Communities Do you want to learn about how to sell the value of Fusion Middleware by combining SOA, BPM and WebCenter Solutions? We would like to invite you to become updated and trained at our Fusion Middleware Partner Community Forum on February 7th and 8th 2011 at the [...]]]></description>
			<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;" trbidi="on">
<strong style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;"><span style="color: black; font-family: Arial, sans-serif;">INVITATION TO</span></strong></p>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; text-align: -webkit-auto;">
<b><span style="color: black; font-family: Arial, sans-serif;"><span style="font-size: x-small;"><br /></span></span></b><strong style="font-size: 13px;"><span style="color: black; font-family: Arial, sans-serif;">FUSION MIDDLEWARE PARTNER COMMUNITY FORUM&nbsp;</span></strong><b style="font-size: 13px;"><span style="color: black; font-family: Arial, sans-serif; font-size: 13.5pt;"><br /></span></b><strong style="font-size: 13px;"><span style="color: red; font-family: Arial, sans-serif;">SOA</span></strong><strong style="font-size: 13px;"><span style="color: black; font-family: Arial, sans-serif;">&nbsp;&amp;</span></strong><strong style="font-size: 13px;"><span style="color: red; font-family: Arial, sans-serif;">&nbsp;WebCenter&nbsp;</span></strong><strong style="font-size: 13px;"><span style="color: black; font-family: Arial, sans-serif;">&amp;</span></strong><strong style="font-size: 13px;"><span style="color: red; font-family: Arial, sans-serif;">&nbsp;BPM</span></strong><strong style="font-size: 13px;"><span style="color: black; font-family: Arial, sans-serif;">&nbsp;&amp;&nbsp;</span></strong><strong style="font-size: 13px;"><span style="color: red; font-family: Arial, sans-serif;">WebLogic</span></strong><strong style="font-size: 13px;"><span style="color: black; font-family: Arial, sans-serif;">&nbsp;Partner Communities</span></strong><span style="font-size: x-small;"><u></u><u></u></span></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">
<strong><span style="color: black; font-family: Arial, sans-serif;"><br /></span></strong></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;">Do you want to learn about how to sell the value of Fusion Middleware by combining SOA, BPM and WebCenter Solutions?</p>
<p>We would like to invite you to become updated and trained at our Fusion Middleware Partner Community Forum on February 7th and 8th 2011 at the NH Hotel in Malaga, Spain.</span><u></u><u></u></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;"><br /></span></div>
<table border="0" cellpadding="0" cellspacing="0" style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; width: 871px;">
<tbody>
<tr>
<td style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm; width: 348px;" width="40%">
<table border="0" cellpadding="0" style="width: 182px;">
<tbody>
<tr style="min-height: 29.25pt;">
<td style="background-attachment: initial; background-clip: initial; background-color: red; background-image: initial; background-origin: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 29.25pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;">
<div align="center" class="MsoNormal" style="text-align: center;">
<strong><span style="color: white; font-family: Arial, sans-serif;"><a href="http://www.oracle.com/go/?&amp;Src=7477511&amp;Act=4&amp;pcode=EMEAPN11110010MPP005" style="color: #1155cc;" target="_blank"><span style="color: white;">Register Now</span></a></span></strong><span style="font-size: 12pt; line-height: 18px;"><u></u><u></u></span></div>
</td>
</tr>
</tbody>
</table>
</td>
<td style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;">
<table border="0" cellpadding="0" style="width: 182px;">
<tbody>
<tr style="min-height: 29.25pt;">
<td style="background-attachment: initial; background-clip: initial; background-color: red; background-image: initial; background-origin: initial; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 29.25pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;">
<div align="center" class="MsoNormal" style="text-align: center;">
<strong><span style="color: white; font-family: Arial, sans-serif;"><a href="http://www.oracle.com/partners/secure/news/oracle-events/1400537" style="color: #1155cc;" target="_blank"><span style="color: white;">More Info</span></a></span></strong><span style="font-size: 12pt; line-height: 18px;"><u></u><u></u></span></div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm; width: 348px;" width="40%"></td>
<td style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0cm; padding-left: 0cm; padding-right: 0cm; padding-top: 0cm;"></td>
</tr>
</tbody>
</table>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;"><br /></span></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;">
<span style="font-family: Arial, sans-serif; font-size: 10pt;">The event is a wonderful opportunity to:</span><u></u><u></u></div>
<ul style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px; text-align: -webkit-auto;" type="disc">
<li class="MsoNormal" style="margin-bottom: 0px; margin-left: 15px; margin-right: 0px; margin-top: 0px;"><span style="font-family: Arial, sans-serif; font-size: 10pt;">learn how to sell the value of Fusion Middleware by combining SOA and WebCenter solutions<u></u><u></u></span></li>
<li class="MsoNormal" style="margin-bottom: 0px; margin-left: 15px; margin-right: 0px; margin-top: 0px;"><span style="font-family: Arial, sans-serif; font-size: 10pt;">meet with Oracle SOA, BPM and WebCenter Product management<u></u><u></u></span></li>
<li class="MsoNormal" style="margin-bottom: 0px; margin-left: 15px; margin-right: 0px; margin-top: 0px;"><span style="font-family: Arial, sans-serif; font-size: 10pt;">exchange knowledge and have access to competitive intelligence<u></u><u></u></span></li>
<li class="MsoNormal" style="margin-bottom: 0px; margin-left: 15px; margin-right: 0px; margin-top: 0px;"><span style="font-family: Arial, sans-serif; font-size: 10pt;">learn from successful SOA, BPM, WebCenter and ADF implementations<u></u><u></u></span></li>
<li class="MsoNormal" style="margin-bottom: 0px; margin-left: 15px; margin-right: 0px; margin-top: 0px;"><span style="font-family: Arial, sans-serif; font-size: 10pt;">learn about WebCenter Sites<u></u><u></u></span></li>
<li class="MsoNormal" style="margin-bottom: 0px; margin-left: 15px; margin-right: 0px; margin-top: 0px;"><span style="font-family: Arial, sans-serif; font-size: 10pt;">network within the Oracle SOA Partner Community and the Oracle WebCenter Partner Community</span></li>
</ul>
<div style="text-align: -webkit-auto;">
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;">
     <span style="color: black; font-family: Arial, sans-serif; font-size: 10pt;">During this highly informative event you can learn about partner success stories, participate in an array of break out sessions and exchange information with other partners.<u></u><u></u></span></div>
<div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;">
         <span style="color: black; font-family: Arial, sans-serif; font-size: 10pt;"><br /></span></div>
<div class="MsoNormal" style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;">
           <img src="http://www.xenta.nl/blog/wp-content/uploads/2011/12/partner_event_malaga-300x81.jpg" alt="" title="partner_event_malaga" width="467" height="127" class="aligncenter size-medium wp-image-1539" />
        </div>
</p></div>
</div>
<img src="http://www.xenta.nl/blog/?ak_action=api_record_view&id=1534&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.xenta.nl/blog/2011/12/25/invitation-to-fusion-middleware-partner-community-forum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Service Bus, Request Entity Too Large</title>
		<link>http://www.xenta.nl/blog/2011/12/06/oracle-service-bus-request-entity-too-large/</link>
		<comments>http://www.xenta.nl/blog/2011/12/06/oracle-service-bus-request-entity-too-large/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 15:28:18 +0000</pubDate>
		<dc:creator>Eric Elzinga</dc:creator>
				<category><![CDATA[osb]]></category>

		<guid isPermaLink="false">http://www.xenta.nl/blog/?p=1520</guid>
		<description><![CDATA[In the osb we use business services (http transport + wsdl) to call our composites on the soa suite. In a few situations the routing in the osb fail with the next error &#60;con:fault xmlns:con=&#34;http://www.bea.com/wli/sb/context&#34;&#62; &#60;con:errorCode&#62;BEA-380000&#60;/con:errorCode&#62; &#60;con:reason&#62;Request Entity Too Large&#60;/con:reason&#62; &#60;con:location&#62; &#60;con:node&#62;RouteNodeLeesDeclaratieCompleet&#60;/con:node&#62; &#60;con:path&#62;response-pipeline&#60;/con:path&#62; &#60;/con:location&#62; &#60;/con:fault&#62; Looking in the list of instances in the soa suite [...]]]></description>
			<content:encoded><![CDATA[<p>In the osb we use business services (http transport + wsdl) to call our composites on the soa suite.<br />
In a few situations the routing in the osb fail with the next error</p>
<pre class="brush: xml">
&lt;con:fault xmlns:con=&quot;http://www.bea.com/wli/sb/context&quot;&gt;
	&lt;con:errorCode&gt;BEA-380000&lt;/con:errorCode&gt;
	&lt;con:reason&gt;Request Entity Too Large&lt;/con:reason&gt;
	&lt;con:location&gt;
		&lt;con:node&gt;RouteNodeLeesDeclaratieCompleet&lt;/con:node&gt;
		&lt;con:path&gt;response-pipeline&lt;/con:path&gt;
	&lt;/con:location&gt;
&lt;/con:fault&gt;
</pre>
<p>Looking in the list of instances in the soa suite we see the instances over there just complete in a valid way but still the routing in the osb fails.</p>
<h2>Solution</h2>
<ul>
<li>Go to the configuration of the business service</li>
<li>Go to the HTTP Transport tab</li>
<li>Disable &#8220;Use Chunked Streaming Mode&#8221;</li>
</ul>
<p><a href="http://www.xenta.nl/blog/wp-content/uploads/2011/12/chunked.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/12/chunked-300x186.png" alt="" title="chunked" width="300" height="186" class="aligncenter size-medium wp-image-1527" /></a></p>
<p>See also <a href="http://blog.easyteam.fr/2011/05/11/un-probleme-pour-appeler-un-web-service-avec-osb/">this</a> blog for some extra explanation</p>
<img src="http://www.xenta.nl/blog/?ak_action=api_record_view&id=1520&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.xenta.nl/blog/2011/12/06/oracle-service-bus-request-entity-too-large/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Service Bus, Generic fault handling</title>
		<link>http://www.xenta.nl/blog/2011/10/31/oracle-service-bus-generic-fault-handling/</link>
		<comments>http://www.xenta.nl/blog/2011/10/31/oracle-service-bus-generic-fault-handling/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 15:05:33 +0000</pubDate>
		<dc:creator>Eric Elzinga</dc:creator>
				<category><![CDATA[osb]]></category>

		<guid isPermaLink="false">http://www.xenta.nl/blog/?p=1475</guid>
		<description><![CDATA[For a usecase i needed a construction which would give me the option to implemenent generic service error handling in which i could conditionally execute activities like alerts, reports, logging, etc One place which will contain all the error handling logic and which could be easily extended both in implementation of the logic for handling [...]]]></description>
			<content:encoded><![CDATA[<p>For a usecase i needed a construction which would give me the option to implemenent generic service error handling in which i could conditionally execute activities like alerts, reports, logging, etc<br />
One place which will contain all the error handling logic and which could be easily extended both in implementation of the logic for handling errors and being able to easily add new errors to be handle which the metadata for this error.</p>
<p>In case third party applications decide to trigger new type of exceptions/faults i don&#8217;t want to change the fault handling logic of all the process which do a call to this service. I want to be able to add the to be executed logic for this new specific error to some sort of error repository together with some setup-settings.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/flow.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/flow-300x95.png" alt="" title="flow" width="300" height="95" class="aligncenter size-medium wp-image-1477" /></a></p>
<p><strong>Definition of the error repository</strong><br />
In our case the error repository is nothing more then a xml metadata storage which stores settings for the errors to be handled.<br />
The definition of the metadata can be extended with other settings which can be retrieved at one central place again and logic for handling the settings will also be centrally defined.</p>
<p><strong>Definition of the error handling service</strong><br />
In our case the error handling service will be the central point in which we retrieve instance data from the process in which the occured fault.<br />
Based on this data we will retrieve metadata for the fault and decide in the message flow handling what the logic will be to execute.</p>
<h3>Error Repository</h3>
<p>Schema definition</p>
<pre class="brush: xml">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xs:schema xmlns=&quot;http://nl.xenta/services/errorRepository&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; targetNamespace=&quot;http://nl.xenta/services/errorRepository&quot;&gt;
	&lt;xs:element name=&quot;service_error_handling&quot;&gt;
		&lt;xs:complexType&gt;
			&lt;xs:sequence&gt;
				&lt;xs:element ref=&quot;error&quot; maxOccurs=&quot;unbounded&quot;/&gt;
			&lt;/xs:sequence&gt;
		&lt;/xs:complexType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;indReporting&quot;&gt;
		&lt;xs:simpleType&gt;
			&lt;xs:restriction base=&quot;xs:string&quot;&gt;
				&lt;xs:enumeration value=&quot;Y&quot;/&gt;
				&lt;xs:enumeration value=&quot;N&quot;/&gt;
			&lt;/xs:restriction&gt;
		&lt;/xs:simpleType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;description&quot;&gt;
		&lt;xs:simpleType&gt;
			&lt;xs:restriction base=&quot;xs:string&quot;/&gt;
		&lt;/xs:simpleType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;sourceSystem&quot;&gt;
		&lt;xs:simpleType&gt;
			&lt;xs:restriction base=&quot;xs:string&quot;&gt;
				&lt;xs:enumeration value=&quot;SYSTEM-X&quot;/&gt;
				&lt;xs:enumeration value=&quot;OSB&quot;/&gt;
				&lt;xs:enumeration value=&quot;NA&quot;/&gt;
			&lt;/xs:restriction&gt;
		&lt;/xs:simpleType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;indLogging&quot;&gt;
		&lt;xs:simpleType&gt;
			&lt;xs:restriction base=&quot;xs:string&quot;&gt;
				&lt;xs:enumeration value=&quot;Y&quot;/&gt;
				&lt;xs:enumeration value=&quot;N&quot;/&gt;
			&lt;/xs:restriction&gt;
		&lt;/xs:simpleType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;faultTransformer&quot;&gt;
		&lt;xs:simpleType&gt;
			&lt;xs:restriction base=&quot;xs:string&quot;/&gt;
		&lt;/xs:simpleType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;externalCode&quot;&gt;
		&lt;xs:simpleType&gt;
			&lt;xs:restriction base=&quot;xs:string&quot;&gt;
				&lt;xs:enumeration value=&quot;XXX_DEFAULT_ERROR&quot;/&gt;
				&lt;xs:enumeration value=&quot;GENERIC-1234&quot;/&gt;
				&lt;xs:enumeration value=&quot;VALIDATE-9999&quot;/&gt;
			&lt;/xs:restriction&gt;
		&lt;/xs:simpleType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;error&quot;&gt;
		&lt;xs:complexType&gt;
			&lt;xs:sequence&gt;
				&lt;xs:element ref=&quot;code&quot;/&gt;
				&lt;xs:element ref=&quot;externalCode&quot;/&gt;
				&lt;xs:element ref=&quot;description&quot;/&gt;
				&lt;xs:element ref=&quot;sourceSystem&quot;/&gt;
				&lt;xs:element ref=&quot;faultTransformer&quot;/&gt;
				&lt;xs:element ref=&quot;indAlert&quot;/&gt;
				&lt;xs:element ref=&quot;indAlertOverwriteDestionation&quot;/&gt;
				&lt;xs:element ref=&quot;alertDestination&quot;/&gt;
				&lt;xs:element ref=&quot;indLogging&quot;/&gt;
				&lt;xs:element ref=&quot;indReporting&quot;/&gt;
			&lt;/xs:sequence&gt;
		&lt;/xs:complexType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;code&quot;&gt;
		&lt;xs:simpleType&gt;
			&lt;xs:restriction base=&quot;xs:string&quot;&gt;
				&lt;xs:enumeration value=&quot;BEA-382505&quot;/&gt;
				&lt;xs:enumeration value=&quot;DEFAULT&quot;/&gt;
				&lt;xs:enumeration value=&quot;BEA-380000&quot;/&gt;
			&lt;/xs:restriction&gt;
		&lt;/xs:simpleType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;indAlertOverwriteDestionation&quot;&gt;
		&lt;xs:simpleType&gt;
			&lt;xs:restriction base=&quot;xs:string&quot;&gt;
				&lt;xs:enumeration value=&quot;Y&quot;/&gt;
				&lt;xs:enumeration value=&quot;N&quot;/&gt;
			&lt;/xs:restriction&gt;
		&lt;/xs:simpleType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;indAlert&quot;&gt;
		&lt;xs:simpleType&gt;
			&lt;xs:restriction base=&quot;xs:string&quot;&gt;
				&lt;xs:enumeration value=&quot;Y&quot;/&gt;
				&lt;xs:enumeration value=&quot;N&quot;/&gt;
			&lt;/xs:restriction&gt;
		&lt;/xs:simpleType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;alertDestination&quot;&gt;
		&lt;xs:complexType/&gt;
	&lt;/xs:element&gt;
&lt;/xs:schema&gt;
</pre>
<h3>Modeling the error handling proxy service</h3>
<p>The error handling proxy service will be the central point of executing location based on the incoming occured fault.</p>
<li>Create a new proxy service called ErrorHandler of Service Type &#8216;Any XML Service&#8217;<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1-300x159.png" alt="" title="proxy_errorhandler1" width="300" height="159" class="aligncenter size-medium wp-image-1490" /></a></p>
<p>The input we will send to this service will be in the format of </p>
<pre class="brush: xml">
&lt;errorData&gt;
	&lt;body&gt;{$body}&lt;/body&gt;
	&lt;inbound&gt;{$inbound}&lt;/inbound&gt;
	&lt;fault&gt;{$fault}&lt;/fault&gt;
&lt;/errorData&gt;
</pre>
<p>The flow will eventually look something like this<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_flow.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_flow-122x300.png" alt="" title="proxy_errorhandler1_flow" width="122" height="300" class="aligncenter size-medium wp-image-1494" /></a></p>
<p>Let&#8217;s look at the individual steps</p>
<h3>1. retrieveErrorMetadata</h3>
<p>The first step will contain 2 assigns.</p>
<p>The first assign will assign the ErrorRepository.xq to variable errorList<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_errorList.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_errorList-300x58.png" alt="" title="proxy_errorhandler1_errorList" width="300" height="58" class="aligncenter size-medium wp-image-1492" /></a></p>
<p>The content of the ErrorRepository.xq is the next</p>
<pre class="brush: xml">
xquery version &quot;1.0&quot; encoding &quot;Cp1252&quot;;
(:: pragma  type=&quot;xs:anyType&quot; ::)

declare namespace xf = &quot;http://nl.xenta/services/errorRepository&quot;;

declare function xf:service_error_handling()
    as element(*) {
		&lt;service_error_handling xmlns=&quot;http://nl.xenta/services/errorRepository&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
			&lt;error&gt;
				&lt;code&gt;BEA-382505&lt;/code&gt;
				&lt;externalCode&gt;VALIDATE-9999&lt;/externalCode&gt;
				&lt;description&gt;Validation of the XML payload failed&lt;/description&gt;
				&lt;sourceSystem&gt;OSB&lt;/sourceSystem&gt;
				&lt;faultTransformer&gt;ErrorHandling/errorRepository/GenericFault_To_SOAPFault&lt;/faultTransformer&gt;
				&lt;indAlert&gt;Y&lt;/indAlert&gt;
				&lt;indAlertOverwriteDestionation&gt;N&lt;/indAlertOverwriteDestionation&gt;
				&lt;alertDestination/&gt;
				&lt;indLogging&gt;Y&lt;/indLogging&gt;
				&lt;indReporting&gt;Y&lt;/indReporting&gt;
			&lt;/error&gt;
			&lt;error&gt;
				&lt;code&gt;BEA-380000&lt;/code&gt;
				&lt;externalCode&gt;GENERIC-1234&lt;/externalCode&gt;
				&lt;description&gt;General transport error occured&lt;/description&gt;
				&lt;sourceSystem&gt;SYSTEM-X&lt;/sourceSystem&gt;
				&lt;faultTransformer&gt;ErrorHandling/errorRepository/GenericFault_To_SOAPFault2&lt;/faultTransformer&gt;
				&lt;indAlert&gt;Y&lt;/indAlert&gt;
				&lt;indAlertOverwriteDestionation&gt;N&lt;/indAlertOverwriteDestionation&gt;
				&lt;alertDestination/&gt;
				&lt;indLogging&gt;Y&lt;/indLogging&gt;
				&lt;indReporting&gt;Y&lt;/indReporting&gt;
			&lt;/error&gt;
			&lt;error&gt;
				&lt;code&gt;DEFAULT&lt;/code&gt;
				&lt;externalCode&gt;XXX_DEFAULT_ERROR&lt;/externalCode&gt;
				&lt;description&gt;Something went wrong!&lt;/description&gt;
				&lt;sourceSystem&gt;NA&lt;/sourceSystem&gt;
				&lt;faultTransformer&gt;ErrorHandling/errorRepository/GenericFault_To_SOAPFault&lt;/faultTransformer&gt;
				&lt;indAlert&gt;Y&lt;/indAlert&gt;
				&lt;indAlertOverwriteDestionation&gt;N&lt;/indAlertOverwriteDestionation&gt;
				&lt;alertDestination/&gt;
				&lt;indLogging&gt;Y&lt;/indLogging&gt;
				&lt;indReporting&gt;Y&lt;/indReporting&gt;
			&lt;/error&gt;
		&lt;/service_error_handling&gt;
};

xf:service_error_handling()
</pre>
<p>At this point we have the list of faults together with metadata about what to execute when they occure available in the Message Flow.</p>
<p>In the second assign we retrieve only the the metadata from our occured fault, so we just retrieve 1 error-element from the list.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_errorMetaDataDetails.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_errorMetaDataDetails-300x137.png" alt="" title="proxy_errorhandler1_errorMetaDataDetails" width="300" height="137" class="aligncenter size-medium wp-image-1493" /></a></p>
<p>For this we execute the lookupError xquery which receives the errorList content and the errorCode and will return the error-element.<br />
If we can&#8217;t retrieve any metadata based on the errorCode we will return a default set of metadata (the error-element of which the code = DEFAULT).<br />
The result we will assign to the errorMetadataDetails variable.</p>
<p>Content of lookupError xquery</p>
<pre class="brush: xml">
(:: pragma bea:global-element-parameter parameter=&quot;$errorList&quot; element=&quot;err:service_error_handling&quot; location=&quot;ErrorRepository.xsd&quot; ::)
(:: pragma bea:global-element-return element=&quot;ns0:error&quot; location=&quot;ErrorRepository.xsd&quot; ::)

declare namespace err = &quot;http://nl.xenta/services/errorRepository&quot;;
declare namespace xf = &quot;http://nl.xenta/services/faults/lookupError/&quot;;

declare function xf:lookupError2($errorCode as xs:string,
    $errorList as element(err:service_error_handling))
    as element(err:error) {

		if(string-length($errorList/err:error[err:code=$errorCode]) &gt; 0)
   		then (
			let $resolvedError := $errorList/err:error[err:code=$errorCode]
	   		return $resolvedError
   		) else (
   			let $resolvedError := $errorList/err:error[err:code=&#039;DEFAULT&#039;]
   			return $resolvedError
   		)
};

declare variable $errorCode as xs:string external;
declare variable $errorList as element(err:service_error_handling) external;

xf:lookupError2($errorCode,$errorList)
</pre>
<h3>2. conditionalReporting</h3>
<p>In all the conditional stages we will now re-use the errorMetadataDetails variable to verify if we want to execute certain login.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_cond_reporting.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_cond_reporting.png" alt="" title="proxy_errorhandler1_cond_reporting" width="249" height="278" class="aligncenter size-full wp-image-1491" /></a></p>
<p>If we configurated the indReporting=Y in the error repository xquery file then the if-then loginc will evaluate to the if-tree and the Report-activty will be executed.<br />
In the same way all the other condition stages (conditionalAlert, conditionalSomethingElse) will work. We re-use the errorMetadataDetails-variable and just do a simple if-then check to see if certain logic needs to be executed.</p>
<h3>3. constructResponse</h3>
<p>The last step of the message flow is the step in which we construct the response of the errorHandler process back to the client process.<br />
In this step we will be using Dynamic Xquery to be able the construct response messages based on the incoming fault.<br />
The example of our ErrorReposity defines 2 faults and 1 default.<br />
In case for example error BEA-380000 occures, we will use the xquery located at ErrorHandling/errorRepository/GenericFault_To_SOAPFault2 to be executed. This xquery will construct our soap fault.</p>
<p>To be able to use Dynamic Xquery all the to be used xquery transformations need to have the same interface. Depending on the backend system and the returning faults from it we will use different tranformation files.<br />
But all of them will be using the input paramters &#8216;body, inbound and fault&#8217;. In the expression field we will use the faultTransformer-element from the errorMetadataDetails. So for every fault for which we want to create a<br />
different fault response we do need to define a faultTransformer-value in the errorRepository.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_response.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_response-300x197.png" alt="" title="proxy_errorhandler1_response" width="300" height="197" class="aligncenter size-medium wp-image-1495" /></a><br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_response1.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_errorhandler1_response1-300x238.png" alt="" title="proxy_errorhandler1_response1" width="300" height="238" class="aligncenter size-medium wp-image-1496" /></a></p>
<p>And that&#8217;s all what is needed to implement in the errorHandler process to receive the metadata, handle the fault and construct the response.</p>
<h3>Testcase</h3>
<p>For this testcase we created a simple EmployeeService. Create a new proxy service based on the next wsdl/xsd content.</p>
<pre class="brush: xml">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;wsdl:definitions xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; xmlns:http=&quot;http://schemas.xmlsoap.org/wsdl/http/&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soapenc=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:mime=&quot;http://schemas.xmlsoap.org/wsdl/mime/&quot; xmlns:tns=&quot;http://new.webservice.namespace&quot; xmlns:ns=&quot;http://nl.xenta/services/employee&quot; targetNamespace=&quot;http://new.webservice.namespace&quot;&gt;
	&lt;wsdl:import namespace=&quot;http://nl.xenta/services/employee&quot; location=&quot;EmployeeService.xsd&quot;/&gt;
	&lt;wsdl:message name=&quot;NewMessageRequest&quot;&gt;
		&lt;wsdl:part name=&quot;parameter&quot; element=&quot;ns:employee_request&quot;/&gt;
	&lt;/wsdl:message&gt;
	&lt;wsdl:message name=&quot;NewMessageResponse&quot;&gt;
		&lt;wsdl:part name=&quot;parameter&quot; element=&quot;ns:employee_response&quot;/&gt;
	&lt;/wsdl:message&gt;
	&lt;wsdl:portType name=&quot;EmployeeServicePort&quot;&gt;
		&lt;wsdl:operation name=&quot;getEmployee&quot;&gt;
			&lt;wsdl:input message=&quot;tns:NewMessageRequest&quot;/&gt;
			&lt;wsdl:output message=&quot;tns:NewMessageResponse&quot;/&gt;
		&lt;/wsdl:operation&gt;
	&lt;/wsdl:portType&gt;
	&lt;wsdl:binding name=&quot;EmployeeServiceBinding&quot; type=&quot;tns:EmployeeServicePort&quot;&gt;
		&lt;soap:binding style=&quot;document&quot; transport=&quot;http://schemas.xmlsoap.org/soap/http&quot;/&gt;
		&lt;wsdl:operation name=&quot;getEmployee&quot;&gt;
			&lt;soap:operation soapAction=&quot;urn:#NewOperation&quot;/&gt;
			&lt;wsdl:input&gt;
				&lt;soap:body use=&quot;literal&quot;/&gt;
			&lt;/wsdl:input&gt;
			&lt;wsdl:output&gt;
				&lt;soap:body use=&quot;literal&quot;/&gt;
			&lt;/wsdl:output&gt;
		&lt;/wsdl:operation&gt;
	&lt;/wsdl:binding&gt;
	&lt;wsdl:service name=&quot;EmployeeService&quot;&gt;
		&lt;wsdl:port name=&quot;EmployeeServiceSOAPPort&quot; binding=&quot;tns:EmployeeServiceBinding&quot;&gt;
			&lt;soap:address location=&quot;No Target Adress&quot;/&gt;
		&lt;/wsdl:port&gt;
	&lt;/wsdl:service&gt;
&lt;/wsdl:definitions&gt;
</pre>
<pre class="brush: xml">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; elementFormDefault=&quot;qualified&quot; targetNamespace=&quot;http://nl.xenta/services/employee&quot; attributeFormDefault=&quot;unqualified&quot;&gt;
	&lt;xs:element name=&quot;employee_request&quot;&gt;
		&lt;xs:annotation&gt;
			&lt;xs:documentation&gt;Comment describing your root element&lt;/xs:documentation&gt;
		&lt;/xs:annotation&gt;
		&lt;xs:complexType&gt;
			&lt;xs:sequence&gt;
				&lt;xs:element name=&quot;emp_id&quot; type=&quot;xs:int&quot;/&gt;
			&lt;/xs:sequence&gt;
		&lt;/xs:complexType&gt;
	&lt;/xs:element&gt;
	&lt;xs:element name=&quot;employee_response&quot;&gt;
		&lt;xs:complexType&gt;
			&lt;xs:sequence&gt;
				&lt;xs:element name=&quot;employee&quot;&gt;
					&lt;xs:complexType&gt;
						&lt;xs:sequence&gt;
							&lt;xs:element name=&quot;firstname&quot;/&gt;
							&lt;xs:element name=&quot;lastname&quot;/&gt;
							&lt;xs:element name=&quot;birthdate&quot; type=&quot;xs:date&quot;/&gt;
						&lt;/xs:sequence&gt;
					&lt;/xs:complexType&gt;
				&lt;/xs:element&gt;
			&lt;/xs:sequence&gt;
		&lt;/xs:complexType&gt;
	&lt;/xs:element&gt;
&lt;/xs:schema&gt;
</pre>
<p><a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1-300x128.png" alt="" title="proxy_employeeservice1" width="300" height="128" class="aligncenter size-medium wp-image-1478" /></a></p>
<p>And the message flow will eventually look like this<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_flow.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_flow-300x268.png" alt="" title="proxy_employeeservice1_flow" width="300" height="268" class="aligncenter size-medium wp-image-1484" /></a></p>
<p>The first assign will assign the body to body_temp so in case of an error situation we still have the original body content stored<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice_assign1.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice_assign1-300x244.png" alt="" title="proxy_employeeservice_assign1" width="300" height="244" class="aligncenter size-medium wp-image-1487" /></a></p>
<p>The second activity is the validation activity. This one we will be using lateron to trigger a fault which will be processed by the errorHandler process.<br />
Based on the same wsdl as the proxy service i defined a new business service. In the EmployeeService proxy we will be routing to this business service.<br />
Since we won&#8217;t be implementing any logic on this side we just update the endpoint of the business service to something useless so the route will fail on this one.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice_route.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice_route-300x211.png" alt="" title="proxy_employeeservice_route" width="300" height="211" class="aligncenter size-medium wp-image-1489" /></a><br />
This part is used to the second fault triggering moment in our process. Also this situation will fail and the occured fault will get processed by the errorHandler.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice_business_service.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice_business_service-300x154.png" alt="" title="proxy_employeeservice_business_service" width="300" height="154" class="aligncenter size-medium wp-image-1488" /></a></p>
<p>The &#8216;normal&#8217; message flow of our proxy service is now done.<br />
Let&#8217;s have a look at the service error handler.</p>
<p><a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_error_handler.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_error_handler-141x300.png" alt="" title="proxy_employeeservice1_error_handler" width="141" height="300" class="aligncenter size-medium wp-image-1479" /></a></p>
<p>The first assign will use the next xquery and assign the result to errorhandler_request</p>
<pre class="brush: xml">
xquery version &quot;1.0&quot; encoding &quot;Cp1252&quot;;
(:: pragma  parameter=&quot;$body&quot; type=&quot;xs:anyType&quot; ::)
(:: pragma  parameter=&quot;$fault&quot; type=&quot;xs:anyType&quot; ::)
(:: pragma  parameter=&quot;$inbound&quot; type=&quot;xs:anyType&quot; ::)
(:: pragma  type=&quot;xs:anyType&quot; ::)

declare namespace xf = &quot;http://tempuri.org/ErrorHandling/proxy/constructErrorHandlingInput/&quot;;

declare function xf:constructErrorHandlingInput($body as element(*),
    $fault as element(*),
    $inbound as element(*))
    as element(*) {
        &lt;errorData&gt;
			&lt;body&gt;{$body}&lt;/body&gt;
			&lt;inbound&gt;{$inbound}&lt;/inbound&gt;
			&lt;fault&gt;{$fault}&lt;/fault&gt;
		&lt;/errorData&gt;
};

declare variable $body as element(*) external;
declare variable $fault as element(*) external;
declare variable $inbound as element(*) external;

xf:constructErrorHandlingInput($body, $fault, $inbound)
</pre>
<p><a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_error_handler_assign1.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_error_handler_assign1-300x175.png" alt="" title="proxy_employeeservice1_error_handler_assign1" width="300" height="175" class="aligncenter size-medium wp-image-1480" /></a></p>
<p>In the binding we will use the body_temp variable so we have the original body content of the process.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_error_handler_assign2.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_error_handler_assign2-300x217.png" alt="" title="proxy_employeeservice1_error_handler_assign2" width="300" height="217" class="aligncenter size-medium wp-image-1481" /></a></p>
<p>The next activity is the service callout to the errorHandler process<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_error_handler_service_callout.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_error_handler_service_callout-300x168.png" alt="" title="proxy_employeeservice1_error_handler_service_callout" width="300" height="168" class="aligncenter size-medium wp-image-1483" /></a></p>
<p>The third activity is an assign which will assign the constructed body from the errorHandler process to the body variable<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_error_handler_assign3.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_error_handler_assign3-300x170.png" alt="" title="proxy_employeeservice1_error_handler_assign3" width="300" height="170" class="aligncenter size-medium wp-image-1482" /></a></p>
<p>And the last activity will be a &#8216;Reply with Failure&#8217;</p>
<h3>Testrun</h3>
<p>In the ErrorRepository we defined 2 faults, BEA-382505 and BEA-380000.<br />
For both faults we defined a different faultTransformer.</p>
<p>BEA-382505 = ErrorHandling/errorRepository/GenericFault_To_SOAPFault<br />
BEA-380000 = ErrorHandling/errorRepository/GenericFault_To_SOAPFault2</p>
<p>GenericFault_To_SOAPFault will return </p>
<pre class="brush: xml">
		&lt;soapenv:Fault&gt;
		&lt;faultcode&gt;soapenv:Server&lt;/faultcode&gt;
		(:&lt;faultstring&gt;{data($errorMetadataDetails/err:omschrijving)}&lt;/faultstring&gt;:)
		&lt;faultstring&gt;some resource path&lt;/faultstring&gt;
		&lt;faultactor&gt;{fn:concat($inbound/ctx:transport/ctx:request/tp:headers/http:Host/text(),&quot;/&quot;,$inbound/ctx:transport/ctx:uri/text())}&lt;/faultactor&gt;
		   &lt;detail&gt;
				&lt;custom_details&gt;
					&lt;payload&gt;{$body, $fault, $inbound}&lt;/payload&gt;
				&lt;/custom_details&gt;
		   &lt;/detail&gt;
		&lt;/soapenv:Fault&gt;
</pre>
<p>GenericFault_To_SOAPFault2 will return</p>
<pre class="brush: xml">
		&lt;soapenv:Fault&gt;
		&lt;faultcode&gt;soapenv:Server&lt;/faultcode&gt;
		(:&lt;faultstring&gt;{data($errorMetadataDetails/err:omschrijving)}&lt;/faultstring&gt;:)
		&lt;faultstring&gt;some resource path&lt;/faultstring&gt;
		&lt;faultactor&gt;{fn:concat($inbound/ctx:transport/ctx:request/tp:headers/http:Host/text(),&quot;/&quot;,$inbound/ctx:transport/ctx:uri/text())}&lt;/faultactor&gt;
		   &lt;detail&gt;
				&lt;custom_details2&gt;
				  &lt;payload&gt;{$body, $fault, $inbound}&lt;/payload&gt;
				&lt;/custom_details2&gt;
		   &lt;/detail&gt;
		&lt;/soapenv:Fault&gt;
</pre>
<p>Deploy the process.</p>
<p>Now test the process either by using the testconsole of some testclient.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_response1.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_response1-300x180.png" alt="" title="proxy_employeeservice1_response1" width="300" height="180" class="aligncenter size-medium wp-image-1485" /></a></p>
<p>The first testcase will have a valid input message. So the process will pass the Validation activity and will fail when routing to the business service.<br />
Since we used a non-existing host in here the process will trigger a BEA-380000 fault. As we defined in the errorRepository this errorCode will have the next set of metadata configured</p>
<pre class="brush: xml">
			&lt;error&gt;
				&lt;code&gt;BEA-380000&lt;/code&gt;
				&lt;externalCode&gt;GENERIC-1234&lt;/externalCode&gt;
				&lt;description&gt;General transport error occured&lt;/description&gt;
				&lt;sourceSystem&gt;SYSTEM-X&lt;/sourceSystem&gt;
				&lt;faultTransformer&gt;ErrorHandling/errorRepository/GenericFault_To_SOAPFault2&lt;/faultTransformer&gt;
				&lt;indAlert&gt;Y&lt;/indAlert&gt;
				&lt;indAlertOverwriteDestionation&gt;N&lt;/indAlertOverwriteDestionation&gt;
				&lt;alertDestination/&gt;
				&lt;indLogging&gt;Y&lt;/indLogging&gt;
				&lt;indReporting&gt;Y&lt;/indReporting&gt;
			&lt;/error&gt;
</pre>
<p>The generated soap fault is correct. It contains the custom_details2-element, which is generated by the GenericFault_To_SOAPFault2 transformer.<br />
Next check the sbconsole to see if there is also a report triggered for this error (indReporting=Y).<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/sbconsole_report.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/sbconsole_report-300x19.png" alt="" title="sbconsole_report" width="300" height="19" class="aligncenter size-medium wp-image-1497" /></a><br />
Next check the weblogic console to see if the alert got executed (indAlert=Y). For this one i created an alert with JMS Destionation.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/wlsconsole_alert.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/wlsconsole_alert-300x221.png" alt="" title="wlsconsole_alert" width="300" height="221" class="aligncenter size-medium wp-image-1476" /></a></p>
<p>For the second testcase we will use an invalid input message. The validation will throw an error (BEA-382505).<br />
Check the generated soap fault (custom_details-element should get generated now).<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_response2.png"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/10/proxy_employeeservice1_response2-300x181.png" alt="" title="proxy_employeeservice1_response2" width="300" height="181" class="aligncenter size-medium wp-image-1486" /></a></p>
<p>And verify the alert and report too, to see if they got handled correctly.</p>
<h3>Extensibility</h3>
<p>In our xsd definition of the errorRepository we only defined a few settings just to show how it could work.<br />
Eventually this model can be extend with every setting you need in your error handling processes. Since all the logic of reading those settings and decide what logic to execute is defined on only<br />
one place, the errorHandler proxy service itself, it&#8217;s little work to extend the current logic for handlin the errors with new functionality. Just a new if-then activities for new settings and you&#8217;re ready to go.</p>
<h3>Conclusion</h3>
<p>The functionality as defined in the blog for handling the errors and creating a single point of error processing was enough for my testcase.<br />
I needed all the logic on one place and not in every process. I needed a single place in which i could define all the errors i wanted to handle and what actions to execute when such an error occurs.<br />
Besides that i needed a way in which other persons could easily add new defined errors to the file and the process would just &#8216;handle&#8217; them without adding extra logic to processes.<br />
In case you don&#8217;t want someone else to manipulate the errorRepository file directly from within the sbconsole itself we could also just read the content of this file from some other external location by use of the doc() function, see <a href="http://www.xenta.nl/blog/2010/12/23/oracle-service-bus-using-external-domain-value-mappings-dvm/">this</a> blog.</p>
<p>I hope the solution described will help you a bit on implementation error handling in the Oracle Service Bus.<br />
As i&#8217;m always keen on learning from others, please leave comments on how to make the implementation better, or if the solution is totally useless please say so too <img src='http://www.xenta.nl/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>download</strong> : <a href="http://www.xenta.nl/resources/OracleServiceBusGenericErrorHandling.zip" title="OracleServiceBusGenericErrorHandling.zip" target="_blank">OracleServiceBusGenericErrorHandling.zip</a></p>
<img src="http://www.xenta.nl/blog/?ak_action=api_record_view&id=1475&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.xenta.nl/blog/2011/10/31/oracle-service-bus-generic-fault-handling/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Oracle Service Bus, The number of parameters for registered XQuery resource System1_To_Fault does not match that given to it at runtime</title>
		<link>http://www.xenta.nl/blog/2011/10/19/oracle-service-bus-the-number-of-parameters-for-registered-xquery-resource-system1_to_fault-does-not-match-that-given-to-it-at-runtime/</link>
		<comments>http://www.xenta.nl/blog/2011/10/19/oracle-service-bus-the-number-of-parameters-for-registered-xquery-resource-system1_to_fault-does-not-match-that-given-to-it-at-runtime/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 18:59:22 +0000</pubDate>
		<dc:creator>Eric Elzinga</dc:creator>
				<category><![CDATA[osb]]></category>

		<guid isPermaLink="false">http://www.xenta.nl/blog/?p=1460</guid>
		<description><![CDATA[To be able to make use of Dynamic Xquery the xqueries itself all need to have the same defined interface. So after defining the different xqueries and test them one by one in Eclipse all seem to work. On runtime i get the next error : The number of parameters for registered XQuery resource System1_To_Fault [...]]]></description>
			<content:encoded><![CDATA[<p>To be able to make use of Dynamic Xquery the xqueries itself all need to have the same defined interface.</p>
<p>So after defining the different xqueries and test them one by one in Eclipse all seem to work.<br />
On runtime i get the next error :</p>
<pre class="brush: xml">
The number of parameters for registered XQuery resource System1_To_Fault does not match that given to it at runtime
</pre>
<p>I was pretty sure after logging all the binded input variables they were all containing data.</p>
<p>Lesson learned : Make sure you both bind all the variables but also &#8216;use&#8217; them in the xquery itself.<br />
OSB will return this fault either when you don&#8217;t bind all the variables but also if you don&#8217;t use all of them in the xquery</p>
<p>xquery1 fragment (will work):</p>
<pre class="brush: xml">
xquery version &quot;1.0&quot; encoding &quot;Cp1252&quot;;

declare function xf:System1_To_Fault(
    $metadata1		      as xs:string,
    $metadata2		      as xs:string,
	$metadata3		      as xs:string)
    as element(soapenv:Fault) {
		&lt;soapenv:Fault&gt;
		&lt;faultcode&gt;soapenv:Server&lt;/faultcode&gt;
		&lt;faultstring&gt;some description&lt;/faultstring&gt;
		&lt;faultactor&gt;some string to the resource&lt;/faultactor&gt;
		   &lt;detail&gt;
				&lt;info1&gt;{$metadata1}&lt;/info1&gt;
				&lt;info2&gt;{$metadata2}&lt;/info3&gt;
				&lt;info3&gt;{$metadata1}&lt;/info3&gt;
		   &lt;/detail&gt;
		&lt;/soapenv:Fault&gt;
};

declare variable $metadata1 as xs:string external;
declare variable $metadata2 as xs:string external;
declare variable $metadata3 as xs:string external;

xf:System1_To_Fault($metadata1, $metadata2, $metadata3)
</pre>
<p>xquery2 fragment (will fail):</p>
<pre class="brush: xml">
		&lt;soapenv:Fault&gt;
		&lt;faultcode&gt;soapenv:Server&lt;/faultcode&gt;
		&lt;faultstring&gt;some description&lt;/faultstring&gt;
		&lt;faultactor&gt;some string to the resource&lt;/faultactor&gt;
		   &lt;detail&gt;
				&lt;info1&gt;{$metadata1}&lt;/info1&gt;
				&lt;info2&gt;{$metadata2}&lt;/info2&gt;
				&lt;info3/&gt;
		   &lt;/detail&gt;
		&lt;/soapenv:Fault&gt;
</pre>
<p>inputvariable &#8216;metadata3&#8242; isn&#8217;t used in the xquery itself, so the dynamix xquery will fail on runtime<br />
either make sure you always use all the input variables in the xquery (or do an expression on it, for example assign it to an temp variable but don&#8217;t use it for generating your target xml)<br />
something like this</p>
<pre class="brush: xml">
    	let $temp := $metadata3
    	return
   			&lt;soapenv:Fault&gt;
			&lt;faultcode&gt;soapenv:Server&lt;/faultcode&gt;
			&lt;faultstring&gt;some description&lt;/faultstring&gt;
			&lt;faultactor&gt;some string to the resource&lt;/faultactor&gt;
		   	&lt;detail&gt;
				&lt;info1&gt;{$metadata1}&lt;/info1&gt;
				&lt;info2&gt;{$metadata2}&lt;/info2&gt;
				&lt;info3/&gt;
		   	&lt;/detail&gt;
			&lt;/soapenv:Fault&gt;
</pre>
<p>I&#8217;m not sure what this assign will do (performance-wise) when you assign a big dom-tree variable, in that case you could just assign the deepest childnode to the temp variable.<br />
Eventually it&#8217;s just a dirty fix to be able to use the xqueries in combination with dynamic xquery and still be able to not use all of the incoming parameters.</p>
<img src="http://www.xenta.nl/blog/?ak_action=api_record_view&id=1460&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.xenta.nl/blog/2011/10/19/oracle-service-bus-the-number-of-parameters-for-registered-xquery-resource-system1_to_fault-does-not-match-that-given-to-it-at-runtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Service Bus, processing Java Object Messages with JMS transport</title>
		<link>http://www.xenta.nl/blog/2011/09/01/oracle-service-bus-processing-java-object-messages-with-jms-transport/</link>
		<comments>http://www.xenta.nl/blog/2011/09/01/oracle-service-bus-processing-java-object-messages-with-jms-transport/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 14:56:55 +0000</pubDate>
		<dc:creator>Eric Elzinga</dc:creator>
				<category><![CDATA[osb]]></category>

		<guid isPermaLink="false">http://www.xenta.nl/blog/?p=1411</guid>
		<description><![CDATA[A few releases back Oracle enhanced to JMS transport to be able to handle Java Objects in queues and topic. The JMS transport now has the option to either receive Java Objects in the OSB processes by retrieving them from a topic or queue, or storing the plain Java Objects. First we need to create [...]]]></description>
			<content:encoded><![CDATA[<p>A few releases back Oracle enhanced to JMS transport to be able to handle Java Objects in queues and topic. The JMS transport now has the option to either receive Java Objects in the OSB processes by retrieving them from a topic or queue, or storing the plain Java Objects.</p>
<p>First we need to create a new queue in Weblogic, in my case QueueuIn.</p>
<h3>1. Create the java entity object</h3>
<p>Create the next entity object</p>
<pre class="brush: xml">
package nl.xenta.entities;

import java.io.Serializable;

public class Employee  implements Serializable {

	private static final long serialVersionUID = -5802550970297576366L;
	public String firstname;
	public String lastname;
	public Integer age;

	public String getFirstname() {
		return firstname;
	}
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}
	public String getLastname() {
		return lastname;
	}
	public void setLastname(String lastname) {
		this.lastname = lastname;
	}
	public Integer getAge() {
		return age;
	}
	public void setAge(Integer age) {
		this.age = age;
	}
}
</pre>
<p>Build it and generate a jar file from it.</p>
<h3>2. Client to send Java Object Message</h3>
<pre class="brush: java">
package nl.xenta.utilities;

import java.util.Hashtable;

import javax.jms.Message;
import javax.jms.ObjectMessage;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.naming.Context;
import javax.naming.InitialContext;

import nl.xenta.entities.Employee;
import nl.xenta.entities.Person;
import nl.xenta.services.EmployeeService;

public class JmsHelper {

	public final static String JNDI_FACTORY = &quot;weblogic.jndi.WLInitialContextFactory&quot;;
	public final static String JMS_FACTORY = &quot;javax.jms.QueueConnectionFactory&quot;;
	public final static String QUEUE = &quot;QueueIn&quot;;

	static QueueConnectionFactory factory;
	static QueueConnection qconnection;
	static QueueSession qsession;
	static QueueReceiver qreceiver;
	static Queue queue;
	static Context ctx;
	private boolean quit = false;

	/**
	 * @param args
	 * @throws Exception
	 */
	public static void sendMessage() throws Exception {
		QueueConnection queueCon = null;
		try {
			// get the initial context, refer to your app server docs for this
			Hashtable&lt;String, String&gt; ht = new Hashtable&lt;String, String&gt;();
			ht.put(Context.INITIAL_CONTEXT_FACTORY,
					&quot;weblogic.jndi.WLInitialContextFactory&quot;);
			ht.put(Context.PROVIDER_URL, &quot;t3://localhost:7001&quot;);
			Context ctx = new InitialContext(ht);

			// get the connection factory, and open a connection
			QueueConnectionFactory qcf = (QueueConnectionFactory) ctx
					.lookup(&quot;weblogic/jms/XAConnectionFactory&quot;);
			queueCon = qcf.createQueueConnection();

			// create queue session off the connection
			QueueSession queueSession = queueCon.createQueueSession(false,
					Session.AUTO_ACKNOWLEDGE);

			// get handle on queue, create a sender and send the message
			Queue queue = (Queue) ctx.lookup(QUEUE);
			QueueSender sender = queueSession.createSender(queue);

			// create employee object
			Employee emp = new Employee();
			emp.setAge(32);
			emp.setFirstname(&quot;Eric&quot;);
			emp.setLastname(&quot;Elzinga&quot;);

			// send java object to queue
			Message msg = queueSession.createObjectMessage(emp);
			sender.send(msg);

			System.out.println(&quot;Send Java Object Message&quot;);
		} finally {
			// close the queue connection
			if (queueCon != null) {
				queueCon.close();
			}
		}
	}
}
</pre>
<p>Execute the jms java client to create Employee object and store it on the QueueIn queue.<br />
Go to the Weblogic Console to see if the message arrived in the QueueIn queue.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/jms1.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/jms1-300x69.png" alt="" title="jms1" width="300" height="69" class="aligncenter size-medium wp-image-1415" /></a><br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/jms2.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/jms2-300x66.png" alt="" title="jms2" width="300" height="66" class="aligncenter size-medium wp-image-1416" /></a></p>
<p>When we now click on the message it will give the next message</p>
<pre class="brush: xml">
	Unable to view message, reason = java.lang.ClassNotFoundException: nl.xenta.entities.Employee
</pre>
<p>Copy the builded jar from step1 (the jar with the compiled Employee class in it) to the next location </p>
<pre class="brush: xml">
	YOUR_MIDDLEWARE_HOME/user_projects/domains/osb_domain/lib
</pre>
<p>Restart Weblogic and try viewing the message in the console again.</p>
<p><a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/jms3.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/jms3-300x208.png" alt="" title="jms3" width="300" height="208" class="aligncenter size-medium wp-image-1417" /></a></p>
<p>Great, it worked. Now we can see a Employee object is stored in the queue.<br />
Let&#8217;s go on with the OSB part.</p>
<h3>3. Oracle Service Bus Proxy Service</h3>
<ol>
<li>First copy the jar created in step 2 to our OSB project.</li>
<li>Create a new Messaging Proxy Service<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy1.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy1-300x181.png" alt="" title="proxy1" width="300" height="181" class="aligncenter size-medium wp-image-1418" /></a>
</li>
<li>Select &#8216;Java&#8217; for Request Message Type<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy2.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy2-300x181.png" alt="" title="proxy2" width="300" height="181" class="aligncenter size-medium wp-image-1419" /></a>
</li>
<li>Use jms protocol and configure the endpoint (use the just created queue)<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy3.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy3-300x181.png" alt="" title="proxy3" width="300" height="181" class="aligncenter size-medium wp-image-1420" /></a><br />
Select Queue for Destination Type<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy4.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy4-300x181.png" alt="" title="proxy4" width="300" height="181" class="aligncenter size-medium wp-image-1421" /></a><br />
Configure the Client Jar and browse to the jar file generated in step 2.</p>
<p>If we skip this settings the proxyservice won&#8217;t be able to deserialize the java objects retrieved from the queue. Resulting in stacktraces like this</p>
<pre class="brush: java">
####&lt;Aug 28, 2011 10:23:56 AM CEST&gt; &lt;Error&gt; &lt;OSB Kernel&gt; &lt;multimedia&gt; &lt;AdminServer&gt; &lt;[ACTIVE] ExecuteThread: &#039;26&#039; for queue: &#039;weblogic.kernel.Default (self-tuning)&#039;&gt; &lt;&lt;anonymous&gt;&gt; &lt;BEA1-03E7A5A49D452A912D4B&gt; &lt;1bf9ba3a756c6ce8:6b05e983:1320f4d10ed:-8000-00000000000000bb&gt; &lt;1314519836078&gt; &lt;BEA-380003&gt; &lt;Exception on TransportManagerImpl.receiveMessage, com.bea.wli.sb.context.BindingLayerException: General runtime error: [JMSClientExceptions:055115]Error deserializing an object
com.bea.wli.sb.context.BindingLayerException: General runtime error: [JMSClientExceptions:055115]Error deserializing an object

Caused By: java.lang.ClassNotFoundException: nl.xenta.entities.Employee
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
</pre>
</li>
<li>
Create the Message Flow as defined in the picture and only add a log activity, which logs the body.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy5.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy5-263x300.png" alt="" title="proxy5" width="263" height="300" class="aligncenter size-medium wp-image-1412" /></a>
</li>
</ol>
<p>Deploy the process and use the JmsHelper client to create an Employee object and send it to the queue.<br />
The proxy service will poll, get it out of the queue and basically does nothing with it except logging the body.<br />
After the message is send, check the osb domain log file to see what&#8217;s in the $body variable.</p>
<pre class="brush: xml">
&lt;BEA-000000&gt; &lt; [PipelinePairNode1, PipelinePairNode1_request, stage2, REQUEST] ### debug logging $body ###: &lt;soapenv:Body xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;
  &lt;con:java-content ref=&quot;jcid:4c741db6:131dd1e4544:-7fc5&quot; xmlns:con=&quot;http://www.bea.com/wli/sb/context&quot;/&gt;
&lt;/soapenv:Body&gt;&gt;
</pre>
<p>The java object is retrieved from the queue and processed by the proxy service.<br />
But when we look in the body we don&#8217;t see any &#8216;actual&#8217; payload, only a java ref to the java object itself.</p>
<p>Let&#8217;s use a few java callouts to see how we can use the content of the java object.</p>
<h3>4. Proxyservice, java callout, java (object) in, string out</h3>
<p>Extend the java project from step1.<br />
Create a new class (EmployeeService) with the next method (convertEmployeeToString) in it</p>
<pre class="brush: java">
package nl.xenta.services;

import java.io.File;
import java.io.IOException;

import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlOptions;

import nl.xenta.crm.employee.EmployeeDocument;
import nl.xenta.crm.employee.EmployeeType;
import nl.xenta.entities.Employee;
import nl.xenta.entities.Person;

public class EmployeeService {

	public static String convertEmployeeToString(Employee employee) {
		return employee.toString();
	}
}
</pre>
<p>The input Employee object will be the data from the queue and as response we just return the string value of the object.<br />
Generate a jar archive from it and store it in your OSB project.</p>
<p>Add the java callout to your proxy service message flow and after it add the log activity.<br />
The log activity will just log the value of $my_string_response.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/javacallout1.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/javacallout1-300x290.png" alt="" title="javacallout1" width="300" height="290" class="aligncenter size-medium wp-image-1432" /></a></p>
<p>Now trigger the process again by sending a message with the JmsHelper client and check the osb log file.</p>
<pre class="brush: xml">
&lt;BEA-000000&gt; &lt; [PipelinePairNode1, PipelinePairNode1_request, stage2, REQUEST] ### JMSObject_ps, logging string response after the java callout ###: Employee [firstname=Eric, lastname=Elzinga, age=32]&gt;
</pre>
<p>Read <a href="http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/pojo.html" target="_blank">this</a> for some extra information about the java callouts and their input and return types.<br />
&#8220;The input and return types for Java callouts are not restricted. However, any return types other than primitives, Strings, or XmlObjects can only be passed (unmodified) to other Java callouts.&#8221;<br />
In this example we get a String returned, so we can just retrieve the value of it in the message flow without sending it to another java callout.</p>
<h3>5. Proxyservice, java (object) in, java (object) out</h3>
<p>For this example i made a copy of the Employee object and named it Person. We will use the same Employee object as example1 for the input and return a Person object back to OSB and log this.</p>
<pre class="brush: java">
	public static Person convertEmployeeToPerson(Employee employee) {
		Person person = new Person();

		person.setFirstname(employee.firstname);
		person.setLastname(employee.lastname);
		person.setAge(employee.age);

		return person;
	}
</pre>
<p><a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/javacallout2.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/javacallout2-300x294.png" alt="" title="javacallout2" width="300" height="294" class="aligncenter size-medium wp-image-1433" /></a></p>
<pre class="brush: xml">
&lt;BEA-000000&gt; &lt; [PipelinePairNode1, PipelinePairNode1_request, stage2, REQUEST] ### JMSObject_ps, logging person response after the java callout ###: &lt;con:java-content ref=&quot;jcid:4cd600ef:131e1eeb1b1:-7fca&quot; xmlns:con=&quot;http://www.bea.com/wli/sb/context&quot;/&gt;&gt;
</pre>
<p>And again we get a java ref back, only this time a new ref id to a new object.<br />
To be able to &#8216;use&#8217; this object we can either send it to a new java callout or publish it to another queue.</p>
<h3>6. Proxyservice, java (object) in, XmlObject out</h3>
<p>See <a href="http://www.xenta.nl/blog/2011/08/29/oracle-service-bus-java-callouts-with-xmlobjects/" target="_blank">this</a> blog on how to send the java object to a java callout and return a XmlObject back.<br />
I added the XMLBeans resources (build.xml and libs) to the same project as mentioned in step1.</p>
<p>For this testcase we used the next method. It will receive the Employee object from the queue and return the xml(object) representation of it back to the OSB.</p>
<pre class="brush: xml">
	public static XmlObject convertJavaToXml(Employee employee) throws Exception {
		EmployeeDocument empDoc = EmployeeDocument.Factory.newInstance();
		EmployeeType myEmp = empDoc.addNewEmployee();
		myEmp.setAge(32);
		myEmp.setFirstName(&quot;Eric&quot;);
		myEmp.setLastName(&quot;Elzinga&quot;);

		return myEmp;
	}
</pre>
<p>Run the ant build script again and copy the jar to our OSB project.<br />
In this jar we will find the Employee and Person entities, the generated XMLBeans artifacts and the static methods used for the java callout. I guess we could have splitted some of those in other archives, but for the simplicity of this article it&#8217;s fine like this.<br />
The jar we used in the other cases won&#8217;t be needed anymore since all we need is in this new one.</p>
<p>Don&#8217;t forget to edit the proxyservice and change the Client Jar to the new jar.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy4.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/proxy4-300x181.png" alt="" title="proxy4" width="300" height="181" class="aligncenter size-medium wp-image-1421" /></a></p>
<p>And the java callout<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/javacallout3.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/javacallout3-300x296.png" alt="" title="javacallout3" width="300" height="296" class="aligncenter size-medium wp-image-1434" /></a></p>
<pre class="brush: xml">
&lt;BEA-000000&gt; &lt; [PipelinePairNode1, PipelinePairNode1_request, stage2, REQUEST] ### JMSObject_ps, logging my_employee_xml response after the java callout ###: &lt;emp:employee xmlns:emp=&quot;http://xenta.nl/crm/employee&quot;&gt;
  &lt;emp:FirstName&gt;Eric&lt;/emp:FirstName&gt;
  &lt;emp:LastName&gt;Elzinga&lt;/emp:LastName&gt;
  &lt;emp:Age&gt;32&lt;/emp:Age&gt;
&lt;/emp:employee&gt;&gt;
</pre>
<p>With this final testcase we&#8217;re able to retrieve the java object from the queue, convert it to a xml representation and send it back to the proxy service.<br />
In the message flow we&#8217;re now able to retrieve data from it by use of some xpath expression.</p>
<img src="http://www.xenta.nl/blog/?ak_action=api_record_view&id=1411&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.xenta.nl/blog/2011/09/01/oracle-service-bus-processing-java-object-messages-with-jms-transport/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Service Bus, java callouts with XmlObjects</title>
		<link>http://www.xenta.nl/blog/2011/08/29/oracle-service-bus-java-callouts-with-xmlobjects/</link>
		<comments>http://www.xenta.nl/blog/2011/08/29/oracle-service-bus-java-callouts-with-xmlobjects/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 09:03:03 +0000</pubDate>
		<dc:creator>Eric Elzinga</dc:creator>
				<category><![CDATA[osb]]></category>

		<guid isPermaLink="false">http://www.xenta.nl/blog/?p=1372</guid>
		<description><![CDATA[In the Oracle Service Bus we can make use of java callouts to invoke plain java. Basically there aren&#8217;t any restrictions on the the input and output parameters of the static methods. There are 2 situations which will differ in the way we get the data returned back from the java callout, see this Return [...]]]></description>
			<content:encoded><![CDATA[<p>In the Oracle Service Bus we can make use of java callouts to invoke plain java.<br />
Basically there aren&#8217;t any restrictions on the the input and output parameters of the static methods.</p>
<p>There are 2 situations which will differ in the way we get the data returned back from the java callout, see <a href="http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/pojo.html">this </a></p>
<p><strong>Return primitives, Strings or XmlObjects from the java callout.</strong><br />
In this case we can just retrieve the data from the $body variable and execute xpath expressions on it to immediately get the value of the payload.</p>
<p><strong>Return anything else</strong><br />
In this case we will get back a java ref identifier back from the java callout.<br />
Executing xpath expressions on the $body will only give use a reference to the java object</p>
<pre class="brush: xml">
&lt;BEA-000000&gt; &lt; [PipelinePairNode1, PipelinePairNode1_request, stage2, REQUEST] ### debug logging $body ###: &lt;soapenv:Body xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;
  &lt;con:java-content ref=&quot;jcid:4c741db6:131dd1e4544:-7fc5&quot; xmlns:con=&quot;http://www.bea.com/wli/sb/context&quot;/&gt;
&lt;/soapenv:Body&gt;&gt;
</pre>
<p>To be able to use the data in the java object we can only pass it to other java callouts.</p>
<p>In this blog i will show an example of how to generate a XmlObject, mentioned as one of the return types in case 1.<br />
If we&#8217;re able to generate this kind of object from the java callout, OSB will just be able to retrieve this in the $body variable and let us execute xpath expression on it.</p>
<h3>1. Create a Java project in Eclipse</h3>
<p>We will be using XML Beans to generate the java artifacts based on a Employee schema definition.<br />
These artificats we will be using in our static method to generate the Employee java objects which represents our Employee entity definition from the xsd schema.<br />
Read <a href="http://anipossible3.blogspot.com/2009/02/xmlbeans-in-eclipse.html">this</a> and <a href="http://xmlbeans.apache.org/documentation/tutorial_getstarted.html">this</a> to get a quickstart on XML Beans.</p>
<ol>
<li>
In Eclipse we will create a new java project with a dependency on the Apache XML Beans library.<br />
I copied the ORACLE_MIDDLEWARE_HOME\modules\com.bea.core.xml.xmlbeans_2.1.0.0_2-5-1.jar to my lib folder in the project.<br />
Add the same file as build dependency (libraries) in the project properties.</p>
<li>
Create a schemas folder in the root and add the Employee.xsd to it</p>
<pre class="brush: xml">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:emp=&quot;http://xenta.nl/crm/employee&quot; targetNamespace=&quot;http://xenta.nl/crm/employee&quot; elementFormDefault=&quot;qualified&quot; attributeFormDefault=&quot;unqualified&quot;&gt;
	&lt;xs:element name=&quot;employee&quot; type=&quot;emp:EmployeeType&quot;&gt;
		&lt;xs:annotation&gt;
			&lt;xs:documentation&gt;Employee entity&lt;/xs:documentation&gt;
		&lt;/xs:annotation&gt;
	&lt;/xs:element&gt;
	&lt;xs:complexType name=&quot;EmployeeType&quot;&gt;
		&lt;xs:sequence&gt;
			&lt;xs:element name=&quot;FirstName&quot; type=&quot;xs:string&quot;/&gt;
			&lt;xs:element name=&quot;LastName&quot; type=&quot;xs:string&quot;/&gt;
			&lt;xs:element name=&quot;Age&quot; type=&quot;xs:int&quot;/&gt;
		&lt;/xs:sequence&gt;
	&lt;/xs:complexType&gt;
&lt;/xs:schema&gt;
</pre>
</li>
<li>
Create a build.xml in the root of the project. I used the one mentioned in the quickstart articles and edited it a bit.</p>
<pre class="brush: xml">
	&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
	&lt;project name=&quot;XMLBeansDemo&quot; default=&quot;build&quot;&gt;
		&lt;property environment=&quot;env&quot;/&gt;

		&lt;path id=&quot;Any.path&quot;&gt;
			&lt;path refid=&quot;xmlbeans.path&quot;/&gt;
			&lt;fileset dir=&quot;build/lib&quot; includes=&quot;*.jar&quot;/&gt;
			&lt;pathelement path=&quot;build/classes&quot;/&gt;
		&lt;/path&gt;

		&lt;target name=&quot;init&quot;&gt;
			&lt;property name=&quot;xmlbeans.home&quot; value=&quot;e:\osb_workspace\EmployeeXmlBeans\&quot;/&gt;    	

			&lt;echo message=&quot;xmlbeans.home: ${xmlbeans.home}&quot;/&gt;

			&lt;!-- check for xbean.jar from binary distribution --&gt;

			&lt;available
				property=&quot;xmlbeans.lib&quot;
				value=&quot;${xmlbeans.home}/lib&quot;
				file=&quot;${xmlbeans.home}/lib/com.bea.core.xml.xmlbeans_2.1.0.0_2-5-1.jar&quot; /&gt;

			&lt;fail message=&quot;Set XMLBEANS_HOME in your environment.&quot;
				unless=&quot;xmlbeans.lib&quot;/&gt;

			&lt;echo message=&quot;xmlbeans.lib: ${xmlbeans.lib}&quot;/&gt;

			&lt;path id=&quot;xmlbeans.path&quot;&gt;
				&lt;fileset dir=&quot;${xmlbeans.lib}&quot; includes=&quot;*.jar&quot;/&gt;
			&lt;/path&gt;

			&lt;taskdef name=&quot;xmlbean&quot;
				classname=&quot;org.apache.xmlbeans.impl.tool.XMLBean&quot;
				classpathref=&quot;xmlbeans.path&quot;/&gt;
		&lt;/target&gt;

		&lt;!-- ========================== clean ==== --&gt;

		&lt;target name=&quot;clean&quot;&gt;
			&lt;delete dir=&quot;build&quot;/&gt;
		&lt;/target&gt;

		&lt;!-- ========================== build ==== --&gt;

		&lt;target name=&quot;build&quot; depends=&quot;init,schemas.jar,Any.classes&quot;&gt;
		&lt;/target&gt;

		&lt;target name=&quot;schemas.check&quot;&gt;
			&lt;uptodate property=&quot;schemas.notRequired&quot;
				targetfile=&quot;build/lib/EmployeeXmlBeans.jar&quot;&gt;
				&lt;srcfiles dir=&quot;schemas&quot; includes=&quot;**/*.xsd&quot;/&gt;
			&lt;/uptodate&gt;
		&lt;/target&gt;

		&lt;target name=&quot;schemas.jar&quot; depends=&quot;init,schemas.check&quot;
			unless=&quot;schemas.notRequired&quot;&gt;
			&lt;mkdir dir=&quot;build/lib&quot;/&gt;
			&lt;xmlbean schema=&quot;schemas&quot;
				destfile=&quot;build/lib/EmployeeXmlBeans.jar&quot;
				srcgendir=&quot;src&quot;
				classpathref=&quot;xmlbeans.path&quot;
				source=&quot;1.5&quot;
				javasource=&quot;1.5&quot;
				debug=&quot;on&quot;
				/&gt;
		&lt;/target&gt;

		&lt;target name=&quot;Any.classes&quot; depends=&quot;init&quot;&gt;
			&lt;mkdir dir=&quot;build/classes&quot;/&gt;

			&lt;javac srcdir=&quot;src&quot;
				destdir=&quot;build/classes&quot;
				classpathref=&quot;Any.path&quot;
				debug=&quot;on&quot;
				source=&quot;1.5&quot;
				/&gt;
		&lt;/target&gt;

		&lt;!-- ========================== run ==== --&gt;

		&lt;target name=&quot;run&quot; depends=&quot;init,build&quot;&gt;
			&lt;echo message=&quot;============================== running Any&quot;/&gt;
			&lt;java
				classname=&quot;org.apache.xmlbeans.samples.anytype.Any&quot;
				classpathref=&quot;Any.path&quot;
				fork=&quot;true&quot;&gt;
				&lt;arg line=&quot;xml/any.xml&quot;/&gt;
			&lt;/java&gt;
		&lt;/target&gt;

		&lt;!-- ========================== test ==== --&gt;

		&lt;target name=&quot;test&quot; depends=&quot;init,build&quot;&gt;
			&lt;echo message=&quot;============================== testing Any&quot;/&gt;
			&lt;java
				classname=&quot;org.apache.xmlbeans.samples.anytype.AnyTest&quot;
				classpathref=&quot;Any.path&quot;
				fork=&quot;true&quot;&gt;
				&lt;arg line=&quot;xml/any.xml&quot;/&gt;
			&lt;/java&gt;
		&lt;/target&gt;

	&lt;/project&gt;
</pre>
<p>Run the ant build script. Based on the xml namespace of the Employee xsd object it will generate the same package structure for the java objects.<br />
Verify if it generated the next list of objects</p>
<ul>
<li>nl.xenta.crm.employee.EmployeeDocument</li>
<li>nl.xenta.crm.employee.EmployeeType</li>
<li>nl.xenta.crm.employee.impl.EmployeeDocumentImpl</li>
<li>nl.xenta.crm.employee.impl.EmployeeDocumentImpl</li>
</ul>
<p>And if it also generated the file EmployeeXmlBeans.jar in the lib folder.</p>
<li>
Next we need to create a static method which will make use of the generated classes.<br />
Create the next class in the same project</p>
<pre class="brush: xml">
package nl.xenta.services;

import org.apache.xmlbeans.XmlObject;

import nl.xenta.crm.employee.EmployeeDocument;
import nl.xenta.crm.employee.EmployeeType;
import nl.xenta.entities.Employee;
import nl.xenta.entities.Person;

public class EmployeeService {

	/**
	 * Retrieve an employee record based on an employee id and return a XmlObject
	 *
	 * @param empId
	 *
	 * @return Employee XmlObject
	 */
	public static XmlObject retrieveEmployee(String empId) {
		EmployeeDocument empDoc = EmployeeDocument.Factory.newInstance();
		EmployeeType myEmp = empDoc.addNewEmployee();
		myEmp.setAge(32);
		myEmp.setFirstName(&quot;Eric&quot;);
		myEmp.setLastName(&quot;Elzinga&quot;);

		return myEmp;
	}
}
</pre>
</li>
<li>
Run the ant build again and this time copy the EmployeeXmlBeans.jar file to your OSB project and refresh the project in Eclipse.
</li>
<li>
Add the java callout to your proxy service message flow and see the response<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/08/xmlobject_proxy.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/08/xmlobject_proxy-293x300.png" alt="" title="xmlobject_proxy" width="293" height="300" class="aligncenter size-medium wp-image-1387" /></a>
</li>
<li>
Test the proxyservice and see the response in the logging.</p>
<pre class="brush: xml">
&lt;BEA-000000&gt; &lt; [PipelinePairNode1, PipelinePairNode1_request, RetrieveEmployee, REQUEST] ### debug, logging my_employee_xml_object ###: &lt;emp:employee xmlns:emp=&quot;http://xenta.nl/crm/employee&quot;&gt;
  &lt;emp:FirstName&gt;Eric&lt;/emp:FirstName&gt;
  &lt;emp:LastName&gt;Elzinga&lt;/emp:LastName&gt;
  &lt;emp:Age&gt;32&lt;/emp:Age&gt;
&lt;/emp:employee&gt;&gt;
</pre>
</li>
<ol>
<p>Now we&#8217;re able to retrieve data from the variable just by using the xpath expressions and re-use it in the rest of the message flow.</p>
<img src="http://www.xenta.nl/blog/?ak_action=api_record_view&id=1372&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.xenta.nl/blog/2011/08/29/oracle-service-bus-java-callouts-with-xmlobjects/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Oracle Service Bus, Implementing Aggregator pattern by use of Split-Join</title>
		<link>http://www.xenta.nl/blog/2011/07/03/oracle-service-bus-implementing-aggregator-pattern-by-use-of-split-join/</link>
		<comments>http://www.xenta.nl/blog/2011/07/03/oracle-service-bus-implementing-aggregator-pattern-by-use-of-split-join/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 07:26:45 +0000</pubDate>
		<dc:creator>Eric Elzinga</dc:creator>
				<category><![CDATA[osb]]></category>

		<guid isPermaLink="false">http://www.xenta.nl/blog/?p=1333</guid>
		<description><![CDATA[One of the patterns mentioned on the eai patterns site is the so called Aggregator pattern. &#8220;Use a stateful filter, an Aggregator, to collect and store individual messages until a complete set of related messages has been received. Then, the Aggregator publishes a single message distilled from the individual messages&#8221; We will be using this [...]]]></description>
			<content:encoded><![CDATA[<p>One of the patterns mentioned on the eai patterns site is the so called <strong><a href="http://eaipatterns.com/Aggregator.html" target="_blank">Aggregator</a></strong> pattern.<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/Aggregator.gif" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/Aggregator-300x89.gif" alt="" title="Aggregator" width="300" height="89" class="aligncenter size-medium wp-image-1336" /></a></p>
<p><em>&#8220;Use a stateful filter, an Aggregator, to collect and store individual messages until a complete set of related messages has been received. Then, the Aggregator publishes a single message distilled from the individual messages&#8221;</em></p>
<p>We will be using this pattern in our next use case.</p>
<h2>Use case</h2>
<p>On the Oracle Service Bus we will implement the EmployeeService with an operation called &#8216;getEmployee&#8217;.<br />
When we call this operation and supply an input parameters of the EmployeeNumber, we want to receive the next set of information</p>
<ul>
<li>EmployeeDetails</li>
<li>AddressDetails</li>
<li>ContactDetails</li>
</ul>
<p>In a real life scenario we could have the next situation<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/processflow.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/processflow-300x122.png" alt="" title="processflow" width="300" height="122" class="aligncenter size-medium wp-image-1335" /></a></p>
<p>On the Oracle Service Bus we want to supply our clients 1 interface to be able to retrieve Employee information. The interface definition will define Employee details, addresses and contact details.</p>
<p>The process will receive the Employee Number, and by use of parallel invocation it will :</p>
<ul>
<li>send a request to system1 which will supply us the Employee details</li>
<li>send a request to system2 which will suppy us the Employee addresses</li>
<li>send a request to system3 which will supply us the Employee contact details</li>
</ul>
<p>Every system invocation will be a synchronous call and will get a response back from every one of them.<br />
After having received the last of the 3 responses the parallel invocation is done. In the process flow we now need to aggregate the responses and transform these into one response which will get routed back to the client caller.</p>
<p>The client caller will not know what backend systems will get invoked to retrieve data. It will only receive one message response according to our defined interface on the service bus.</p>
<p>Enough talk, let’s see what we need in the Oracle Service Bus to implement this.</p>
<h2>Backend systems</h2>
<p>In a real world situation we could have 3 different backend systems which will all supply diffent parts of the Employee data object. For our case we will use just 1 webservice with different operations which will get invoked as different services.<br />
Create a new Webservice project in Eclipse and add a new webservice to see.</p>
<pre class="brush: java">
package nl.xenta.services;

import nl.xenta.entities.Address;
import nl.xenta.entities.ContactDetail;
import nl.xenta.entities.Employee;

public interface EmployeeService {

	public Employee getEmployeeDetails(String employeeNumber);

	public Address getEmployeeAddress(String employeeNumber);

	public ContactDetail getContactDetail(String employeeNumber);

}
</pre>
<pre class="brush: java">
package nl.xenta.services;

import javax.jws.*;

import nl.xenta.entities.Address;
import nl.xenta.entities.Employee;
import nl.xenta.entities.ContactDetail;

@WebService
public class EmployeeServiceImpl implements EmployeeService {

	/* (non-Javadoc)
	 * @see nl.xenta.services.EmployeeService#getEmployeeDetails(java.lang.String)
	 */
	@WebMethod
	public Employee getEmployeeDetails(@WebParam(name=&quot;employeeNumber&quot;) String employeeNumber) {
		Employee emp = new Employee();
		emp.setFirstname(&quot;Eric&quot;);
		emp.setLastname(&quot;Elzinga&quot;);
		emp.setId(100);

		return emp;
	}

	/* (non-Javadoc)
	 * @see nl.xenta.services.EmployeeService#getEmployeeAddress(java.lang.String)
	 */
	@WebMethod
	public Address getEmployeeAddress(@WebParam(name=&quot;employeeNumber&quot;) String employeeNumber) {
		Address address = new Address();
		address.setCity(&quot;Utrecht&quot;);
		address.setCountry(&quot;The Netherlands&quot;);
		address.setPostalCode(&quot;1413JK&quot;);

		return address;
	}

	/* (non-Javadoc)
	 * @see nl.xenta.services.EmployeeService#getContactDetail(java.lang.String)
	 */
	@WebMethod
	public ContactDetail getContactDetail(@WebParam(name=&quot;employeeNumber&quot;) String employeeNumber) {
		ContactDetail contact = new ContactDetail();
		contact.setType(&quot;mobile&quot;);
		contact.setValue(&quot;+31(6)24562772&quot;);		

		return contact;
	}
}
</pre>
<pre class="brush: java">
package nl.xenta.entities;

public class Address {

	private String street;
	private String postalCode;
	private String city;
	private String country;

	public String getStreet() {
		return street;
	}
	public void setStreet(String street) {
		this.street = street;
	}
	public String getPostalCode() {
		return postalCode;
	}
	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
}
</pre>
<pre class="brush: java">
package nl.xenta.entities;

public class ContactDetail {

	String type;
	String value;
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
}
</pre>
<pre class="brush: java">
package nl.xenta.entities;

public class Employee {

	private int id;
	private String firstname;
	private String lastname;

	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getFirstname() {
		return firstname;
	}
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}
	public String getLastname() {
		return lastname;
	}
	public void setLastname(String lastname) {
		this.lastname = lastname;
	}
}
</pre>
<p>Deploy the service<br />
The simulated backend systems are ready to supply data.</p>
<h2>Oracle Service Bus resources</h2>
<p>We need to next list of resources in the Oracle Service Bus to be able to implement the process.</p>
<ul>
<li>wsdl + xsd of the deployed EmployeeService java webservice</li>
<li>business services for every third party service</li>
<li>split-join for the aggregation</li>
<li>business service representing the split-join</li>
<li>proxy service which routes to the split-join business service</li>
</ul>
<h2>Wsdl and xsd</h2>
<p>Import the wsdl from the wsdl endpoint shown in the Weblogic Console</p>
<h2>Business services for every third party service</h2>
<p>Since we have just 1 webservice representing all the third parties we don’t really need to create separate business services for every party. To simulate the real scenario we still create 3 separate business services, all based on the same wsdl, but in the routing we will just use different operations.<br />
So create the next set of business services all based on the same EmployeeService wsdl (which we imported in the step before).</p>
<ul>
<li>AddressDetails.biz</li>
<li>ContactDetails.biz</li>
<li>EmployeeDetails.biz</li>
</ul>
<h2>Split-join</h2>
<p>Create a new wsdl for the interface of the split-join. This wsdl will only represent the getEmployee operation. Name the wsdl <strong>CRM_EmployeeService.wsdl</strong>.</p>
<pre class="brush: xml">
&lt;!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI&#039;s version is Oracle JAX-WS 2.1.5. --&gt;&lt;!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI&#039;s version is Oracle JAX-WS 2.1.5. --&gt;&lt;definitions name=&quot;EmployeeServiceService&quot; targetNamespace=&quot;http://services.xenta.nl/&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; xmlns:tns=&quot;http://services.xenta.nl/&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns=&quot;http://schemas.xmlsoap.org/wsdl/&quot;&gt;
	&lt;types&gt;
		&lt;xsd:schema&gt;
			&lt;xsd:import namespace=&quot;http://services.xenta.nl/&quot; schemaLocation=&quot;EmployeeService.xsd&quot;/&gt;
		&lt;/xsd:schema&gt;
	&lt;/types&gt;
	&lt;message name=&quot;getEmployee&quot;&gt;
		&lt;part name=&quot;parameters&quot; element=&quot;tns:getEmployee&quot;/&gt;
	&lt;/message&gt;
	&lt;message name=&quot;getEmployeeResponse&quot;&gt;
		&lt;part name=&quot;parameters&quot; element=&quot;tns:getEmployeeResponse&quot;/&gt;
	&lt;/message&gt;
	&lt;portType name=&quot;CRM_EmployeeService&quot;&gt;
		&lt;operation name=&quot;getEmployee&quot;&gt;
			&lt;input message=&quot;tns:getEmployee&quot;/&gt;
			&lt;output message=&quot;tns:getEmployeeResponse&quot;/&gt;
		&lt;/operation&gt;
	&lt;/portType&gt;
	&lt;binding name=&quot;EmployeeServicePortBinding&quot; type=&quot;tns:CRM_EmployeeService&quot;&gt;
		&lt;soap:binding style=&quot;document&quot; transport=&quot;http://schemas.xmlsoap.org/soap/http&quot;/&gt;
		&lt;operation name=&quot;getEmployee&quot;&gt;
			&lt;soap:operation soapAction=&quot;&quot;/&gt;
			&lt;input&gt;
				&lt;soap:body use=&quot;literal&quot;/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use=&quot;literal&quot;/&gt;
			&lt;/output&gt;
		&lt;/operation&gt;
	&lt;/binding&gt;
	&lt;service name=&quot;EmployeeServiceService&quot;&gt;
		&lt;port name=&quot;EmployeeServicePort&quot; binding=&quot;tns:EmployeeServicePortBinding&quot;&gt;
			&lt;soap:address location=&quot;http://192.168.178.28:7001/EmployeeService/EmployeeServiceService&quot;/&gt;
		&lt;/port&gt;
	&lt;/service&gt;
&lt;/definitions&gt;
</pre>
<pre class="brush: xml">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI&#039;s version is Oracle JAX-WS 2.1.5. --&gt;
&lt;xs:schema xmlns:tns=&quot;http://services.xenta.nl/&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; targetNamespace=&quot;http://services.xenta.nl/&quot; version=&quot;1.0&quot;&gt;
	&lt;xs:element name=&quot;getEmployee&quot; type=&quot;tns:getEmployee&quot;/&gt;
	&lt;xs:element name=&quot;getEmployeeResponse&quot; type=&quot;tns:getEmployeeResponse&quot;/&gt;
	&lt;xs:complexType name=&quot;getEmployee&quot;&gt;
		&lt;xs:sequence&gt;
			&lt;xs:element name=&quot;employeeNumber&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/&gt;
		&lt;/xs:sequence&gt;
	&lt;/xs:complexType&gt;
	&lt;xs:complexType name=&quot;getEmployeeResponse&quot;&gt;
		&lt;xs:sequence&gt;
			&lt;xs:element name=&quot;EmployeeDetails&quot; type=&quot;tns:employeeDetailType&quot; minOccurs=&quot;0&quot;/&gt;
			&lt;xs:element name=&quot;AddressDetails&quot; type=&quot;tns:contactDetailType&quot; minOccurs=&quot;0&quot;/&gt;
			&lt;xs:element name=&quot;ContactDetails&quot; type=&quot;tns:addressDetailType&quot; minOccurs=&quot;0&quot;/&gt;
		&lt;/xs:sequence&gt;
	&lt;/xs:complexType&gt;
	&lt;xs:complexType name=&quot;contactDetailType&quot;&gt;
		&lt;xs:sequence&gt;
			&lt;xs:element name=&quot;type&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/&gt;
			&lt;xs:element name=&quot;value&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/&gt;
		&lt;/xs:sequence&gt;
	&lt;/xs:complexType&gt;
	&lt;xs:complexType name=&quot;employeeDetailType&quot;&gt;
		&lt;xs:sequence&gt;
			&lt;xs:element name=&quot;firstname&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/&gt;
			&lt;xs:element name=&quot;id&quot; type=&quot;xs:int&quot;/&gt;
			&lt;xs:element name=&quot;lastname&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/&gt;
		&lt;/xs:sequence&gt;
	&lt;/xs:complexType&gt;
	&lt;xs:complexType name=&quot;addressDetailType&quot;&gt;
		&lt;xs:sequence&gt;
			&lt;xs:element name=&quot;city&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/&gt;
			&lt;xs:element name=&quot;country&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/&gt;
			&lt;xs:element name=&quot;postalCode&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/&gt;
			&lt;xs:element name=&quot;street&quot; type=&quot;xs:string&quot; minOccurs=&quot;0&quot;/&gt;
		&lt;/xs:sequence&gt;
	&lt;/xs:complexType&gt;
&lt;/xs:schema&gt;
</pre>
<p>Create a new split join (<b>File | New | Split-Join</b>) and name it <b>EmployeeSplitJoin</b>.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin1.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin1-300x286.png" alt="" title="splitjoin1" width="300" height="286" class="aligncenter size-medium wp-image-1320" /></a></p>
<p>By default it will generate for us the variables <strong>request</strong> and <strong>response</strong>.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin2.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin2-300x123.png" alt="" title="splitjoin2" width="300" height="123" class="aligncenter size-medium wp-image-1321" /></a></p>
<p>Add a <strong>Parallel</strong> activity between <strong>Receive</strong> and <strong>Reply</strong>.<br />
Add an extra <strong>Branch</strong> to the <strong>Parallel</strong> activity.<br />
In every <strong>Scope</strong> and a <strong>Invoke Service</strong> activity.<br />
Select the first Invoke Service in the first Scope and configure it.<br />
On the <strong>Operation</strong> tab, browse to the first business service, <strong>AddressDetails</strong>.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin4.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin4-278x300.png" alt="" title="splitjoin4" width="278" height="300" class="aligncenter size-medium wp-image-1323" /></a></p>
<p>On the <strong>Input Variable</strong> tab, select for <strong>Message Variable</strong> the option <strong>Create Message Variable</strong>.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin5.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin5-300x60.png" alt="" title="splitjoin5" width="300" height="60" class="aligncenter size-medium wp-image-1324" /></a><br />
Name the variable <strong>EmployeeAddressRequest</strong> and define it as <strong>Global Variable</strong><br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin6.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin6-300x125.png" alt="" title="splitjoin6" width="300" height="125" class="aligncenter size-medium wp-image-1325" /></a></p>
<p>Do the same for the <strong>Output Variable</strong> tab and name the variable <strong>EmployeeAddressResponse</strong>.</p>
<p>In every Scope add an <strong>assign</strong> before every Invoke Service activity.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/assign2.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/assign2-300x65.png" alt="" title="assign2" width="300" height="65" class="aligncenter size-medium wp-image-1318" /></a><br />
With these assigns we’re mapping the inputparameter of our process (employeeNumber) to the input of our business service (backend service).</p>
<p>Repeat these steps (add scope, add assign, add invoke service, configure input/output of invoke service) for every invocation of our business services.<br />
We should end up with the next set of branches.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/parallel.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/parallel-300x208.png" alt="" title="parallel" width="300" height="208" class="aligncenter size-medium wp-image-1365" /></a></p>
<p>The parallel invocation of our backend services is ready. Now we need to aggregate the responses of all the services. Create a new xquery transformation which will receive 3 inputparameters, one for every response of our backend service. The result of the transformation will be a message according to our proxy service interface (getEmployee).<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/xquery1.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/xquery1-300x201.png" alt="" title="xquery1" width="300" height="201" class="aligncenter size-medium wp-image-1328" /></a><br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/xquery2.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/xquery2-300x195.png" alt="" title="xquery2" width="300" height="195" class="aligncenter size-medium wp-image-1329" /></a><br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/xquery3.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/xquery3-300x180.png" alt="" title="xquery3" width="300" height="180" class="aligncenter size-medium wp-image-1330" /></a><a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/xquery4.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/xquery4-300x139.png" alt="" title="xquery4" width="300" height="139" class="aligncenter size-medium wp-image-1331" /></a></p>
<p>After the Parallel activity add an <strong>Assign</strong>. Click the <strong>expression</strong> and go to the <strong>XQuery Resources</strong> tab and browse to the <strong>ServicesToAggregatedResponse</strong> xquery. Bind all the input parameters as defined in the image below.<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/xquery5.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/xquery5-300x168.png" alt="" title="xquery5" width="300" height="168" class="aligncenter size-medium wp-image-1332" /></a><br />
For the <strong>Variable</strong> select <strong>response.parameters</strong>.</p>
<p>Our split-join part of the process is done. The process flow should look a bit like this :<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin-flow.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/splitjoin-flow-181x300.png" alt="" title="splitjoin-flow" width="181" height="300" class="aligncenter size-medium wp-image-1326" /></a></p>
<p>To be able the call the split-join flow we need to generate a business out of it. Right click on the <strong>EmployeeSplitJoin.flow</strong> and go to <strong>File | Oracle Service Bus | Generate Business Service</strong>, name it <strong>EmployeeSplitJoin</strong>.</p>
<h2>ProxyService</h2>
<p>Create a new http soap proxy service based on the CRM_EmployeeService wsdl. In the proxyservice route to the ‘EmployeeSplitJoin’ business service. Since the interface of our split-join is the same as our proxy service (same wsdl) we can just use the passthrough, no transformation is needed.<br />
Deploy the project and and test the service<br />
<a href="http://www.xenta.nl/blog/wp-content/uploads/2011/07/testconsole.png" target="_blank"><img src="http://www.xenta.nl/blog/wp-content/uploads/2011/07/testconsole-261x300.png" alt="" title="testconsole" width="261" height="300" class="aligncenter size-medium wp-image-1327" /></a></p>
<h2>Conclusion</h2>
<p>Instead of using the split-join we can also use several service call outs in our process. Downside on this approach is all the invokes will be waiting on each other to come back with response (sequential). With the split-join approach we can parallel invoke all the services an aggregate the results. In case of services which need to give a low response time and still need to retrieve data from multiple backend systems we can&#8217;t model the flow with sequential invocations, split-join would then be an approach to take.</p>
<p>Besides that static split-join i used for my case we can also use the dynamic apporach in which we loop over reoccuring elements in the payload, process them parallel an aggregate the results.<br />
Edwin showed this approach in <a href="http://biemond.blogspot.com/2008/11/split-join-in-oracle-service-bus.html" target="_blank">his</a> blog.</p>
<img src="http://www.xenta.nl/blog/?ak_action=api_record_view&id=1333&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.xenta.nl/blog/2011/07/03/oracle-service-bus-implementing-aggregator-pattern-by-use-of-split-join/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

