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

<channel>
	<title>Alexandre Saudate Blog</title>
	<atom:link href="https://alesaudate.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://alesaudate.wordpress.com</link>
	<description>A web services and SOA specialized blog.</description>
	<lastBuildDate>Tue, 11 Sep 2012 21:50:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<site xmlns="com-wordpress:feed-additions:1">12556005</site><cloud domain='alesaudate.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://s0.wp.com/i/webclip.png</url>
		<title>Alexandre Saudate Blog</title>
		<link>https://alesaudate.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://alesaudate.wordpress.com/osd.xml" title="Alexandre Saudate Blog" />
	<atom:link rel='hub' href='https://alesaudate.wordpress.com/?pushpress=hub'/>
	<item>
		<title>An overview of a SOA Architecture</title>
		<link>https://alesaudate.wordpress.com/2012/09/11/an-overview-of-a-soa-architecture/</link>
					<comments>https://alesaudate.wordpress.com/2012/09/11/an-overview-of-a-soa-architecture/#comments</comments>
		
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Tue, 11 Sep 2012 17:29:19 +0000</pubDate>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Concepts]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[BPEL]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[whatis]]></category>
		<guid isPermaLink="false">http://alesaudate.wordpress.com/?p=215</guid>

					<description><![CDATA[Hi, Folks! I know it&#8217;s been quite a while since I&#8217;ve last posted in here&#8230; lots of projects 🙂 As things are evolving on SOA, I would like to give my two cents here about SOA Architectures. So, just to begin the subject, I would like to introduce&#8230; What is SOA? SOA stands for Service-Oriented &#8230; &#8230; <a href="https://alesaudate.wordpress.com/2012/09/11/an-overview-of-a-soa-architecture/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<article class="markdown-body entry-content">
<p>Hi, Folks!</p>
<p>I know it&#8217;s been quite a while since I&#8217;ve last posted in here&#8230; lots of projects <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>As things are evolving on SOA, I would like to give my two cents here about SOA Architectures. So, just to begin the subject, I would like to introduce&#8230;</p>
<h2>
<a name="what-is-soa" class="anchor" href="#what-is-soa"><span class="mini-icon mini-icon-link"></span></a>What is SOA?</h2>
<p>SOA stands for Service-Oriented Architecture (as you probably know by now <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> ). But, WTH is a service? </p>
<p>The efforts to define a service have gone really far, but no one seems to be able to really define a service. People are able to describe a service by <strong>how it should be</strong>, not by what it actually is. According to Thomas Erl (<a href="http://www.soaglossary.com/service_orientation.php">http://www.soaglossary.com/service_orientation.php</a>), a service should:</p>
<ul>
<li>Have a standardized service contract</li>
<li>Promote loose coupling</li>
<li>promote abstraction</li>
<li>be reusable</li>
<li>be autonomous</li>
<li>be stateless</li>
<li>be discoverable</li>
<li>be composable</li>
</ul>
<p>OK, but what does it mean in terms of real-world services?</p>
<p>It means that you should design your services to be <strong>as granular as possible</strong> to promote composability and reusability. It also means that these services should be stateless (i.e., they should not assume that the server is in a state a previous request set it on); these services should be autonomous (i.e., they should not depend on other services to perform it&#8217;s actual task &#8211; unless, of course, we are talking about a composition); they should be discoverable (i.e., you should have some kind of directory where you can find the service that performs the task you are looking for); they should be loose coupled to each other; and last but not least, they should have a contract you can rely on &#8211; one that is standardized such as your clients will not have trouble when using your service. </p>
<p>Note that, so far, no one has talked about WS-* or REST. That&#8217;s because SOA is not defined in terms of technology, or tools, or whatever. SOA is based on a set of good practices, in order to ensure ROI (Return of Investment). BTW, of course SOA is not that cheap (studies prove that a brand new implementation of SOA is 30% more expensive in the initial phases, but they pay off over time). </p>
<p>But, getting back to technology&#8230; nor WS-* nor REST define SOA. You can have lots of WS-* Web Services on your architecture, or lots of REST services on your architecture, but still have no SOA. Again: SOA is based on <strong>practices</strong>, not technology. Of course, enterprises over the world have developed tools to help achieve the goals (some of them don&#8217;t even give so much help ;)), but the tools are not the end &#8211; they are the means. </p>
<p>If you define your architecture such as enough business logic is exposed as services (again, no one is talking about technology here), then you will have SOA. </p>
<p>Buuuut&#8230; here comes the little lines at the bottom.</p>
<h2>
<a name="why-my-company-always-talk-about-technology-and-vendors-when-it-comes-to-soa" class="anchor" href="#why-my-company-always-talk-about-technology-and-vendors-when-it-comes-to-soa"><span class="mini-icon mini-icon-link"></span></a>Why my company always talk about technology and vendors when it comes to SOA?</h2>
<p>The truth is that it can be very hard to promote SOA within the terms mentioned above (or, at least, to do so without tools). That&#8217;s why companies almost always have SOA with WS-* and tooling. It&#8217;s really hard to have directories of services without any kind of tools, and it&#8217;s very hard to promote service discovery without WSDL&#8217;s (OK, REST has got WADL, but it hasn&#8217;t got to a level where every REST service has one. Actually, REST doesn&#8217;t need WADL, and that&#8217;s not the case with WS-* services). </p>
<p>Also, even that your company decides to make its own tooling to promote these practices, it can be very hard as well to comply with non-functional requirements, such as performance, monitorability, scalability, etc. Remember that these services are granular, and that the traffic over network is XML/JSON. Imagine lots of services doing marshalling / unmarshalling of these data everywhere. </p>
<p>So, the first tool that came around to solve these problems is the ESB.</p>
<h2>
<a name="wth-is-an-esb" class="anchor" href="#wth-is-an-esb"><span class="mini-icon mini-icon-link"></span></a>WTH is an ESB?</h2>
<p>ESB stands for Enterprise Service Bus. As the name says, it is nothing but a bus to your services. But, wait&#8230; a bus that takes what to what?</p>
<p>The responsability of an ESB is to map requests from a client (usually, these clients see a service, with a contract and everything else) to&#8230; somewhere. Really, the ESB may lead to a WS-*, a REST service, the file system, BPEL (I&#8217;ll talk about this one later), JMS, and lots of other protocols. Actually, it should be able to transform any protocol to any protocol. But, of course, this very <strong>core</strong> of an ESB may lead to accomplish several other purposes. Take monitorability, for example: if an ESB will map these protocols, and data will pass through it, it may take metrics over it, and map response times, success rate, failure rates, fire alerts when these metrics reach a given threshold, and so on. Also, it may guarantee security to these services (by exposing only the ESB for clients, and inserting some assertions to routings), as well as several other things. </p>
<p>Also, an ESB may promote security by an application level. They usually have a feature known as throttling, which prevents a client from sending too much data (so much it can cause service failure). Of course, these kind of stuff should be ensured within XML Schemas, but they know detailed schemas are hard to maintain inside an ecosystem of dozens, hundreds or even thousands of web services. </p>
<p>But what an ESB does not do is to recompose requests. Remember service composability? That&#8217;s not the function of an ESB (although some of them even do it). Service composability requires a more business-oriented tool, something like&#8230; </p>
<h2>
<a name="bpel" class="anchor" href="#bpel"><span class="mini-icon mini-icon-link"></span></a>BPEL</h2>
<p>BPEL stands for Business Process Execution Language. It is the industry&#8217;s standard for composing workflows, made of several web service calls. What it does is not only the workflow, but handling of several issues, like:</p>
<ul>
<li>expose the composition as a web service itself;</li>
<li>rolling back of failed transactions (known as compensatory transactions);</li>
<li>keeping the state of transactions, both in case of server failure as for auditing;</li>
<li>optimizing the calls to the several web services it may compose;</li>
<li>keeping the flow visual, i.e., to ease the development and/or auditing.</li>
</ul>
<p>As you may have realized, BPEL is specialized in keeping state of stuff. I know, web services should be stateless, and BPEL is &#8211; from the point of view of the client. But it keeps the state of the compositions for more pragmatic stuff like the mentioned above. It is conceptually different from an ESB as ESB&#8217;s should <strong>not</strong> keep the state of the requests, anywhere. </p>
<h2>
<a name="so-how-to-organize-these-together" class="anchor" href="#so-how-to-organize-these-together"><span class="mini-icon mini-icon-link"></span></a>So, how to organize these together?</h2>
<p>A good architecture should leverage all non-functional requirements and, at the same time, be able to change whenever it is needed. It&#8217;s a bit hard to talk about this subject in a single blog post, but within the mentioned features above, a good architecture could be like this:</p>
<p><a target="_blank" href="https://alesaudate.wordpress.com/wp-content/uploads/2012/09/soaarch.png"><img src="https://alesaudate.wordpress.com/wp-content/uploads/2012/09/soaarch.png?w=584" alt="Yes, I totally suck at drawing =/" title="Yes, I totally suck at drawing =/" style="max-width:100%;"></a></p>
<p>As the picture doesn&#8217;t make justice to the thought, let me explain it:</p>
<p>As an ESB does every kind of transformation, protocol A -&gt; protocol B (doesn&#8217;t mean, of course, that A is different from B), it is fair to place all data traffic over it, just to place metrics, alerts, throttling, and everything else, onto it. BPEL, WS-* services, REST services, and so on, will be accessible through it, and BPEL will not see directly the other services, but will reference the services that are already placed inside the ESB. </p>
<p>Of course this architecture has a huge drawback: too much overhead inside one piece. The ESB, here, must be intensively took care of (I hope your company has some baby sitters! =D). It means that maybe a few network cards, some gigabytes of RAM, and clustered to some four, five nodes. But believe me, depending on the number of services your company has (maybe the very size of the company), it totally pays off. Of course, maybe does not make sense if you have only a few services, but I&#8217;m talking here of a few hundreds (or thousands) of services. </p>
<h2>
<a name="conclusion" class="anchor" href="#conclusion"><span class="mini-icon mini-icon-link"></span></a>Conclusion</h2>
<p>You should not believe a single word that&#8217;s written here =D (Just kidding!)</p>
<p>Architectures don&#8217;t come inside a box. You need to be very very extra judiciously to analyze whether you need to place these kind of stuff in your company. Perhaps you don&#8217;t really need BPEL. Perhaps you don&#8217;t really need an ESB at all. Perhaps you need it but you can&#8217;t afford it. Perhaps it makes more sense having REST services than WS-* and these bunch of stuff. Every single aspect of SOA comes with positives and negatives. What you need to do is to analyze these points and carefully think if you really need the positives and if you can handle the negatives. </p>
</article>
]]></content:encoded>
					
					<wfw:commentRss>https://alesaudate.wordpress.com/2012/09/11/an-overview-of-a-soa-architecture/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">215</post-id>
		<media:content url="https://2.gravatar.com/avatar/b46daa95aceb7974043312f267ded48da93bf9f08a6b0fe8ec6c990084d5fe82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alesaudate</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2012/09/soaarch.png" medium="image">
			<media:title type="html">Yes, I totally suck at drawing =/</media:title>
		</media:content>
	</item>
		<item>
		<title>Quickstart series: Spring+Spring Security+Jersey+Hibernate</title>
		<link>https://alesaudate.wordpress.com/2012/01/03/quickstart-series-springspring-securityjerseyhibernate/</link>
					<comments>https://alesaudate.wordpress.com/2012/01/03/quickstart-series-springspring-securityjerseyhibernate/#comments</comments>
		
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Tue, 03 Jan 2012 12:04:41 +0000</pubDate>
				<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[Jersey]]></category>
		<category><![CDATA[JPA]]></category>
		<category><![CDATA[kickstart]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[quickstart]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[spring security]]></category>
		<guid isPermaLink="false">http://alesaudate.com/?p=209</guid>

					<description><![CDATA[A bootstrap project to begin coding with Spring, Spring Security, Jersey and Hibernate, all integrated and functioning. &#8230; <a href="https://alesaudate.wordpress.com/2012/01/03/quickstart-series-springspring-securityjerseyhibernate/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m starting the &#8216;quickstart series&#8217; &#8211; the initial post will be about these four technologies, integrated and fully functional.</p>
<p>The project is built with Maven and Eclipse, sou you may be able to checkout it and import it on your Eclipse (or other environments compatible with Eclipse, like Netbeans). </p>
<p>It is configured with:</p>
<p>Spring and Spring Security 3.0.5<br />
Jersey 1.9<br />
Hibernate 3.4.0<br />
JPA 1.0<br />
MySQL 5.1</p>
<p>If you want a different configuration, feel free to modify it as you wish and, if you don&#8217;t mind, please take a few minutes to update the repository. By the way, it is <a href="https://github.com/alesaudate/kickstart-springjerseyhibernate" title="https://github.com/alesaudate/kickstart-springjerseyhibernate" target="_blank">https://github.com/alesaudate/kickstart-springjerseyhibernate</a>. Feel free to clone it and have a bootstrap on your project.</p>
<p>Enjoy!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://alesaudate.wordpress.com/2012/01/03/quickstart-series-springspring-securityjerseyhibernate/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">209</post-id>
		<media:content url="https://2.gravatar.com/avatar/b46daa95aceb7974043312f267ded48da93bf9f08a6b0fe8ec6c990084d5fe82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alesaudate</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle BPEL Hello World</title>
		<link>https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/</link>
					<comments>https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/#respond</comments>
		
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Sat, 12 Feb 2011 15:12:57 +0000</pubDate>
				<category><![CDATA[BPEL]]></category>
		<category><![CDATA[Hello World]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://alesaudate.com/?p=172</guid>

					<description><![CDATA[Hi, everybody! Today, I´m gonna show you how to do a hello world using Oracle´s BPEL engine. You are gonna need: A properly installed SOA Suite , 11g (I´m not gonna show here how to install it, but there are plenty of good stuff on this subject on the web); A JDeveloper 11g with SOA &#8230; &#8230; <a href="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Hi, everybody! Today, I´m gonna show you how to do a hello world using Oracle´s BPEL engine. You are gonna need:</p>
<ul>
<li>A properly installed SOA Suite , 11g (I´m not gonna show here how to install it, but there are plenty of good stuff on this subject on the web);</li>
<li>A JDeveloper 11g with SOA Extensions enabled</li>
<li>A test tool named <a href="http://www.soapui.org/">SOAP UI</a></li>
</ul>
<p>So, let´s do it: start your SOA Suite and JDeveloper. Once your JDeveloper is open, right-click the applications area, as shown in the figure:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg"><img data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" srcset="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=300 300w, https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=600 600w, https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=150 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Then, select the menu &#8220;SOA Tier&#8221; and the SOA Project:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/2.jpg"><img data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/2.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Select your project´s name and the project technology (in our case, SOA):</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/3.jpg"><img data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/3.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Create your project using Composite with BPEL (as it should be just a simple BPEL project; some day I will explain here what the other types are):</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/4.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/4.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Select the synchronous template and mark the &#8220;expose as a SOAP service&#8221; checkbox:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/5.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/5.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Then, you should see something similar to the image:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/6.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/6.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Click on the assign component and drag it to the diagram. You see highlighted positions; they are places where you can drop the component:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/7.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/7.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Place the assign in the proper position:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/8.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/8.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Then, double click the just-placed component. You should see an image similar to the next one:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/9.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/9.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Click the  &#8216;plus&#8217; icon and you will see the following options:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/10.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/10.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Once doing so, click the &#8220;copy operation&#8221; option. You should see the following screen:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/11.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/11.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Expand both sides until you see the following screen (you should select the options, too):</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/12.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/12.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Then, click OK. You will get back to the previous screen. Select the &#8220;general&#8221; tab and change the name of the operation to &#8220;AssignEcho&#8221;, like the screen:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/13.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/13.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Click OK and you will get back to the BPEL Designer screen. Now, it´s time to deploy our process. Right-click your project, and you should see a menu like the following:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/14.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/14.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>As you maybe don´t have a connection in place, select the &#8220;new connection&#8221; option. Then, follow the wizard:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/15.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/15.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>I´m assuming here that your username is weblogic (and you know the password as well):</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/16.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/16.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Also, I´m assuming here that your SOA Suite is loaded on localhost, port 7001 (or 7002 if it´s SSL), with a domain loaded to soa_domain. They are the defaults.</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/17.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/17.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Then, click &#8220;test connection&#8221;. If everything is OK, you should see the &#8220;8 of 8 tests succesful&#8221; status message.</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/18.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/18.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Click OK and, once again, you will get back to the BPEL Designer screen. Now, your new connection should be available on the connections list:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/19.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/19.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Click the newly-created connection and you should see the deploy screen:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/20.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/20.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>While deploying, it should ask for username and password:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/21.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/21.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Then, access the Enterprise Manager site (for me, it is available on <a href="http://localhost:7001/em" rel="nofollow">http://localhost:7001/em</a>). Once inputting the username and password, you should see the following screen:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/22.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/22.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Expand the selections according to the image and select your newly-deployed project:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/23.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/23.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>If you click the &#8220;test&#8221; button, you should see a screen like this:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/24.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/24.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Personally, I don´t like using the enterprise manager to test my services, for personal reasons. So, I´d rather using SOAP UI. Select the WSDL of your service and then, create a project in SOAP UI, like this one:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/25.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/25.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>Once doing so, SOAP UI will create a screen like the following (if everything is OK, change the interrogation sign for &#8220;hello, world!&#8221; or anything like this):</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/26.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/26.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>If everything is OK, then you should see a screen like this:</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/27.jpg"><img loading="lazy" data-attachment-id="174" data-permalink="https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/attachment/1/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg" data-orig-size="1280,998" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/27.jpg?w=300&#038;h=233" alt="" title="1" width="300" height="233" class="aligncenter size-medium wp-image-174" /></a></p>
<p>And that´s it! Your BPEL Process is working, as it is echoing every phrase you input to it. If you want to go further, try to explore the Assign component and the others, to improve your knowledge.</p>
<p>See ya!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://alesaudate.wordpress.com/2011/02/12/oracle-bpel-hello-world/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">172</post-id>
		<media:content url="https://2.gravatar.com/avatar/b46daa95aceb7974043312f267ded48da93bf9f08a6b0fe8ec6c990084d5fe82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alesaudate</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/1.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/2.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/3.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/4.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/5.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/6.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/7.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/8.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/9.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/10.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/11.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/12.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/13.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/14.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/15.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/16.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/17.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/18.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/19.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/20.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/21.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/22.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/23.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/24.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/25.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/26.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/27.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>
	</item>
		<item>
		<title>Help me improve!</title>
		<link>https://alesaudate.wordpress.com/2011/02/10/help-me-improve/</link>
					<comments>https://alesaudate.wordpress.com/2011/02/10/help-me-improve/#comments</comments>
		
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Thu, 10 Feb 2011 23:00:15 +0000</pubDate>
				<guid isPermaLink="false">http://alesaudate.com/?p=169</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[<a name="pd_a_4533580"></a><div class="CSS_Poll PDS_Poll" id="PDI_container4533580" data-settings="{&quot;url&quot;:&quot;https://secure.polldaddy.com/p/4533580.js&quot;}" style=""></div><div id="PD_superContainer"></div><noscript><a href="https://polldaddy.com/p/4533580" target="_blank" rel="noopener noreferrer">Take Our Poll</a></noscript>
]]></content:encoded>
					
					<wfw:commentRss>https://alesaudate.wordpress.com/2011/02/10/help-me-improve/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">169</post-id>
		<media:content url="https://2.gravatar.com/avatar/b46daa95aceb7974043312f267ded48da93bf9f08a6b0fe8ec6c990084d5fe82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alesaudate</media:title>
		</media:content>
	</item>
		<item>
		<title>Protecting your services with a simple fuse..</title>
		<link>https://alesaudate.wordpress.com/2011/02/04/the-circuit-breaker-pattern/</link>
					<comments>https://alesaudate.wordpress.com/2011/02/04/the-circuit-breaker-pattern/#respond</comments>
		
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Sat, 05 Feb 2011 00:05:31 +0000</pubDate>
				<category><![CDATA[SOA Patterns]]></category>
		<category><![CDATA[advices]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Good Practices]]></category>
		<category><![CDATA[quick post]]></category>
		<category><![CDATA[SOA]]></category>
		<guid isPermaLink="false">http://alesaudate.com/?p=149</guid>

					<description><![CDATA[Michael Nygard, in his book Release It! Design and Deploy Production-Ready Software describes a pattern he called Circuit Breaker. It is based on the idea of fuses, that is, anything that may be dangerous should be put around a safe structure, that may disable the operation requests if it has any chance to do any &#8230; &#8230; <a href="https://alesaudate.wordpress.com/2011/02/04/the-circuit-breaker-pattern/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Michael Nygard, in his book <em>Release It! Design and Deploy Production-Ready Software</em> describes a pattern he called Circuit Breaker. It is based on the idea of fuses, that is, anything that may be dangerous should be put around a safe structure, that may disable the operation requests if it has any chance to do any harm to the application itself or others. It is best described through the image (click to enlarge):</p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/circuit-breaker1.gif"><img loading="lazy" data-attachment-id="154" data-permalink="https://alesaudate.wordpress.com/2011/02/04/the-circuit-breaker-pattern/circuit-breaker-2/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/circuit-breaker1.gif" data-orig-size="807,471" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="circuit breaker" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/circuit-breaker1.gif?w=584" src="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/circuit-breaker1.gif?w=300&#038;h=175" alt="The Circuit breaker pattern, as described by Michael Nygard" title="circuit breaker" width="300" height="175" class="aligncenter size-medium wp-image-154" srcset="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/circuit-breaker1.gif?w=300 300w, https://alesaudate.wordpress.com/wp-content/uploads/2011/02/circuit-breaker1.gif?w=600 600w, https://alesaudate.wordpress.com/wp-content/uploads/2011/02/circuit-breaker1.gif?w=150 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>The flow is like that: the dangerous operation has the fuse as a shell. The first state, &#8220;closed fuse&#8221;, has a counter of failed invocations and a threshold. When the client produces an invocation, it allows the invocation to pass through. If the call succeeds, then resets the counter. If it fails, increment the counter. If the counter reaches the threshold, it disables the fuse, going to the &#8220;open fuse&#8221; state. This state has a variable that represents an ammount of time and another one representing the moment in time when it has become the active state. Any call to the dangerous operation in this state will cause it to fail without even invoking the operation. When it is in this state for the amount of time specified in the variable, it decides that the call deserves another chance. So the invocation goes to the &#8220;half open fuse&#8221;. This state tries to invoke the operation again. If it fails, go to the open state again, resetting the timer. If it succeeds, go to the closed state again, resetting the counter of failed invocations. </p>
<p><em><strong>OK, nice pattern, but what does it have to do with SOA?</strong></em></p>
<p>The magic in this pattern (and the whole book) is that it brings light to subjects that most developers don´t give enough attention. One of these subjects is that you cannot rely on the network. Final. I have never seen any thrustable network (and I believe you haven´t, too!), so, as long as SOA is a kind of distributed architecture that relies on the network and we cannot rely on the network, so <strong>we can´t rely on services either!</strong> So, as long as services are unthrustable, we can apply this pattern, to:</p>
<ul>
<li>Ensure that we won´t get stuck waiting for services that might never return;</li>
<li>Ensure that, if the server that is holding the web service is drowning from lots of invocations, at least we are not the ones that are gonna disable it for good;</li>
<li>And many many other good reasons to do so. Read the book <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </li>
</ul>
<p>As Michael himself doesn´t give any hints on the implementation of such a pattern, I decided to implement it, and you can download it from the downloads section. It is very simple, as it doesn´t allow only web services to be invoked via the pattern, but any other kind of dangerous operation too. You can modify the code the way you want to achieve your desire. My hint is that, allied to stuff like AOP and interceptors in general, you may do it the ultimate solution to never, ever have this kind of problem again.</p>
<p>Cheers!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://alesaudate.wordpress.com/2011/02/04/the-circuit-breaker-pattern/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">149</post-id>
		<media:content url="https://2.gravatar.com/avatar/b46daa95aceb7974043312f267ded48da93bf9f08a6b0fe8ec6c990084d5fe82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alesaudate</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2011/02/circuit-breaker1.gif?w=300" medium="image">
			<media:title type="html">circuit breaker</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick Post: Integrating Spring and Jersey</title>
		<link>https://alesaudate.wordpress.com/2011/02/02/quick-post-integrating-spring-and-jersey/</link>
					<comments>https://alesaudate.wordpress.com/2011/02/02/quick-post-integrating-spring-and-jersey/#comments</comments>
		
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Wed, 02 Feb 2011 22:02:15 +0000</pubDate>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[JAX-RS]]></category>
		<category><![CDATA[quick post]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://alesaudate.com/?p=145</guid>

					<description><![CDATA[When: When you need Spring to manage Jersey´s libraries, but still want to be free to develop your services using JAX-RS. When not: If your team does not know REST, maybe it´s not a good idea to use it in development, because REST has its own culture &#8211; Uniform Interfaces, Hypermedia, the concept of Resource-Oriented, &#8230; &#8230; <a href="https://alesaudate.wordpress.com/2011/02/02/quick-post-integrating-spring-and-jersey/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><strong>When:</strong> When you need Spring to manage Jersey´s libraries, but still want to be free to develop your services using JAX-RS.</p>
<p><strong>When not:</strong> If your team does not know REST, maybe it´s not a good idea to use it in development, because REST has its own culture &#8211; Uniform Interfaces, Hypermedia, the concept of Resource-Oriented, etc.</p>
<p><strong>How:</strong></p>
<p><em>BaseEntity.java</em></p>
<pre class="brush: java; title: ; notranslate">
package com.alesaudate.domain;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;

import org.hibernate.validator.ClassValidator;
import org.hibernate.validator.InvalidValue;


@MappedSuperclass
public abstract class BaseEntity {
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long id;
	
	@Version
	private Long version;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getVersion() {
		return version;
	}

	public void setVersion(Long version) {
		this.version = version;
	}
	
	
	
	/**
	Validation code, that is valid for all subclasses.
	*/
	public void validate () throws ValidationException {
	
		ClassValidator validator = new ClassValidator(getClass());		
		
		InvalidValue[] invalidValues = validator.getInvalidValues(this);
		
		if (invalidValues != null &amp;&amp; invalidValues.length &gt; 0) {
			throw new ValidationException(buildValidationExceptionMessage(invalidValues));
		}
	}
	
	
	public String buildValidationExceptionMessage (InvalidValue[] invalidValues) {
		StringBuilder builder = new StringBuilder();
		
		for (InvalidValue value : invalidValues) {
			builder.append(value.toString()).append(&quot;\n&quot;);
		}
		
		return builder.toString();
	}
	
}


</pre>
<p><em>BaseService.java</em></p>
<pre class="brush: java; title: ; notranslate">
package com.alesaudate.services;

import java.util.ArrayList;
import java.util.List;

import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.alesaudate.domain.BaseEntity;
import com.alesaudate.domain.InvalidStateException;
import com.alesaudate.domain.Person;
import com.alesaudate.services.support.collections.Collection;



@Component
public abstract class BaseService&lt;T extends BaseEntity&gt; {
	
	
	@Autowired
	private HibernateTemplate hibernateTemplate;
	
	
	@Transactional
	public T createOnDatabase (T entity) throws InvalidStateException {
		entity.validate();
		getHibernateTemplate().persist(entity);
		return entity;
	}
	
	
	@POST
	@Produces({MediaType.TEXT_XML, MediaType.APPLICATION_XML})
	public T create (T entity) throws InvalidStateException {
		return createOnDatabase(entity);
	}
	
	
	@Transactional
	public T updateOnDatabase (T entity) throws InvalidStateException {
		entity.validate();
		getHibernateTemplate().update(entity);
		return entity;
	}
	
	@PUT
	@Produces({MediaType.TEXT_XML, MediaType.APPLICATION_XML})
	public T update (T entity) throws InvalidStateException  {
		return updateOnDatabase(entity);
	}
	
	
	@Transactional(readOnly=true)
	public T findOnDatabase (Long id) {
		
		DetachedCriteria criteria = DetachedCriteria.forClass(getManagedClass()).add(Restrictions.eq(&quot;id&quot;, id));
		List entities = getHibernateTemplate().findByCriteria(criteria);
		if (entities.isEmpty()) 
			return null;
		return (T)entities.get(0);
	}
	
	@GET
	@Path(&quot;{id}&quot;)
	@Produces({MediaType.TEXT_XML, MediaType.APPLICATION_XML})
	public T find (@PathParam(&quot;id&quot;)Long id) {
		T entity = findOnDatabase(id);
		loadEntity(entity);
		return entity;
	}
	
	
	@Transactional(readOnly=true)
	public List&lt;T &gt; findAllFromDatabase () {
		
		DetachedCriteria criteria = DetachedCriteria.forClass(getManagedClass());
		List&lt;T&gt; all = getHibernateTemplate().findByCriteria(criteria);
		loadList(all);
		return all;
	}
	
	@GET	
	@Produces({MediaType.TEXT_XML, MediaType.APPLICATION_XML})	
	@Collection
	public List&lt;T&gt; findAll() {
		return findAllFromDatabase();
	}
	
	
	@Transactional
	public void deleteFromDatabase (T toDelete) {
		getHibernateTemplate().delete(toDelete);
	}
	
	

	@DELETE
	@Produces({MediaType.TEXT_XML, MediaType.APPLICATION_XML})
	public void delete (T toDelete) {
		deleteFromDatabase(toDelete);
	}
	
	public abstract Class&lt;? extends BaseEntity&gt; getManagedClass();
	
	
	public abstract void loadEntity (T data);
	
	public abstract void loadList (java.util.Collection&lt;T&gt; data);
	
	
	public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
		this.hibernateTemplate = hibernateTemplate;
	}
	
	public HibernateTemplate getHibernateTemplate() {
		return hibernateTemplate;
	}

}

</pre>
<p><em>PersonService.java</em></p>
<pre class="brush: java; title: ; notranslate">
package com.alesaudate.services;

import java.util.Collection;

import javax.ws.rs.Path;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.alesaudate.domain.Address;
import com.alesaudate.domain.BaseEntity;
import com.alesaudate.domain.Person;




@Component
@Path(&quot;/person&quot;)
public class PersonService extends BaseService&lt;Person&gt;{

	@Override
	public Class&lt;? extends BaseEntity&gt; getManagedClass() {
		return Person.class;
	}

	@Override
	public void loadEntity(Person data) {
		//Load addresses
		data.getAddresses();
	}

	@Override
	@Transactional(propagation=Propagation.MANDATORY)
	public void loadList(Collection&lt;Person&gt; data) {
		for (Person p : data) {			
			getHibernateTemplate().find(&quot;select p.addresses from Person p&quot;);
			for (Address address : p.getAddresses()) {
				getHibernateTemplate().evict(address);
				address.makeXMLCompatible();
			}
			getHibernateTemplate().evict(p);
		}
		
	}

	
	
	
	
	
	
}
</pre>
<p><em>applicationContext.xml:</em></p>
<pre class="brush: xml; title: ; notranslate">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
	xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
	xmlns:context=&quot;http://www.springframework.org/schema/context&quot;
	xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd&quot;&gt;

	

	&lt;context:component-scan base-package=&quot;com.alesaudate.services&quot; /&gt;

&lt;!-- Other bean definitions... --&gt;		


&lt;/beans&gt;

</pre>
<p><em>web.xml</em></p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xmlns:web=&quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot; id=&quot;WebApp_ID&quot; version=&quot;2.5&quot;&gt;
  &lt;display-name&gt;Architecture&lt;/display-name&gt;
  
  &lt;context-param&gt;
       &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
       &lt;param-value&gt;classpath:applicationContext.xml&lt;/param-value&gt;
   &lt;/context-param&gt;

 
   &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
   &lt;/listener&gt;
   &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.request.RequestContextListener&lt;/listener-class&gt;
   &lt;/listener&gt;

 &lt;servlet&gt;
 	&lt;servlet-name&gt;Jersey Servlet&lt;/servlet-name&gt;
 	&lt;servlet-class&gt;com.sun.jersey.spi.spring.container.servlet.SpringServlet&lt;/servlet-class&gt;
 &lt;/servlet&gt;
 
 &lt;servlet-mapping&gt;
 	&lt;servlet-name&gt;Jersey Servlet&lt;/servlet-name&gt;
 	&lt;url-pattern&gt;/*&lt;/url-pattern&gt;
 &lt;/servlet-mapping&gt;
  
&lt;/web-app&gt;
</pre>
<p>End.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://alesaudate.wordpress.com/2011/02/02/quick-post-integrating-spring-and-jersey/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">145</post-id>
		<media:content url="https://2.gravatar.com/avatar/b46daa95aceb7974043312f267ded48da93bf9f08a6b0fe8ec6c990084d5fe82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alesaudate</media:title>
		</media:content>
	</item>
		<item>
		<title>How to develop a standalone SSL web service</title>
		<link>https://alesaudate.wordpress.com/2010/12/08/how-to-develop-a-standalone-ssl-web-service/</link>
					<comments>https://alesaudate.wordpress.com/2010/12/08/how-to-develop-a-standalone-ssl-web-service/#comments</comments>
		
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Wed, 08 Dec 2010 01:02:53 +0000</pubDate>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[JAX-WS]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://alesaudate.com/?p=133</guid>

					<description><![CDATA[This post shows how to create a SSL web service (it means, a service available through HTTPS). &#8230; <a href="https://alesaudate.wordpress.com/2010/12/08/how-to-develop-a-standalone-ssl-web-service/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><strong><em>How to develop a standalone SSL web service</em></strong></p>
<p>Hi! Today, I´m gonna show you how to develop a simple SSL web service. Please note that this is not a &#8220;enterprise&#8221; way of developing a secure web service, but this may be very useful for testing purposes. </p>
<p><strong><em>Constraints</em></strong></p>
<p>To develop this service, you need to use a Sun/Oracle JVM (I tested with 1.6 VM, but should work with 1.5, too). This is not gonna work in any other kind of VM. Also, you need to have JAX-WS in your classpath. </p>
<p><strong><em>The code</em></strong></p>
<p>The code begins with the development of the web service itself. I used a standard JAX-WS service as an example, so my service looks like this:</p>
<pre class="brush: java; title: ; notranslate">

@WebService
public class SOAPService {

	public String test() {
		return &quot;Hello, SSL world!&quot;;
	}	
}
</pre>
<p>Next, we may use Java´s Endpoint class to create our object as an web service. The code is like</p>
<p>Endpoint endpoint = Endpoint.create(new SOAPService());</p>
<p>At this point, you need to create the server, and to create the server, you need a .jks (Java Keystore) file. You may create this file using JDK´s (or JRE´s) tooling, but I prefer using a GUI to do so. Personally, I like Lazgo´s KeyStore Explorer (available <a href="http://www.lazgosoftware.com/kse/">here</a>). I won´t get in details here on how to create the JKS file; if you don´t know how to do it, you may want to have a look <a href="http://www.google.com.br/#hl=pt-BR&amp;source=hp&amp;biw=1276&amp;bih=589&amp;q=create+JKS+file&amp;aq=f&amp;aqi=&amp;aql=&amp;oq=&amp;gs_rfai=&amp;fp=e12029023860c8db">here</a>. </p>
<p><strong>Note: be aware that the CN attribute of your certificate must be equal to your host´s name!</strong></p>
<p>After creating the JKS file, we are ready to create our HTTPS server. I won´t explain this code very much, as it should be pretty self-explanatory:</p>
<pre class="brush: java; title: ; notranslate">

public static void main(String[] args) throws Exception {
		Endpoint endpoint = Endpoint.create(new SOAPService());
		SSLContext ssl =  SSLContext.getInstance(&quot;SSLv3&quot;);
		
		
		KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); 
		KeyStore store = KeyStore.getInstance(KeyStore.getDefaultType());


		//Load the JKS file (located, in this case, at D:\keystore.jks, with password 'test'
		store.load(new FileInputStream(&quot;D:\\keystore.jks&quot;), &quot;test&quot;.toCharArray()); 

		//init the key store, along with the password 'test'
		kmf.init(store, &quot;test&quot;.toCharArray());
		KeyManager[] keyManagers = new KeyManager[1];
		keyManagers = kmf.getKeyManagers();
		
		

		//Init the trust manager factory
		TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());

		//It will reference the same key store as the key managers
		tmf.init(store);
		
		TrustManager[] trustManagers = tmf.getTrustManagers();
		
		
		ssl.init(keyManagers, trustManagers, new SecureRandom());

		//Init a configuration with our SSL context
		HttpsConfigurator configurator = new HttpsConfigurator(ssl);
		

		//Create a server on localhost, port 443 (https port)
		HttpsServer httpsServer = HttpsServer.create(new InetSocketAddress(&quot;localhost&quot;, 443), 443);
		httpsServer.setHttpsConfigurator(configurator);
		
		
		//Create a context so our service will be available under this context
		HttpContext context = httpsServer.createContext(&quot;/test&quot;);
		httpsServer.start();
		

		//Finally, use the created context to publish the service
		endpoint.publish(context);
		
		

	}


</pre>
<p>And <i>voilà</i>! That should be enough to your service be available under SSL. With this code, the wsdl of the service should be available under <a><a href="https://localhost:443/test?wsdl" rel="nofollow">https://localhost:443/test?wsdl</a></a>.</p>
<p>Please note that, at the time that I developed this service, I had some trouble with the generated WSDL, specifically with the port address and references to schema files. A reasonable work around for this problem (if you have it too) is to download the files (WSDL, schemas, and so on) and fix it by hand. </p>
<p>See ya!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://alesaudate.wordpress.com/2010/12/08/how-to-develop-a-standalone-ssl-web-service/feed/</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">133</post-id>
		<media:content url="https://2.gravatar.com/avatar/b46daa95aceb7974043312f267ded48da93bf9f08a6b0fe8ec6c990084d5fe82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alesaudate</media:title>
		</media:content>
	</item>
		<item>
		<title>How to intercept web services ingoing/outgoing messages</title>
		<link>https://alesaudate.wordpress.com/2010/11/05/how-to-intercept-web-services-ingoingoutgoing-messages/</link>
					<comments>https://alesaudate.wordpress.com/2010/11/05/how-to-intercept-web-services-ingoingoutgoing-messages/#respond</comments>
		
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Fri, 05 Nov 2010 01:04:48 +0000</pubDate>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[JAX-WS]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://alesaudate.com/?p=125</guid>

					<description><![CDATA[This post shows how to use a handler chain with JAX-WS web services. &#8230; <a href="https://alesaudate.wordpress.com/2010/11/05/how-to-intercept-web-services-ingoingoutgoing-messages/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Hi, everybody! I´m just passing around to show a technique to easily intercept JAX-WS web services messages. It is a quick piece of knowledge, and it is based on three simple steps. </p>
<p><em><strong>I know that you always say, first, what I need to know&#8230;</strong></em></p>
<p>That´s right. First of all, be aware that I tested it with EJB´s services, and I don´t know if it works with other types of exposed web services. Also, note that I present here a solution that works with annotated web services. </p>
<p><em><strong>Ok, show me the solution</strong></em></p>
<p>Step #1: Annotate your web service´s class with @HandlerChain:</p>
<pre class="brush: java; title: ; notranslate">
package com.alesaudate.webservices;

@WebService
@HandlerChain(file=&quot;handlers.xml&quot;) //Here, you need to reference a configuration file. In this case, it got to be in the same package as the class
public class MyService {

//...


}
</pre>
<p>Step #2: Create a configuration file, like:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;jws:handler-chains xmlns:jws=&quot;http://java.sun.com/xml/ns/javaee&quot;&gt;

  &lt;jws:handler-chain&gt;
    &lt;jws:handler&gt;
      &lt;jws:handler-name&gt;MimeHandler&lt;/jws:handler-name&gt;
      &lt;jws:handler-class&gt;com.alesaudate.webservices.MimeTypeHandler&lt;/jws:handler-class&gt;      
    &lt;/jws:handler&gt;
&lt;/jws:handler-chain&gt;
  
&lt;/jws:handler-chains&gt;
</pre>
<p>(Note that it need to be named &#8220;handlers.xml&#8221;, as referenced in the annotation)</p>
<p>Step #3: Create a interceptor for the class:</p>
<pre class="brush: java; title: ; notranslate">
package com.alesaudate.webservices;

import java.util.Set;

import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;

public class MimeTypeHandler implements SOAPHandler&lt;SOAPMessageContext&gt;{

	public Set&lt;QName&gt; getHeaders() {
		return null;
	}

	public void close(MessageContext context) {
		
	}

	public boolean handleFault(SOAPMessageContext context) {
		return true;
	}

	public boolean handleMessage(SOAPMessageContext context) {
		try {
                                          context.getMessage().getMimeHeaders().setHeader(&quot;Content-Type&quot;, &quot;text/xml&quot;);
		} catch (SOAPException e) {
			throw new RuntimeException(e);
		}
		return true;
	}
	

}
</pre>
<p>Pretty easy, right? I´m taking for granted that the interceptor and the configuration file are pretty self-explanatory, but if you have any doubts, don´t hesitate asking me, OK?</p>
<p>Bye!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://alesaudate.wordpress.com/2010/11/05/how-to-intercept-web-services-ingoingoutgoing-messages/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">125</post-id>
		<media:content url="https://2.gravatar.com/avatar/b46daa95aceb7974043312f267ded48da93bf9f08a6b0fe8ec6c990084d5fe82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alesaudate</media:title>
		</media:content>
	</item>
		<item>
		<title>Patterns of System Integration #1: Services mediator</title>
		<link>https://alesaudate.wordpress.com/2010/11/03/patterns-of-system-integration-1-services-mediator/</link>
					<comments>https://alesaudate.wordpress.com/2010/11/03/patterns-of-system-integration-1-services-mediator/#respond</comments>
		
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Wed, 03 Nov 2010 01:24:18 +0000</pubDate>
				<category><![CDATA[SOA]]></category>
		<category><![CDATA[advices]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Services Mediator]]></category>
		<category><![CDATA[Web Services]]></category>
		<guid isPermaLink="false">http://alesaudate.com/?p=120</guid>

					<description><![CDATA[This post presents the explanation of a pattern that I call Services Mediator (or Mediator Layer). &#8230; <a href="https://alesaudate.wordpress.com/2010/11/03/patterns-of-system-integration-1-services-mediator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><em>Disclaimer: this pattern does not refer to Oracle´s SOA Suite 11g Mediator, nor any Thomas Erl´s Patterns (although it looks like the implementation of pieces of some of his patterns).</em></p>
<p><em><strong>So, give me a brief description on what it is about.</strong></em></p>
<p>People who are used to work with SOA are, usually, used to work with ESB´s &#8211; I say &#8220;ESB´s&#8221;, plural, to mean different kinds from different vendors of ESB &#8211; and BPEL. ESB´s are often used to justify decoupling of clients from service providers. I think it is great, but people usually forget that ESB´s, as long as they are too decoupled from the system, do not provide so much advantages as it should. So, usually, ESB´s are a layer of extra complexity to systems (the exception are some odd situations that don´t fit the usual description). Sometimes, you need some piece of software that is more intimate to the system, that can interact in an easier way to the system (like some easy way to audit calls, log them, place warns on whether systems are responding or not &#8211; therefore avoiding issues on being overloaded due to slow responsiveness of external services -, etc.). So, thinking about it, I developed this pattern.  </p>
<p><em><strong>Explain it better, what is it about?</strong></em></p>
<p>People need to be in control of their applications. People <em>should</em> be in control of their applications. Usually, that´s not what happens to a SOA-based app, because we rely too much on external tools and forget that good things may be done at home, too. So, you don´t need to use a service composition to audit external services I/O, for example. If you would do so by today´s standards, you would build a service to do the auditing, then group the external service and the audit service into one piece of service composition, then offer the composition´s contract to the client&#8230; too much work. You should not build separate services unless you need them as services (after all, SOA is about getting the IT to work along with the business, right? So, it should not try to add extra pieces of complexity, like one more service, to the business, right?); so, you should approach the problem with another solution, like intercepting the messages according to your programming language way of doing so. </p>
<p>So, my pattern is about intercepting outgoing messages / incoming responses by building transparent, language-friendly units, in a manner that, if you need extra capabilities but do not want (or do not need) to build extra services, you should consider applying this pattern.</p>
<p><em><strong>How to do it?</strong></em></p>
<p><a href="https://alesaudate.wordpress.com/wp-content/uploads/2010/11/mediator-layer.png"><img loading="lazy" data-attachment-id="121" data-permalink="https://alesaudate.wordpress.com/2010/11/03/patterns-of-system-integration-1-services-mediator/mediator-layer/" data-orig-file="https://alesaudate.wordpress.com/wp-content/uploads/2010/11/mediator-layer.png" data-orig-size="548,317" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Mediator Layer" data-image-description="" data-image-caption="" data-large-file="https://alesaudate.wordpress.com/wp-content/uploads/2010/11/mediator-layer.png?w=548" src="https://alesaudate.wordpress.com/wp-content/uploads/2010/11/mediator-layer.png?w=300&#038;h=173" alt="" title="Mediator Layer" width="300" height="173" class="aligncenter size-medium wp-image-121" srcset="https://alesaudate.wordpress.com/wp-content/uploads/2010/11/mediator-layer.png?w=300 300w, https://alesaudate.wordpress.com/wp-content/uploads/2010/11/mediator-layer.png?w=150 150w, https://alesaudate.wordpress.com/wp-content/uploads/2010/11/mediator-layer.png 548w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>First, you should take the original WSDL and override it, replacing the original address &#8211; a technique shown <a href="http://alesaudate.com/2010/08/31/how-to-create-a-web-service-contract-first-or-how-to-create-a-web-service-that-handles-xml/">here</a>. I´m gonna call this service &#8220;shell service&#8221;, from now on. The shell service´s purpose is to provide the capability of adding this extra logic, which means it should be built in the main programming language you use in your application. To build it, you should use the same logic as the mentioned post, but should modify the provider to something like the following:</p>
<pre class="brush: java; title: ; notranslate">


package com.alesaudate.webservices;

import javax.xml.soap.SOAPMessage;
import java.net.URL;
import java.util.Iterator;
import javax.xml.namespace.QName;
import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;


public class SOAPProvider {

	public Dispatch&lt;SOAPMessage&gt; getDispatcher (String wsdl, String namespace, String servicename, String portName){

		try {
			//create a representation of the service
			Service service = Service.create(new URL(wsdl), new QName(
					namespace, servicename));

			final Iterator&lt;QName&gt; ports = service.getPorts();

			QName methodToBeCalled = null;

			//Select the port to be called
			if (portName == null)
				methodToBeCalled = ports.next();

			else {
				while (methodToBeCalled == null || !methodToBeCalled.getLocalPart().equals(portName)) {
					methodToBeCalled = ports.next();
				}
			}

			//Create the dispatcher, given the data.
			Dispatch&lt;SOAPMessage&gt; dispatch = service.createDispatch(
					methodToBeCalled, SOAPMessage.class, Service.Mode.MESSAGE);

			return dispatch;
		} catch (Exception e) {
			throw new RuntimeException(&quot;Error calling web-service&quot;, e);
		}
	}
}
</pre>
<pre class="brush: java; title: ; notranslate">
package com.alesaudate.webservices;

import javax.xml.soap.SOAPMessage;
import javax.xml.ws.Provider;
import javax.xml.ws.ServiceMode;
import javax.xml.ws.WebServiceProvider;
import javax.xml.ws.Service.Mode;

@ServiceMode(Mode.MESSAGE)
@WebServiceProvider(portName=&quot;blogSOAP&quot;,
		serviceName=&quot;blogService&quot;,
		targetNamespace=&quot;http://alesaudate.com/webservices&quot;,
		wsdlLocation=&quot;WEB-INF/wsdl/blog.wsdl&quot;)
public class MySOAPProvider implements Provider&lt;SOAPMessage&gt;{


	public static final String ORIGINAL_WSDL = &quot;http://localhost/SampleService?wsdl&quot;;
	public static final String ORIGINAL_SERVICE = &quot;sampleService&quot;;
	public static final String ORIGINAL_PORT = &quot;samplePort&quot;;
	public static final String ORIGINAL_NAMESPACE = &quot;sampleNamespace&quot;;

	private SOAPProvider provider;
	
	public MySOAPProvider() {
		this.provider = new SOAPProvider();
	}


	//You may add any extra logic here.
	@Override
	public SOAPMessage invoke(SOAPMessage request) {
		Dispatch&lt;SOAPMessage&gt; dispatcher = provider.getDispatcher(ORIGINAL_WSDL, ORIGINAL_NAMESPACE , ORIGINAL_SERVICE,ORIGINAL_PORT);
		SOAPMessage response = dispatcher.invoke(request);
		return response;
	}

}

</pre>
<p>Just to remind the reader, I would like to mention that this technique has been shown <a href="http://alesaudate.com/2010/08/09/how-to-dynamically-select-a-certificate-alias-when-invoking-web-services/">here</a>. </p>
<p><strong><em>Conclusion</em></strong></p>
<p>I have shown here a design pattern that I call Services Mediator. Basically, it is the same that an Enterprise Service Bus does, but with the difference that it must be implemented in the same language that the application uses, providing, then, more control to the application programmer. So, at any time the services need some business logic, but does not necessarily need to use services to do so, the programmer may add this logic inside the services shell.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://alesaudate.wordpress.com/2010/11/03/patterns-of-system-integration-1-services-mediator/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">120</post-id>
		<media:content url="https://2.gravatar.com/avatar/b46daa95aceb7974043312f267ded48da93bf9f08a6b0fe8ec6c990084d5fe82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alesaudate</media:title>
		</media:content>

		<media:content url="https://alesaudate.wordpress.com/wp-content/uploads/2010/11/mediator-layer.png?w=300" medium="image">
			<media:title type="html">Mediator Layer</media:title>
		</media:content>
	</item>
		<item>
		<title>How to create a contract-first web service (or: how to create a web service that handles XML)</title>
		<link>https://alesaudate.wordpress.com/2010/08/31/how-to-create-a-web-service-contract-first-or-how-to-create-a-web-service-that-handles-xml/</link>
					<comments>https://alesaudate.wordpress.com/2010/08/31/how-to-create-a-web-service-contract-first-or-how-to-create-a-web-service-that-handles-xml/#comments</comments>
		
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Tue, 31 Aug 2010 02:50:34 +0000</pubDate>
				<category><![CDATA[Web Services]]></category>
		<category><![CDATA[JAX-WS]]></category>
		<category><![CDATA[quick post]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">http://alesaudate.com/?p=112</guid>

					<description><![CDATA[A quick post on how to develop a contract-first web service &#8230; <a href="https://alesaudate.wordpress.com/2010/08/31/how-to-create-a-web-service-contract-first-or-how-to-create-a-web-service-that-handles-xml/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Hello! Today, I´m gonna show you a sample on how to develop a contract-first web service in java. To do so, you are gonna need:</p>
<ul>
<li>An Apache Tomcat (or any Application Server that is compatible with JAX-WS)</li>
<li>A JAX-WS runtime (I used the RI, that I got from <a href="https://jax-ws.dev.java.net/ri-download.html">here</a> &#8211; most application servers already have)</li>
</ul>
<p>Now, as it is a contract-first web service, we need the contract. I used this one:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
&lt;wsdl:definitions xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; xmlns:tns=&quot;http://alesaudate.com/webservices&quot; xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; name=&quot;blog&quot; targetNamespace=&quot;http://alesaudate.com/webservices&quot;&gt;
  &lt;wsdl:types&gt;
    &lt;xsd:schema targetNamespace=&quot;http://alesaudate.com/webservices&quot;&gt;
      &lt;xsd:element name=&quot;operation&quot;&gt;
        &lt;xsd:complexType&gt;
          &lt;xsd:sequence&gt;
            &lt;xsd:element name=&quot;request&quot; type=&quot;xsd:string&quot;/&gt;
          &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
      &lt;xsd:element name=&quot;operationResponse&quot;&gt;
        &lt;xsd:complexType&gt;
          &lt;xsd:sequence&gt;
            &lt;xsd:element name=&quot;response&quot; type=&quot;xsd:string&quot;/&gt;
          &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
    &lt;/xsd:schema&gt;
  &lt;/wsdl:types&gt;
  &lt;wsdl:message name=&quot;operation&quot;&gt;
    &lt;wsdl:part element=&quot;tns:operation&quot; name=&quot;parameters&quot;/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name=&quot;operationResponse&quot;&gt;
    &lt;wsdl:part element=&quot;tns:operationResponse&quot; name=&quot;parameters&quot;/&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:portType name=&quot;blog&quot;&gt;
    &lt;wsdl:operation name=&quot;blogOperation&quot;&gt;
      &lt;wsdl:input message=&quot;tns:operation&quot;/&gt;
      &lt;wsdl:output message=&quot;tns:operationResponse&quot;/&gt;
    &lt;/wsdl:operation&gt;
  &lt;/wsdl:portType&gt;
  &lt;wsdl:binding name=&quot;mySOAPBinding&quot; type=&quot;tns:blog&quot;&gt;
    &lt;soap:binding style=&quot;document&quot; transport=&quot;http://schemas.xmlsoap.org/soap/http&quot;/&gt;
    &lt;wsdl:operation name=&quot;blogOperation&quot;&gt;
      &lt;soap:operation soapAction=&quot;http://alesaudate.com/webservices/SampleOperation&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;blogService&quot;&gt;
    &lt;wsdl:port binding=&quot;tns:mySOAPBinding&quot; name=&quot;blogSOAP&quot;&gt;
      &lt;soap:address location=&quot;http://localhost:8080/WebServices/provider&quot;/&gt;
    &lt;/wsdl:port&gt;
  &lt;/wsdl:service&gt;
&lt;/wsdl:definitions&gt;
</pre>
<p>Now, we must provide an implementation class (or, how I like to call, where the magic happens =P ). Here is my implementation:</p>
<pre class="brush: java; title: ; notranslate">
package com.alesaudate.webservices;

import javax.xml.soap.SOAPMessage;
import javax.xml.ws.Provider;
import javax.xml.ws.ServiceMode;
import javax.xml.ws.WebServiceProvider;
import javax.xml.ws.Service.Mode;

@ServiceMode(Mode.MESSAGE)
@WebServiceProvider(portName=&quot;blogSOAP&quot;, 
		serviceName=&quot;blogService&quot;,  
		targetNamespace=&quot;http://alesaudate.com/webservices&quot;, 
		wsdlLocation=&quot;WEB-INF/wsdl/blog.wsdl&quot;)
public class MySOAPProvider implements Provider&lt;SOAPMessage&gt;{

	@Override
	public SOAPMessage invoke(SOAPMessage request) {
		try {
			request.writeTo(System.out);
		} catch (Exception e) {
			e.printStackTrace();
		} 
		return request;
	}

}
</pre>
<p>Please note that this refers to a WEB-INF directory. So, as you may have guessed by now, it MUST run on a web project (.war). Other forms of java files, like .jar or .ear are unable to run this code.</p>
<p>Now, we must provide what I call &#8220;the glue&#8221;: files that provide the binding. For the RI implementation, we must provide a file called sun-jaxws.xml and place it under the WEB-INF directory. For our project, it has the following structure:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;endpoints
    xmlns=&quot;http://java.sun.com/xml/ns/jax-ws/ri/runtime&quot;
    version=&quot;2.0&quot;&gt;

    &lt;endpoint
        name=&quot;example&quot;
        implementation=&quot;com.alesaudate.webservices.MySOAPProvider&quot;
        wsdl=&quot;WEB-INF/wsdl/blog.wsdl&quot;
        service=&quot;{http://alesaudate.com/webservices}blogService&quot;
        port=&quot;{http://alesaudate.com/webservices}blogSOAP&quot;
        url-pattern=&quot;/provider&quot; /&gt;

&lt;/endpoints&gt;
</pre>
<p>We also need to insert the right entries into web.xml:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;listener&gt;
        &lt;listener-class&gt;com.sun.xml.ws.transport.http.servlet.WSServletContextListener&lt;/listener-class&gt;
    &lt;/listener&gt;
    &lt;servlet&gt;
        &lt;servlet-name&gt;provider&lt;/servlet-name&gt;
        &lt;servlet-class&gt;com.sun.xml.ws.transport.http.servlet.WSServlet&lt;/servlet-class&gt;
        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
        &lt;servlet-name&gt;provider&lt;/servlet-name&gt;
        &lt;url-pattern&gt;/provider&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
</pre>
<p>The URL pattern, here, is the address where our web service will answer requests and will provide it´s contract. </p>
<p>Having reached this point so far, we need to place JAX-WS lib´s on the common library directory under Tomcat (for application servers like JBoss, you may skip this step).</p>
<p>And that´s all! Accessing the address <a><a href="http://localhost:8080/WebServices/provider?wsdl" rel="nofollow">http://localhost:8080/WebServices/provider?wsdl</a></a> has shown me the WSDL that I quoted above, how about you?</p>
<p>You may check the code that I used here at the downloads section.</p>
<p>See ya!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://alesaudate.wordpress.com/2010/08/31/how-to-create-a-web-service-contract-first-or-how-to-create-a-web-service-that-handles-xml/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">112</post-id>
		<media:content url="https://2.gravatar.com/avatar/b46daa95aceb7974043312f267ded48da93bf9f08a6b0fe8ec6c990084d5fe82?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alesaudate</media:title>
		</media:content>
	</item>
	</channel>
</rss>
