<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bertrand Guiral : formateur et consultant</title>
	<atom:link href="http://bertrand.guiral.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://bertrand.guiral.info</link>
	<description>C'est l'imagination qui fait agir, pas la volonté</description>
	<lastBuildDate>Mon, 29 Dec 2008 11:10:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Architecture RESTFul</title>
		<link>http://bertrand.guiral.info/2008/12/29/architecture-restfull/</link>
		<comments>http://bertrand.guiral.info/2008/12/29/architecture-restfull/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 10:37:27 +0000</pubDate>
		<dc:creator>Guiral bertrand</dc:creator>
				<category><![CDATA[soa]]></category>
		<category><![CDATA[tutoriels]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ws]]></category>

		<guid isPermaLink="false">http://bertrand.guiral.info/2008/12/29/architecture-restfull/</guid>
		<description><![CDATA[REST: REpresentationnal State Transfer
Style d&#8217;architecture RESTful
REST se définit comme un style d&#8217;architecture pour des systèmes distribués.
Au centre de ces concepts, il y a la notion de ressources identifiées par un URI ( Universal Resource Identifier).
La ressource peut être mainipulée en utilisant une interface http standard, et des informations sont échangées en utilisant des representations de [...]]]></description>
			<content:encoded><![CDATA[<h1>REST: REpresentationnal State Transfer</h1>
<h2>Style d&#8217;architecture RESTful</h2>
<p>REST se définit comme un style d&#8217;architecture pour des systèmes distribués.</p>
<p>Au centre de ces concepts, il y a la notion de ressources identifiées par un URI ( Universal Resource Identifier).<br />
La ressource peut être mainipulée en utilisant une interface http standard, et des informations sont échangées en utilisant des representations de cette ressource.</p>
<p>Les RESTful Web Services sont construits en utilisant ce style d&#8217;architecture. Cette approche devient une alternative de plus en plus répandue à l&#8217;approche SOAP.</p>
<h2> Un bon exemple vaut mieux qu&#8217;un long discour </h2>
<p>Par exemple à la requête http GET:<br />
<br/></p>
<pre lang="xml" >
http://localhost:8080/bgREST/resources/formationReservations/1
</pre>
<p>On aura la réponse (Si l&#8217;on accepte les documents xml,mais si l&#8217;on accepte les documents json, on aura la même ressource au format json):<br />
<br/></p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span> version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;formationReservation</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://localhost:8080/bgREST/resources/formationReservations/1/&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;company<span style="font-weight: bold; color: black;">&gt;</span></span></span>SQLI<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/company<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dateFormation<span style="font-weight: bold; color: black;">&gt;</span></span></span>2008-12-14T00:00:00+01:00<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dateFormation<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;id<span style="font-weight: bold; color: black;">&gt;</span></span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/id<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Pierre<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;nbEleves<span style="font-weight: bold; color: black;">&gt;</span></span></span>2<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/nbEleves<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/formationReservation<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<h2> wadl : Web Application Description Language</h2>
<p>Le wadl permet de décrire un Web Service de style RESTful dans un fichier xml.<br />
<br/><br />
Ils sont similaires aux fichiers wsdl qui sont destinés à décrire les Web Services de type SOAP.<br />
<br/><br />
Les fichiers wadl sont en général générés automatiquement par les outils qui construisent les Web Services.<br />
<br/><br />
D&#8217;autres outils (wadl2java) permettent de générer du code dans un langage de programmation pour inter-réagir avec un Web Service.</p>
<p>Cette approche , qui tente de reproduire ce qui se fait dans le monde WS-* est critiquée : <a href="http://bitworking.org/news/193/Do-we-need-WADL"> http://bitworking.org/news/193/Do-we-need-WADL</a></p>
<p>Dans notre exemple, pour la requete:<br />
<br/></p>
<pre lang="xml" >
http://localhost:8080/bgREST/resources/application.wadl
</pre>
<p> Voilà le wadl: <br/></p>
<div class="geshi" style="overflow: auto; width: 560px; height: 300px; padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span> <span style="color: #000066;">standalone</span>=<span style="color: #ff0000;">&quot;yes&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;application</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://research.sun.com/wadl/2006/10&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;doc</span> <span style="color: #000066;">xmlns:jersey</span>=<span style="color: #ff0000;">&quot;http://jersey.dev.java.net/&quot;</span> <span style="color: #000066;">jersey:generatedBy</span>=<span style="color: #ff0000;">&quot;Jersey: 1.0 10/13/2008 12:27 PM&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;resources</span> <span style="color: #000066;">base</span>=<span style="color: #ff0000;">&quot;http://localhost:8080/bgREST/resources/&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;resource</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;/formationReservations/&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;method</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;GET&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;get&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;request<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;param</span> <span style="color: #000066;">xmlns:xs</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xs:int&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;query&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;start&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;param</span> <span style="color: #000066;">xmlns:xs</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xs:int&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;query&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;max&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;param</span> <span style="color: #000066;">xmlns:xs</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xs:int&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;query&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;expandLevel&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;param</span> <span style="color: #000066;">xmlns:xs</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;SELECT e FROM FormationReservation e&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xs:string&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;query&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;query&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/request<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;response<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;representation</span> <span style="color: #000066;">mediaType</span>=<span style="color: #ff0000;">&quot;application/xml&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;representation</span> <span style="color: #000066;">mediaType</span>=<span style="color: #ff0000;">&quot;application/json&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/response<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/method<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;method</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;POST&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;post&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;request<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;representation</span> <span style="color: #000066;">mediaType</span>=<span style="color: #ff0000;">&quot;application/xml&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;representation</span> <span style="color: #000066;">mediaType</span>=<span style="color: #ff0000;">&quot;application/json&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/request<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;response<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;representation</span> <span style="color: #000066;">mediaType</span>=<span style="color: #ff0000;">&quot;*/*&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/response<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/method<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;resource</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;{id}/&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;param</span> <span style="color: #000066;">xmlns:xs</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xs:long&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;template&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;id&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;method</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;GET&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;get&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;request<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;param</span> <span style="color: #000066;">xmlns:xs</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xs:int&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;query&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;expandLevel&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/request<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;response<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;representation</span> <span style="color: #000066;">mediaType</span>=<span style="color: #ff0000;">&quot;application/xml&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;representation</span> <span style="color: #000066;">mediaType</span>=<span style="color: #ff0000;">&quot;application/json&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/response<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/method<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;method</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;PUT&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;put&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;request<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;representation</span> <span style="color: #000066;">mediaType</span>=<span style="color: #ff0000;">&quot;application/xml&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;representation</span> <span style="color: #000066;">mediaType</span>=<span style="color: #ff0000;">&quot;application/json&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/request<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/method<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;method</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;DELETE&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;delete&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/resource<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/resource<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/resources<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/application<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<h2> Liste des ressources </h2>
<p>Pour la requête : <br/></p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">http://localhost:8080/bgREST/resources/formationReservations</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>On optient la liste des ressources :<br />
<br/></p>
<div class="geshi" style="overflow: auto; width: 560px; height: 300px; padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span> version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;formationReservations</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://localhost:8080/bgREST/resources/formationReservations/&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;formationReservation</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://localhost:8080/bgREST/resources/formationReservations/1/&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;company<span style="font-weight: bold; color: black;">&gt;</span></span></span>SQLI<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/company<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dateFormation<span style="font-weight: bold; color: black;">&gt;</span></span></span>2008-12-14T00:00:00+01:00<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dateFormation<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;id<span style="font-weight: bold; color: black;">&gt;</span></span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/id<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Pierre<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;nbEleves<span style="font-weight: bold; color: black;">&gt;</span></span></span>2<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/nbEleves<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/formationReservation<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;formationReservation</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://localhost:8080/bgREST/resources/formationReservations/2/&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;company<span style="font-weight: bold; color: black;">&gt;</span></span></span>ebay<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/company<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dateFormation<span style="font-weight: bold; color: black;">&gt;</span></span></span>2008-12-14T00:00:00+01:00<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dateFormation<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;id<span style="font-weight: bold; color: black;">&gt;</span></span></span>2<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/id<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Jacques<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;nbEleves<span style="font-weight: bold; color: black;">&gt;</span></span></span>4<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/nbEleves<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/formationReservation<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;formationReservation</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://localhost:8080/bgREST/resources/formationReservations/3/&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;company<span style="font-weight: bold; color: black;">&gt;</span></span></span>airbus<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/company<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dateFormation<span style="font-weight: bold; color: black;">&gt;</span></span></span>2008-12-14T00:00:00+01:00<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dateFormation<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;id<span style="font-weight: bold; color: black;">&gt;</span></span></span>3<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/id<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Paul<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;nbEleves<span style="font-weight: bold; color: black;">&gt;</span></span></span>1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/nbEleves<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/formationReservation<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/formationReservations<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<h2>REST et java </h2>
<p>La JSR 311 , JAX-RS a comme implementation jersey (Proposé par SUN)</p>
<h2>REST et netbeans</h2>
<p>Netbeans supporte un certain nombre de fonctionnalités permettant de très rapidement concevoir, déployer et tester des Web Services RESTful.</p>
<p>Voir: <a href="http://www.netbeans.org/kb/60/websvc/rest.html#Exercise_2">Simple Exemple à partir de netbeans </a></p>
]]></content:encoded>
			<wfw:commentRss>http://bertrand.guiral.info/2008/12/29/architecture-restfull/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Business Process Execution Language (BPEL): Ecrire un premier Web-Service  avec netbeans</title>
		<link>http://bertrand.guiral.info/2008/06/29/business-process-execution-language-bpel-ecrire-un-premier-web-service-avec-netbeans/</link>
		<comments>http://bertrand.guiral.info/2008/06/29/business-process-execution-language-bpel-ecrire-un-premier-web-service-avec-netbeans/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 11:06:56 +0000</pubDate>
		<dc:creator>Guiral bertrand</dc:creator>
				<category><![CDATA[soa]]></category>
		<category><![CDATA[tutoriels]]></category>
		<category><![CDATA[bpel]]></category>
		<category><![CDATA[ws]]></category>

		<guid isPermaLink="false">http://bertrand.guiral.info/?p=18</guid>
		<description><![CDATA[BPEL permet de manipuler des web-services (on dit composer ou orchestrer) et génère lui-même un web service, défini par un wsdl , qui lui même s&#8217;appuie sur des schéma (xsd).
Netbeans, le célèbre IDE gratuit de SUN permet de réaliser assez facilement une application, et de la déployer sur un serveur jbi Glassfish.
Nous allons essayer de [...]]]></description>
			<content:encoded><![CDATA[<p>BPEL permet de manipuler des web-services (on dit composer ou orchestrer) et génère lui-même un web service, défini par un wsdl , qui lui même s&#8217;appuie sur des schéma (xsd).</p>
<p>Netbeans, le célèbre IDE gratuit de SUN permet de réaliser assez facilement une application, et de la déployer sur un serveur jbi Glassfish.</p>
<p>Nous allons essayer de construire une application de type &quot;HelloWorld&quot;</p>
<p><br/><br />
Cela passe par les étapes suivantes:</p>
<ol>
<li>Créer un schéma xsd </li>
<li>Créer un wsdl </li>
<li>Créer un bpel </li>
<li>Déployer et tester </li>
</ol>
<p>Il est impossible d&#8217;écrire des fichiers aussi complexes à la main. Il faut un outil: netbeans.</p>
<p/>
<h2> Ecrire un xsd (un schema)</h2>
<ol>
<li>Créer un nouveau projet : new Project>SOA>BPEL Module</li>
<li>Créer un nouveau schema: ProcessFils>New>XML schema   donner un nom au fichier</li>
<li>Rajouter un type complexe (ie : contactDetails)</li>
<li>Dans la séquence de &laquo;&nbsp;contact&raquo;&nbsp;, rajouter des champs comme firstName, lastName, address, email &#8230; de type (existing type) String</li>
<li> Rajouter une deuxièmme type complexe (ie : contactTitre), de type String celui ci (pour changer!)
<li> Rajouter 2 &laquo;&nbsp;elements&raquo;&nbsp;, des types complexes que nous avons définis précédemment<br />
	<br/> Remarque: Vous pouvez définir des éléments de type &laquo;&nbsp;simple&raquo;&nbsp; (String par exemple) . Mais cela semble créer des problèmes &#8230;
	</li>
</ol>
<p/>
Voilà le xsd sous sa forme xml:<br />
<br/></p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:schema</span> <span style="color: #000066;">xmlns:xsd</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">targetNamespace</span>=<span style="color: #ff0000;">&quot;http://xml.netbeans.org/schema/mySchema&quot;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">xmlns:tns</span>=<span style="color: #ff0000;">&quot;http://xml.netbeans.org/schema/mySchema&quot;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">elementFormDefault</span>=<span style="color: #ff0000;">&quot;qualified&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:complexType</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ContactDetails&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:sequence<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;firstName&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:element<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;lastname&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:element<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:element<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;address&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:element<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:sequence<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:complexType<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;aContactDetails&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;tns:ContactDetails&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:element<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:complexType</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;ContactSimple&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:simpleContent<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:extension</span> <span style="color: #000066;">base</span>=<span style="color: #ff0000;">&quot;xsd:string&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:simpleContent<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:complexType<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:element</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;aContactSimple&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;tns:ContactSimple&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:element<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:schema<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p></<img src="http://bertrand.guiral.free.fr/jee/images/></p>
<h2> Ecrire un wsdl </h2>
<ol>
<li>ProcessFiles>new>wsdl document </li>
<li> Premier écran: Importer le schéma que nous venons de définir </li>
<li> next</li>
<li> définir les entrées et les sorties <br/> <img src="http://bertrand.guiral.free.fr/jee/images/images/netbeans_wsdl.jpg"/></li>
</ol>
<p>	Voila le wsdl sous sa forme xml:<br/></p>
<div class="geshi" style="overflow: auto; width: 560px; height: 300px; padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;definitions</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myWsdl&quot;</span> <span style="color: #000066;">targetNamespace</span>=<span style="color: #ff0000;">&quot;http://j2ee.netbeans.org/wsdl/myWsdl&quot;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/&quot;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">xmlns:wsdl</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/&quot;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">xmlns:xsd</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span style="color: #000066;">xmlns:tns</span>=<span style="color: #ff0000;">&quot;http://j2ee.netbeans.org/wsdl/myWsdl&quot;</span> <span style="color: #000066;">xmlns:ns</span>=<span style="color: #ff0000;">&quot;http://xml.netbeans.org/schema/mySchema&quot;</span> <span style="color: #000066;">xmlns:plnk</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wsbpel/2.0/plnktype&quot;</span> <span style="color: #000066;">xmlns:soap</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;types<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:schema</span> <span style="color: #000066;">targetNamespace</span>=<span style="color: #ff0000;">&quot;http://j2ee.netbeans.org/wsdl/myWsdl&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xsd:import</span> <span style="color: #000066;">namespace</span>=<span style="color: #ff0000;">&quot;http://xml.netbeans.org/schema/mySchema&quot;</span> <span style="color: #000066;">schemaLocation</span>=<span style="color: #ff0000;">&quot;mySchema.xsd&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xsd:schema<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/types<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;message</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myWsdlOperationRequest&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;part1&quot;</span> <span style="color: #000066;">element</span>=<span style="color: #ff0000;">&quot;ns:aContactDetails&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/message<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;message</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myWsdlOperationResponse&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;part</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;part1&quot;</span> <span style="color: #000066;">element</span>=<span style="color: #ff0000;">&quot;ns:aContactSimple&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/message<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;portType</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myWsdlPortType&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;operation</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myWsdlOperation&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;input1&quot;</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;tns:myWsdlOperationRequest&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;output</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;output1&quot;</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;tns:myWsdlOperationResponse&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/operation<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/portType<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;binding</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myWsdlBinding&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;tns:myWsdlPortType&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;soap:binding</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;document&quot;</span> <span style="color: #000066;">transport</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/soap/http&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;operation</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myWsdlOperation&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;soap:operation</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;input1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;soap:body</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">&quot;literal&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/input<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;output</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;output1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;soap:body</span> <span style="color: #000066;">use</span>=<span style="color: #ff0000;">&quot;literal&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/output<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/operation<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/binding<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;service</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myWsdlService&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;port</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myWsdlPort&quot;</span> <span style="color: #000066;">binding</span>=<span style="color: #ff0000;">&quot;tns:myWsdlBinding&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;soap:address</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;http://localhost:${HttpDefaultPort}/myWsdlService/myWsdlPort&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/port<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/service<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;plnk:partnerLinkType</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myWsdl&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- A partner link type is automatically generated when a new port type is added. Partner link types are used by BPEL processes.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">In a BPEL process, a partner link represents the interaction between the BPEL process and a partner service. Each partner link is associated with a partner link type.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">A partner link type characterizes the conversational relationship between two services. The partner link type can have one or two roles.--&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;plnk:role</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myWsdlPortTypeRole&quot;</span> <span style="color: #000066;">portType</span>=<span style="color: #ff0000;">&quot;tns:myWsdlPortType&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/plnk:partnerLinkType<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/definitions<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<h2> Créer un bpel </h2>
<ol>
<li>ProcessFiles>new>bpel </li>
<li>Dans la vue design, &laquo;&nbsp;Drag and drop&raquo;&nbsp; le fichier wsdl. Les positions où il peut se positionner sont sur les côtés</li>
<li>&laquo;&nbsp;Drag And Drop&raquo;&nbsp; l&#8217;élément &laquo;&nbsp;receive&raquo;&nbsp; de la palette vers le centre design . Parfois la palette est invisible! click droit au centre du design Add From Pallette> Web Service > Receive</li>
<li>Editer  l&#8217;élément receive, lui donner un nom (myReceive), L&#8217;associer à un &laquo;&nbsp;Partner link&raquo;&nbsp;,à une opération, créer une variable &laquo;&nbsp;input&raquo;&nbsp; </li>
<li>Mettre en place de la même manière l&#8217;élément &laquo;&nbsp;reply&raquo;&nbsp; sous l&#8217;élément &laquo;&nbsp;receive&raquo;&nbsp;. Définir une variable &laquo;&nbsp;output&raquo;&nbsp;</li>
<li>Mettre en place un élément assign. (entre les éléments receive et reply)</li>
<li> Sélectionner l&#8217;élément &laquo;&nbsp;assign&raquo;&nbsp; Choisir la vue &laquo;&nbsp;mapper&raquo;&nbsp;</li>
<li> Sélectionner la variable output (celle dans laquelle on veut assigner une valeur)<br />
		<br/> <img src="http://bertrand.guiral.free.fr/jee/images/images/netbeans_assign.jpg"/>
		</li>
</ol>
<p/>
<p>voilà le xml correpondant:</p>
<p/>
<div class="geshi" style="overflow: auto; width: 560px; height: 300px; padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;process</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myBpel&quot;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">targetNamespace</span>=<span style="color: #ff0000;">&quot;http://enterprise.netbeans.org/bpel/bg_test_005/myBpel&quot;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://docs.oasis-open.org/wsbpel/2.0/process/executable&quot;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">xmlns:xsd</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema&quot;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">xmlns:tns</span>=<span style="color: #ff0000;">&quot;http://enterprise.netbeans.org/bpel/bg_test_005/myBpel&quot;</span> xmlns:ns0=<span style="color: #ff0000;">&quot;http://j2ee.netbeans.org/wsdl/myWsdl&quot;</span> <span style="color: #000066;">xmlns:sxt</span>=<span style="color: #ff0000;">&quot;http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Trace&quot;</span> <span style="color: #000066;">xmlns:sxed</span>=<span style="color: #ff0000;">&quot;http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor&quot;</span> xmlns:ns1=<span style="color: #ff0000;">&quot;http://xml.netbeans.org/schema/mySchema&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;import</span> <span style="color: #000066;">namespace</span>=<span style="color: #ff0000;">&quot;http://j2ee.netbeans.org/wsdl/myWsdl&quot;</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;myWsdl.wsdl&quot;</span> <span style="color: #000066;">importType</span>=<span style="color: #ff0000;">&quot;http://schemas.xmlsoap.org/wsdl/&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;partnerLinks<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;partnerLink</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;PartnerLink1&quot;</span> <span style="color: #000066;">xmlns:tns</span>=<span style="color: #ff0000;">&quot;http://j2ee.netbeans.org/wsdl/myWsdl&quot;</span> <span style="color: #000066;">partnerLinkType</span>=<span style="color: #ff0000;">&quot;tns:myWsdl&quot;</span> <span style="color: #000066;">myRole</span>=<span style="color: #ff0000;">&quot;myWsdlPortTypeRole&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/partnerLinks<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;variables<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;variable</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;MyWsdlOperationOut&quot;</span> <span style="color: #000066;">xmlns:tns</span>=<span style="color: #ff0000;">&quot;http://j2ee.netbeans.org/wsdl/myWsdl&quot;</span> <span style="color: #000066;">messageType</span>=<span style="color: #ff0000;">&quot;tns:myWsdlOperationResponse&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;variable</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;MyWsdlOperationIn&quot;</span> <span style="color: #000066;">xmlns:tns</span>=<span style="color: #ff0000;">&quot;http://j2ee.netbeans.org/wsdl/myWsdl&quot;</span> <span style="color: #000066;">messageType</span>=<span style="color: #ff0000;">&quot;tns:myWsdlOperationRequest&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/variables<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;sequence</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Sequence2&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;sequence</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Sequence1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;sequence<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;receive</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Receive1&quot;</span> <span style="color: #000066;">createInstance</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000066;">partnerLink</span>=<span style="color: #ff0000;">&quot;PartnerLink1&quot;</span> <span style="color: #000066;">operation</span>=<span style="color: #ff0000;">&quot;myWsdlOperation&quot;</span> <span style="color: #000066;">portType</span>=<span style="color: #ff0000;">&quot;ns0:myWsdlPortType&quot;</span> <span style="color: #000066;">variable</span>=<span style="color: #ff0000;">&quot;MyWsdlOperationIn&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;assign</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Assign1&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;copy<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;from<span style="font-weight: bold; color: black;">&gt;</span></span></span>concat($MyWsdlOperationIn.part1/ns1:firstName, $MyWsdlOperationIn.part1/ns1:lastname, $MyWsdlOperationIn.part1/ns1:email, $MyWsdlOperationIn.part1/ns1:address)<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/from<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;to</span> <span style="color: #000066;">variable</span>=<span style="color: #ff0000;">&quot;MyWsdlOperationOut&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/copy<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/assign<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;reply</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;myReply&quot;</span> <span style="color: #000066;">partnerLink</span>=<span style="color: #ff0000;">&quot;PartnerLink1&quot;</span> <span style="color: #000066;">operation</span>=<span style="color: #ff0000;">&quot;myWsdlOperation&quot;</span> <span style="color: #000066;">portType</span>=<span style="color: #ff0000;">&quot;ns0:myWsdlPortType&quot;</span> <span style="color: #000066;">variable</span>=<span style="color: #ff0000;">&quot;MyWsdlOperationOut&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/sequence<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/sequence<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/sequence<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/process<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p/>
<img src="http://bertrand.guiral.free.fr/jee/images/images/netbeans_bpel.jpg"/></p>
<h2>Déployer et tester le projet sur le serveur </h2>
<p>Remarquez qu&#8217;un projet BPEL n&#8217;est pas directement déployable.<br />
<br/><br />
Il doit être rajouté en tant que module JBI dans un projet  &laquo;&nbsp;Application Composite&raquo;&nbsp; qui sera ensuite déployée.</p>
<p/>
Créer le projet &laquo;&nbsp;Application Composite&raquo;&nbsp; et rajouter les modules JBI:</p>
<ol>
<li> Depuis le menu principal : File > New Project</li>
<li> Sémectionner le mode &laquo;&nbsp;Composite Application&raquo;&nbsp;</li>
<li> Next</li>
<li> Rajouter un nom, &laquo;&nbsp;finish&raquo;&nbsp; </li>
<li> Ouvrir ce nouveau projet &laquo;&nbsp;Composite Application&raquo;&nbsp;. &laquo;&nbsp;Click Droit&raquo;&nbsp;. choisir &laquo;&nbsp;Add JBI Module&raquo;&nbsp; Sélectionner le jar du projet BPEL que vous voulez rajouter</li>
<li> Remarquez qu&#8217;un jar a été rajouté dans le module JBI</li>
<li>Sur le projet &laquo;&nbsp;Application Composite&raquo;&nbsp;, click droit, choisir &laquo;&nbsp;Deploy Project&raquo;&nbsp;</li>
<li> Dans le projet &laquo;&nbsp;Composite Application&raquo;&nbsp;/Test, click droit et choisir &laquo;&nbsp;new test&raquo;&nbsp;</li>
<li>Sur le test créé, click droit &laquo;&nbsp;run&raquo;&nbsp;</li>
</ol>
<h2> ressources </h2>
<p><a href="http://home.izforge.com/index.php/2007/01/09/314-the-other-netbeans-bpel-tutorial"> the other netbeans bpel tutorial</a><br />
<br/><br />
<a href="http://www.netbeans.org/kb/55/helloworldca.html">netbeans helloword application </a></p>
]]></content:encoded>
			<wfw:commentRss>http://bertrand.guiral.info/2008/06/29/business-process-execution-language-bpel-ecrire-un-premier-web-service-avec-netbeans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sercices Oriented Architecture: Les outils et ressources de base</title>
		<link>http://bertrand.guiral.info/2008/05/17/sercices-oriented-architecture-les-outils-et-ressources-de-base/</link>
		<comments>http://bertrand.guiral.info/2008/05/17/sercices-oriented-architecture-les-outils-et-ressources-de-base/#comments</comments>
		<pubDate>Sat, 17 May 2008 15:03:11 +0000</pubDate>
		<dc:creator>Guiral bertrand</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[sca]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[tutoriels]]></category>
		<category><![CDATA[ws]]></category>

		<guid isPermaLink="false">http://bertrand.guiral.info/?p=16</guid>
		<description><![CDATA[Les outils:
Deux éditeurs sont incontournables: Netbeans et Eclipse.
Netbeans propose des editeurs bpel , xsd et wsdl assez intuitifs. Il est particulièrement adapté à glassfish pour tester des applications jbi.
De la même manière, Eclipse propose de nombreux plugins permettant de développer des applications bpel et bpmn. La démarche serait plutot top down: Je commence par écrire [...]]]></description>
			<content:encoded><![CDATA[<p>Les outils:</p>
<p>Deux éditeurs sont incontournables: Netbeans et Eclipse.<br />
Netbeans propose des editeurs bpel , xsd et wsdl assez intuitifs. Il est particulièrement adapté à glassfish pour tester des applications jbi.</p>
<p>De la même manière, Eclipse propose de nombreux plugins permettant de développer des applications bpel et bpmn. La démarche serait plutot top down: Je commence par écrire un fichier bpmn ( Des spécifications uniquement business) et j&#8217;arrive à générer un fichier bpel (Un langage d&#8217;execution). Eclipse est plustot destiné à générer des applications jbi pour servicemix.<br />
Il existe une version d&#8217;eclipse comportant tous les plugins: spagic.</p>
<p>Pour ceux qui veulent apprendre à manipuler BPEL, je conseille netbeans.</p>
]]></content:encoded>
			<wfw:commentRss>http://bertrand.guiral.info/2008/05/17/sercices-oriented-architecture-les-outils-et-ressources-de-base/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JBI : Un exemple avec ServiceMix</title>
		<link>http://bertrand.guiral.info/2008/05/15/jbi-un-exemple-avec-servicemix/</link>
		<comments>http://bertrand.guiral.info/2008/05/15/jbi-un-exemple-avec-servicemix/#comments</comments>
		<pubDate>Thu, 15 May 2008 17:45:37 +0000</pubDate>
		<dc:creator>Guiral bertrand</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[tutoriels]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[sca]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://bertrand.guiral.info/?p=15</guid>
		<description><![CDATA[Ce tutorial accompagne la création d&#8217;une première application:
Il s&#8217;agit de surveiller un répertoire, et lorsqu&#8217;un fichier xml apparaît dans ce répertoire, le déplacer vers un autre répertoire, et envoyer le contenu dans une queue JMS et d&#8217;en archiver une copie.
JBI Components
Les JBI Components (Binding Components et &#171;&#160;Service Engine&#187;&#160;) sont des plug-ins qui rajoutent des fonctionnalités [...]]]></description>
			<content:encoded><![CDATA[<p>Ce tutorial accompagne la création d&#8217;une première application:<br />
Il s&#8217;agit de surveiller un répertoire, et lorsqu&#8217;un fichier xml apparaît dans ce répertoire, le déplacer vers un autre répertoire, et envoyer le contenu dans une queue JMS et d&#8217;en archiver une copie.</p>
<h2>JBI Components</h2>
<p>Les JBI Components (Binding Components et &laquo;&nbsp;Service Engine&raquo;&nbsp;) sont des plug-ins qui rajoutent des fonctionnalités au &laquo;&nbsp;JBI Container&raquo;&nbsp;.</p>
<p> </p>
<p>Vous pouvez installer un &laquo;&nbsp;JBI Component&raquo;&nbsp; en le copiant dans le répertoire &laquo;&nbsp;hotdeploy&raquo;&nbsp;.</p>
<p> </p>
<p>Un &laquo;&nbsp;JBI Component&raquo;&nbsp; se compose d&#8217;un fichier zip, appelé aussi &laquo;&nbsp;Service Assembly&raquo;&nbsp; ou SA.<br />
Un SA se compose:</p>
<ul>
<li>D&#8217;un fichier META-INF/jbi.xml</li>
<li>De plusieurs fichier zip appelés SU (Service Unit) . Chaque SU contient au moins un fichier xbean.xml</li>
</ul>
<p>Il est possible de regarder les Components déployés avec une console jmx (jconsole), d&#8217;arrêter ou de démarrer les SA.</p>
<h2>Créer un SA (Service Assembly)</h2>
<h3>Créer un projet</h3>
<p>Recopier ce pom.xml dans un directory vide.<br />
 </p>
<p><!--l version="1.0" encoding="utf-8-->4.0.0 bg.servicemix parent 1.0-SNAPSHOT pom Tutorial http://servicemix.org</p>
<p>Exécuter la commande:</p>
<p>mvn install</p>
<p>Cela valide le fait que mvn est installé, et que le fichier pom.xml est correct.</p>
<p> </p>
<p>ServiceMix fournit plusieurs achetypes Maven pour faciliter la créattion de projets.</p>
<h3>Créer un projet SU (Service Unit) avec Maven et l&#8217;archetype &laquo;&nbsp;servicemix-service-unit&raquo;&nbsp;</h3>
<p>Nous commencerons par utiliser l&#8217;archétype permettant de créer des SU (Service Unit)</p>
<p>Depuis le directory que nous avons créé, la commande suivante créera un &laquo;&nbsp;service unit&raquo;&nbsp; projet appelé &laquo;&nbsp;tutorial-file-su&raquo;&nbsp;:</p>
<p>mvn archetype:create -DarchetypeArtifactId=servicemix-service-unit -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeVersion=3.2.1 -DartifactId=tutorial-file-su</p>
<p>Mettre la version correspondant à la version de serviceMix.</p>
<p> </p>
<p>Nous remarqons que le premier fichier pom.xml que nous avions écrit a été modifié, et qu&#8217;un nouveau répertoire a été créé, contenant un pom.xml.</p>
<p>Rajouter une dépendance pour un &laquo;&nbsp;component&raquo;&nbsp; JBI</p>
<p>Chaque SU (Service Unit) est detiné à être un &laquo;&nbsp;component&raquo;&nbsp; JBI. Nous spécifions cela dans le pom.xml , en rajoutant une dépendance au pom.xml.</p>
<p>L&#8217;outillage maven de servicemix fera le reste.</p>
<p>Le component &laquo;&nbsp;servicemix-file&raquo;&nbsp; fournit l&#8217;integration du JBI aux fichiers. Il peut être utilisé pour lire et écrire des fichiers, ou surveiller (poll) un répertoire.Il est décrit <a href="http://servicemix.apache.org/servicemix-file.html">ici</a></p>
<p>org.apache.servicemix servicemix-file ${servicemix-version}</p>
<h3>Configurer le xbean.xml</h3>
<p> </p>
<p>Ensuite, nous aurons à configurer notre nouveau SU pour fournir réellement un service.<br />
Nous faisons cela en créant un fichier appelé xbean.xml dans le répertoire src/main/resources</p>
<p> </p>
<p>L&#8217;exemple définit 2 namespaces: Le prefixe &laquo;&nbsp;file&raquo;&nbsp; fait référence à un namespace pour adresser les fonctionnalités standard, tandis que le prefixe &laquo;&nbsp;tut&raquo;&nbsp; sera utilisé pour le namespace dans lequel notre service sera défini.</p>
<p> </p>
<p><!-- add the sender endpoint here --><!-- add the poller endpoint here --> </p>
<p>Définition d&#8217;un &laquo;&nbsp;file sender endpoint&raquo;&nbsp;</p>
<p> </p>
<p>Un &laquo;&nbsp;file sender&raquo;&nbsp; peut être utiliser pour écrire des fichiers localement.<br />
Voilà un exemple de &laquo;&nbsp;file sender&raquo;&nbsp;:</p>
<p> </p>
<p>Remarquez les 2 attributs service (Qui font référence à l&#8217;ensemble du SU) et endpoint (Qui fait référence au sein du service , à cet interface file:sender).</p>
<p> </p>
<p>Définition d&#8217;un &laquo;&nbsp;file poller endpoint&raquo;&nbsp;</p>
<p> </p>
<p>Nous allons lire les fichiers XML dans un répertoire (spécifié par l&#8217;attribut &laquo;&nbsp;file&raquo;&nbsp;, aussi veillez a ce que ce directory existe sur votre système )</p>
<p>La ligne XML ci-dessous est destinée à configurer un &laquo;&nbsp;poller&raquo;&nbsp;, qui vérifiera la presence d&#8217;un nouveau fichier toutes les n secondes. Ce fichier sera envoyé au &laquo;&nbsp;file sender&raquo;&nbsp; endpoint spécifié par les attributs &laquo;&nbsp;targetService&raquo;&nbsp; et &laquo;&nbsp;targetEndpoint&raquo;&nbsp;.</p>
<p> </p>
<p>Le poller appartient au même service que le &laquo;&nbsp;sender&raquo;&nbsp;; mais à un autre endpoint.Il a 2 attributs targetService et targetEndpoint qui désignent vers quelle appli seront envoyée les fichiers (Dans notre exemple,c&#8217;est le même service).</p>
<p> </p>
<p>En résumé:</p>
<p>Vous spécifiez le component cible pour un SU comme une dépendance dans Maven (&raquo;&nbsp;dependancy&raquo;&nbsp; dans le pom.xml).</p>
<p>Dans ServiceMix, la pluspart des SU seront configurés par des fichiers xbean.xml</p>
<p> </p>
<h3>Créer le SA (&raquo;&nbsp;Service Assembly&raquo;&nbsp;) avec Maven et l&#8217;archetype &laquo;&nbsp;servicemix-service-assembly&raquo;&nbsp;</h3>
<p> </p>
<p>De la même manière que nous avons créer notre SU avec un archetype Maven, nous allons créer notre projet SA .</p>
<p>Exécuter cette commande :</p>
<p>mvn archetype:create -DarchetypeArtifactId=servicemix-service-assembly -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeVersion=3.2.1 -DartifactId=tutorial-sa</p>
<p>Un nouveau projet a été généré</p>
<p> </p>
<p>Ajouté le SU dans le SA</p>
<p> </p>
<p>Nous voulons ajouter le SU que nous avons créé au SA. L&#8217;outil Maven le fera automatiquement si nous mettons une dépendance dans le pom.xml du SA.<br />
Nous avons à utiliser le groupId, l&#8217;artifactId et la version du SU ici:</p>
<p>xxx org.apache.servicemix.tutorial tutorial-file-su 1.0-SNAPSHOT xxxx</p>
<p>Utilisons Maven pour construire l&#8217;ensemble:</p>
<p>mvn install</p>
<h3>Déployer le SA</h3>
<p>Avant de commencer, assurez vous que ServiceMix est démarré.</p>
<p>Maintenant , naviguez dans le directory de votre SA, et utiliser le plugin JBI &laquo;&nbsp;Maven&raquo;&nbsp; pour déployer votre projet:</p>
<p>cd tutorial-sa mvn jbi:projectDeploy</p>
<h3>Tester le SA</h3>
<p> </p>
<p>Nous avons configurer notre SU &laquo;&nbsp;file&raquo;&nbsp; pour surveiller la presence de fichiers dans un directory, et les envoyer à un autre répertoire.<br />
Copier juste un fichier xml dans le répertoire surveillé, et ServiceMix le déplacera après quelques secondes vers le &laquo;&nbsp;endpoint&raquo;&nbsp;</p>
<p> </p>
<h3>Rajouter 2 SU</h3>
<p>A la place de simplement copier des fichiers depuis un directory vers un autre, nous allons maintenant envoyer un message vers une queue JMS. Nous voulons aussi archiver une copie du message en utilisant le pattern &laquo;&nbsp;wiretap&raquo;&nbsp;.</p>
<p> </p>
<p>En premier, nous avons à créer 2 projets supplémentaires pour nos 2 SU.<br />
A la place d&#8217;utiliser le simple archetype &laquo;&nbsp;servicemix-service-unit&raquo;&nbsp; comme precedemment,nous allons utilser 2 nouveaux archetypes:</p>
<ul>
<li>&laquo;&nbsp;servicemix-eip-service-unit&raquo;&nbsp; pour créer le module &laquo;&nbsp;tutorial-eip-su&raquo;&nbsp;</li>
<li>&laquo;&nbsp;servicemix-jms-provider-service-unit&raquo;&nbsp; pour créer le module &laquo;&nbsp;tutorial-jms-su&raquo;&nbsp;</li>
</ul>
<p> </p>
<p>Nous connaissons la syntaxe:<br />
mvn archetype:create -DarchetypeArtifactId=XX -DarchetypeGroupId=org.apache.servicemix.tooling -DartifactId=YY</p>
<p>mvn archetype:create -DarchetypeArtifactId=servicemix-eip-service-unit -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeVersion=3.2.1 -DartifactId=tutorial-eip-su mvn archetype:create -DarchetypeArtifactId=servicemix-jms-provider-service-unit -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeVersion=3.2.1 -DartifactId=tutorial-jms-su</p>
<p>Ces archetypes sont un peu plus sophistiqué :<br />
Ils ajoutent les &lt; dependency &gt; pour les components JBI qu&#8217;ils ciblent. Ils fournissent un xbean.xml pour démarrer.</p>
<p>Après cela, ajouter ces 2 nouveaux SU au SA en rajoutant les &lt; dependency &gt; au pom.xml du SA.</p>
<p> </p>
<p>La documentation de serviceMix décrit comment utiliser jms : <a href="http://servicemix.apache.org/servicemix-jms.html">servicemix-jms</a>.</p>
<p> </p>
<p>Modifier le fichier xbean.xml de tutorial-jms-su, afin d&#8217;accéder à une queue appelée &laquo;&nbsp;queue/tutorial&raquo;&nbsp; sur ActiveMQ (qui est embarqué dans ServiceMix).</p>
<p> </p>
<p> </p>
<p> </p>
<p>Configurer le &laquo;&nbsp;tutorial-eip-su&raquo;&nbsp;</p>
<p> </p>
<p>Le &laquo;&nbsp;Servicemix-eip component&raquo;&nbsp; est un container &laquo;&nbsp;routeur&raquo;&nbsp; où plusieurs types de routage peuvent être déployés en tant que SU.</p>
<p> </p>
<p>Modifier le fichier xbean.xml de &laquo;&nbsp;tutorial-eip-su&raquo;&nbsp; pour définir le &laquo;&nbsp;wiretap&raquo;&nbsp; que nous voulons.</p>
<p>Les différents pattern sont définis dans la doc de ServiceMix-eip <a href="http://servicemix.apache.org/servicemix-eip.html#servicemix-eip-ContentBasedrouter"></a><br />
voici le shema du &laquo;&nbsp;wire-tap&raquo;&nbsp; pattern:<br />
<img src="http://bertrand.guiral.free.fr/jee/images/soa-jbi-1.gif" alt="wire-tap" /></p>
<p> </p>
<p> </p>
<p><!--l version="1.0" encoding="UTF-8--> </p>
<p> </p>
<p>Nous voulons envoyer les messages au &laquo;&nbsp;jms endpoint&raquo;&nbsp;, aussi, nous spécifions cette information au premier &lt; eip:exchange-target/ &gt;</p>
<p>Le deuxième fait référence au endpoint &lt; file:sender /&gt; que nous avons déclaré plus tôt.</p>
<p> </p>
<p>Modifier la configuration de tutorial-file-su</p>
<p> </p>
<p>Nous avons à modifier le &laquo;&nbsp;targetService&raquo;&nbsp; du endpoint &lt; file:poller &gt; pour réferrer à notre nouvellement créé &laquo;&nbsp;wiretap&raquo;&nbsp;.<br />
Cela pourrait être comme cela:</p>
<p> </p>
<p> </p>
<p>Construire et deployer</p>
<p> </p>
<p>Quand tout est fait, vous étes prèt pour construire et deployer le SA.<br />
Lors du build, les logs devraient ressembler à cela:</p>
<p>[INFO] Scanning for projects&#8230; [INFO] Reactor build order: [INFO] Tutorial [INFO] Tutorial :: File SU [INFO] Tutorial :: JMS SU [INFO] Tutorial :: EIP SU [INFO] Tutorial :: SA &#8230; [INFO] &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; [INFO] BUILD SUCCESSFUL [INFO] &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8230;</p>
<p>Test</p>
<p> </p>
<p>Si vous copiez un fichier dans le directory surveillé par le &laquo;&nbsp;poller&raquo;&nbsp;, il sera copié dans le directory &laquo;&nbsp;sender&raquo;&nbsp;, comme avant.</p>
<p>Cependant, il devrait aussi y avoir une copie du message dans notre queue JMS.</p>
<p>Pour le controller, connectez vous à ServiceMix avec la console JMX et naviguez vers org.apache.activemq/localhost/Queues.</p>
<p>Une queue devrait avoir été créée avec le nom &laquo;&nbsp;queue/tutorial&raquo;&nbsp; et l&#8217;attribut &laquo;&nbsp;EnqueueCount&raquo;&nbsp; indique le nombre de messages qui ont déjà été envoyés.</p>
]]></content:encoded>
			<wfw:commentRss>http://bertrand.guiral.info/2008/05/15/jbi-un-exemple-avec-servicemix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JBI  &#8211; Java Business Integration: C&#8217;est quoi ?</title>
		<link>http://bertrand.guiral.info/2008/05/15/jbi-java-business-integration/</link>
		<comments>http://bertrand.guiral.info/2008/05/15/jbi-java-business-integration/#comments</comments>
		<pubDate>Thu, 15 May 2008 17:01:29 +0000</pubDate>
		<dc:creator>Guiral bertrand</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[sca]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[Entreprise Service Bus]]></category>

		<guid isPermaLink="false">http://bertrand.guiral.info/?p=14</guid>
		<description><![CDATA[JBI est un standard java (JSR 208) qui définit une architecture pour permettre l&#8217;interoperabilité d&#8217;applications avec un système d&#8217;échanges de messages.
Les messages entre les &#171;&#160;components&#187;&#160; sont échangés à travers un &#171;&#160;Normalized Message Router&#187;&#160; (NMR). Le NMR sert de &#171;&#160;Message Exchange Pattern&#187;&#160; (MEP). Le NMR sert d&#8217;intermédiare pour échanger des messages, quelquesoit l&#8217;endroit où est le [...]]]></description>
			<content:encoded><![CDATA[<p>JBI est un standard java (JSR 208) qui définit une architecture pour permettre l&#8217;interoperabilité d&#8217;applications avec un système d&#8217;échanges de messages.<br />
Les messages entre les &laquo;&nbsp;components&raquo;&nbsp; sont échangés à travers un &laquo;&nbsp;Normalized Message Router&raquo;&nbsp; (NMR). Le NMR sert de &laquo;&nbsp;Message Exchange Pattern&raquo;&nbsp; (MEP). Le NMR sert d&#8217;intermédiare pour échanger des messages, quelquesoit l&#8217;endroit où est le &laquo;&nbsp;Component&raquo;&nbsp;. Les plugins ne communiquent pas directement les uns avec les autres: Ils communiquent exclusivement vers le NMR.</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/soa-jbi-2.gif" alt="jbi" /></p>
<h2>JBI Components</h2>
<p>Les &laquo;&nbsp;plugins&raquo;&nbsp; mentionné ci-dessus sont quelquefois appelé &laquo;&nbsp;JBI components&raquo;&nbsp;.</p>
<h2>&laquo;&nbsp;Binding Components&raquo;&nbsp;</h2>
<p>Un &laquo;&nbsp;binding component&raquo;&nbsp; (BC) a 2 buts:</p>
<ul>
<li>Communiquer en utilisant un protocole distant.</li>
<li>Normaliser les messages reçus</li>
</ul>
<p>Les BC sont utilisés pour communiquer en dehors l&#8217;environnement JBI.</p>
<p>Exemples de protocoles fournis par les BC: http, jms,ftp,smtp,xmpp,rmi,corba,xmpp</p>
<h2>JBI Components</h2>
<p>Les JBI Components (Binding Components et &laquo;&nbsp;Service Engine&raquo;&nbsp;) sont des plug-ins qui rajoutent des fonctionnalités au &laquo;&nbsp;JBI Container&raquo;&nbsp;.</p>
<p> </p>
<p> </p>
<h2>Vocabulaire</h2>
<ul>
<li>Java Business Integration (JBI) : C&#8217;est le nom d&#8217;une JSR (Java Spécification)</li>
<li>Entreprise Service Bus (ESB) : C&#8217;est la même chose qu&#8217;un JBI, mais pas forcemment normalisé.</li>
<li>Component Les composants proposent des services accessibles par l&#8217;intermédiaire d&#8217;interfaces. Ce sont les parties enfichables dans le framework JBI. Il se divisent en deux sous-familles:Service Engine (SE) et Binding Component (BC)</li>
<li>Service Engine (SE) :Les SE fournissent la logique métier et les transformations (XSLT, &#8230;). Il peuvent consommer eux-même d&#8217;autres SE.</li>
<li>Binding Component (BC) : Les BC fournissent la connectivité, qu&#8217;il s&#8217;agisse de protocoles (FTP, HTTP,&#8230;), de piles (SOAP, JMS, &#8230;) ou de services externes au conteneur JBI. Ils permettent l&#8217;accès de depuis l&#8217;extérieur au services d&#8217;une application JBI.</li>
<li>Rôles : Les composants peuvent avoir les rôles suivants : Consumer (Le composant utilise un service ) et Provider (Le composant fournit un service ) Chaque composant peut être à la fois consumer et provider.</li>
<li>EndPoint :Les services proposés par les composants sont accessibles via des endpoints. Un service correspond à un endpoint.</li>
<li>Normalized Message Router (NMR) :Le Normalized Message Router reçoit et envoi des messages de la part de composants. Il est responsable du routage des messages. Les messages sont tous dans un format normalisé</li>
<li>Normalized Message :Les Normalized Messages sont les messages echangés par une application JBI. Ce sont des documents XML formé <img src='http://bertrand.guiral.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> u contexte du message ( Il inclut des informations tels que le protocole de communication, des informations spécifiques à d&#8217;autres composants &#8230; )et du contenu du message (Toutes les données)</li>
<li>Delivery Channel :Les composants se « connectent » sur le NMR grâce au delivery channel. C&#8217;est une voie de communication bidirectionnelle leur permettant d&#8217;envoyer et de recevoir les messages</li>
<li>Service Unit (SU) :Chaque composants à déployer est défini dans un SU. Celui contient toutes les informations relatives au composants (fiche de transformation Xslt&#8230; ) et obligatoirement un descripteur qui se trouve dans un dossier META-INF à la raçine de l&#8217;archive.</li>
<li>Service Assembly (SA) :Les composants qui doivent interagir ensemble sont rassemblé dans un SA. Celui-ci contient obligatoirement un descripteur où se trouvent toutes les informations relatives aux SUs à deployer, ainsi que les archives de ces Sus.</li>
</ul>
<p> </p>
<p>Dans notre prochain tutorial, nous implementeront une application sur ServiceMix</p>
]]></content:encoded>
			<wfw:commentRss>http://bertrand.guiral.info/2008/05/15/jbi-java-business-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wsdl &#8211; Web Services Description Language</title>
		<link>http://bertrand.guiral.info/2008/05/10/wsdl-web-services-description-language/</link>
		<comments>http://bertrand.guiral.info/2008/05/10/wsdl-web-services-description-language/#comments</comments>
		<pubDate>Sat, 10 May 2008 17:23:53 +0000</pubDate>
		<dc:creator>Guiral bertrand</dc:creator>
				<category><![CDATA[sca]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[tutoriels]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[outils]]></category>
		<category><![CDATA[web-service]]></category>
		<category><![CDATA[ws]]></category>

		<guid isPermaLink="false">http://bertrand.guiral.info/?p=12</guid>
		<description><![CDATA[WSDL (Web Services Description Language) est un langage xml pour décrire les Web-Services et comment y accéder.

 Structure d&#8217;un wsdl 
Un wsdl décrit un Web-Service avec ces principales bailises:

La structure principale d&#8217;un wsdl ressemble à cela (liste non exhaustive):
&#160;
&#60;definitions&#62;
&#60;types&#62;
&#160; &#160;definition des types........
&#60;/types&#62;
&#160;
&#60;message&#62;
&#160; &#160;definition des messages ....
&#60;/message&#62;
&#60;portType&#62;
&#160; &#160;definition des ports (opérations et messages).......
&#60;/portType&#62;
&#160;
&#60;binding&#62;
&#160; &#160;Les protocoles de [...]]]></description>
			<content:encoded><![CDATA[<p>WSDL (Web Services Description Language) est un langage xml pour décrire les Web-Services et comment y accéder.</p>
<p/>
<h2> Structure d&#8217;un wsdl </h2>
<p>Un wsdl décrit un Web-Service avec ces principales bailises:</p>
<p/>
La structure principale d&#8217;un wsdl ressemble à cela (liste non exhaustive):</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;definitions<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;types<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;definition des types........</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/types<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;message<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;definition des messages ....</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/message<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;portType<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;definition des ports (opérations et messages).......</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/portType<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;binding<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;Les protocoles de communication utilisés par le web-service</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/binding<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;service<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;Une adresse physique où accéder au service.</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/service<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/definitions<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p/>
</hr>
<h3>WSDL &laquo;&nbsp;portType&raquo;&nbsp;</h3>
<p>L&#8217;élément < portType > est l&#8217;élément le plus important</p>
<p/>
Il décrit un web-service , les opérations qui peuvent être accomplies, et les messages échangés.</p>
<p/>
L&#8217;élément < portType > peut être comparé à une fonction d&#8217;une librairie dans un langage traditionnel.</p>
<h3>Messages WSDL </h3>
<p>L&#8217;élément < message > définit les données d&#8217;une opération.</p>
<p/>
Chaque message peut être formé d&#8217;une ou plusieurs partie. Les parties peuvent être comparés aux paramètres d&#8217;une fonction dans un langage de programmation traditionnel.</p>
<h2>Operation Types</h2>
<p>Les type de &laquo;&nbsp;Request-response&raquo;&nbsp; est l&#8217;opération la plus courrante. Mais wsdl définit d&#8217;autres types d&#8217;opération (&raquo;&nbsp;One-way&raquo;&nbsp;, &laquo;&nbsp;Solicit-response&raquo;&nbsp;,&raquo;&nbsp;Notification&raquo;&nbsp;)</p>
<h2> Outil / editeur </h2>
<p>Il est quasiment impossible d&#8217;écrire un wsdl à la main.(Sans erreurs!)</p>
<p/>
J&#8217;utilise l&#8217;éditeur wsdl d&#8217;eclipse (voir le projet STP, ils proposent un plugin avec l&#8217;ensemble de leurs outils), qui est gratuit et qui marche bien.</p>
<p> Cet outil permet à la fois d&#8217;éditer un fichier wsdl, mais aussi, de comprendre sa structure et de quoi il est composé: C&#8217;est une bonne idée d&#8217;éditer un wsdl existant, et de le regarder avec cet outil.</p>
<p/>
<p><a href="http://bertrand.guiral.free.fr/jee/images/wsdl_1.jpg"><img src="http://bertrand.guiral.free.fr/jee/images/wsdl_1.jpg" alt="wsdl_1" width="629" height="365" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bertrand.guiral.info/2008/05/10/wsdl-web-services-description-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BPMN &#8211; Business Process Modeling Notation</title>
		<link>http://bertrand.guiral.info/2008/05/07/bpmn-business-process-modeling-notation/</link>
		<comments>http://bertrand.guiral.info/2008/05/07/bpmn-business-process-modeling-notation/#comments</comments>
		<pubDate>Wed, 07 May 2008 16:19:08 +0000</pubDate>
		<dc:creator>Guiral bertrand</dc:creator>
				<category><![CDATA[sca]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[tutoriels]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://bertrand.guiral.info/?p=11</guid>
		<description><![CDATA[BPMN &#8211; Business Process Modeling Notation &#8211; définit essentiellement les tâches métier et leurs relations en format xml (wikipedia).
Le plugin &#171;&#160;Eclipse STP Modeler&#187;&#160; permet de créer des fichiers BPMN.
Nous allons essayé de créer un projet avec ce plugin.
Voilà un exemple de représentation BPML d&#8217;un processus métier:
Figure 1. Model of a business process

Ce schéma montre un [...]]]></description>
			<content:encoded><![CDATA[<p>BPMN &#8211; Business Process Modeling Notation &#8211; définit essentiellement les tâches métier et leurs relations en format xml (<a href="http://fr.wikipedia.org/wiki/BPMN">wikipedia</a>).</p>
<p>Le plugin &laquo;&nbsp;Eclipse STP Modeler&raquo;&nbsp; permet de créer des fichiers BPMN.<br />
Nous allons essayé de créer un projet avec ce plugin.</p>
<p>Voilà un exemple de représentation BPML d&#8217;un processus métier:</p>
<p>Figure 1. Model of a business process</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bpmn_1.jpg" alt="" /></p>
<p>Ce schéma montre un unique flux horizontal d&#8217;un processus métier coupé en trois tranches et disposé verticalement dans l&#8217;ordre.<br />
Ce schéma a été créé en utilisant le &laquo;&nbsp;STP BMN modeler&raquo;&nbsp; d&#8217;éclipse, que vous utiliserez plus tard.</p>
<p>Vous pouvez voir où le processus démarre avec le cercle vide sur la gauche, et le flux progresse vers la droite en suivant les flèches et les arcs, et se termine (à la fin :=))!) avec un cercle vide à droite.</p>
<p>BPMN est simplement un format XML décrivant, dans notre exemple , le modèle de la figure 1.</p>
<p>Il contient des &laquo;&nbsp;vertices&raquo;&nbsp; (Pluriel de &laquo;&nbsp;Vertex&raquo;&nbsp;: intersection, noeud) qui correspondent à des noeuds et des &laquo;&nbsp;sequenceEdges&raquo;&nbsp; qui correspondent à de flèches et des arcs.</p>
<p>Regardons un exemple: (Listing 1)</p>
<p>Les &laquo;&nbsp;Vertices&raquo;&nbsp; sont essentiellement des noeuds ou des tâches, représentés graphiquement dans la figure 1 par des cercles, des losanges (Têtes de diamant) et des carrés.</p>
<p>Dans le Listing 1, vous pouvez voir qu&#8217;ils sont identifiés, aussi, comme une liste de &laquo;&nbsp;outgoingEdges&raquo;&nbsp; et de &laquo;&nbsp;incommingEdges&raquo;&nbsp;.</p>
<p>Des identifiant donne simplement un ID à chaque &laquo;&nbsp;Vertices&raquo;&nbsp; qui peut être référencé comme &laquo;&nbsp;source&raquo;&nbsp; ou &laquo;&nbsp;target&raquo;&nbsp; d&#8217;un &laquo;&nbsp;sequenceEdge&raquo;&nbsp; (Représenté dans la figure 1 par des flèches directionnelles allant de &laquo;&nbsp;Vertices&raquo;&nbsp; en &laquo;&nbsp;Vertices&raquo;&nbsp;).</p>
<p>L&#8217;information importante dans chaque &laquo;&nbsp;sequenceEdges&raquo;&nbsp; sont les attributs &laquo;&nbsp;source&raquo;&nbsp; et &laquo;&nbsp;target&raquo;&nbsp; qui spécifient les référence des &laquo;&nbsp;vertices&raquo;&nbsp; (noeuds) source et destination.</p>
<p>Remarquez que ce format de fichier n&#8217;est pas exécutable sur un moteur BPEL comme le moteur &laquo;&nbsp;ODE&raquo;&nbsp; d&#8217;apache. C&#8217;est uniquement la modélisation d&#8217;un processus métier.</p>
<p>Des outils existent pour transformer ces fichiers BPMN en modèle BPEL exécutable (Par exemple le projet ATL d&#8217;éclipse et un open source écrit par BABEL) .</p>
<h2>BPEL Business Process Execution Language</h2>
<p>BPEL est exécutable sur des moteurs comme ODE (Orchestration Director Engine) d&#8217;Apache.</p>
<p>LA différence entre BPEL et BPMN est que BPEL est plus structuré, étant par définition un langage d&#8217;exécution.</p>
<p>A la place de &laquo;&nbsp;Vertices&raquo;&nbsp; et de &laquo;&nbsp;SequenceEdges&raquo;&nbsp;, un fichier xml BPEL contient des séquences d&#8217;instruction qui incluent l&#8217;invocation de Web-Service, des opérations et des instructions comme des boucles &laquo;&nbsp;while&#8217; qui peuvent exécuter une séquence de code encore et encore si une condition reste &laquo;&nbsp;true&raquo;&nbsp;.<br />
(Voir le tag &#8230; après l&#8217;ouverture dans le listing 2) ou encore des instructions &laquo;&nbsp;if&raquo;&nbsp; et &laquo;&nbsp;else-if&raquo;&nbsp;</p>
<p>Dans la figure 1 (Coupe 2), il y a une instance où un arc va vers l&#8217;arrière.</p>
<p>C&#8217;est comme ça qu&#8217;est représenté une boucle &laquo;&nbsp;while&raquo;&nbsp; en BPMN.</p>
<p>Là , vous pouvez voir 2 &laquo;&nbsp;vertices&raquo;&nbsp; (noeuds) appelés while1 et while2 qui facilitent le branchement correct des processus.<br />
(while1 a deux entrées (incomingEdges) en 1 seule sortie et while2 prend une entrée et la divise en deux sorties)</p>
<p>La condition de la boucle &laquo;&nbsp;while&raquo;&nbsp; est définie par &laquo;&nbsp;while_ok&raquo;&nbsp;, et si il reste &laquo;&nbsp;true&raquo;&nbsp;, la tâche (&raquo;&nbsp;shippingEstimator task&raquo;&nbsp;) sera exécutée encore et encore.<br />
Quand cette même condition n&#8217;est plus vraie, l&#8217;exécution s&#8217;arrête et passe à la tâche de fin (&raquo;&nbsp;checkout task&raquo;&nbsp;).</p>
<p>Pour additionner, BPMN XML définit un modèle graphique de votre processus métier avec des noeuds et des graphes, et BPEL définit un modèle exécutable de votre processus métier avec des constructions exécutables comme des boucles &laquo;&nbsp;while&raquo;&nbsp;, des instructions &laquo;&nbsp;if&raquo;&nbsp; et des instructions qui appellent des opérations sur des Web-Services existants.</p>
<p>Le processus métier que vous allez modéliser est un simple flux permettant d&#8217;ajouter un jouet à une liste d&#8217;achat.</p>
<p>Les utilisateurs auront le choix d&#8217;utiliser un &laquo;&nbsp;shippingEstimator&raquo;&nbsp;(Voir la condition de la boucle while dans le listing 2), de confirmer, et de passer une commande qui pourra être rejetée ou acceptée.<br />
Le processus devra éventuellement envoyer une facture au client et rajouter la commande dans la queue des commandes à expédier.</p>
<p>Pour faire cela, vous aurez à installer l&#8217;outil de développement Eclipse, avant de vous plonger dans votre &laquo;&nbsp;processus métier&raquo;&nbsp;.</p>
<h2>Installation du projet STP (&raquo;&nbsp;SOA Tool Platform&raquo;&nbsp;) d&#8217;eclipse</h2>
<p>Le projet &laquo;&nbsp;SOA Tools Paltform&raquo;&nbsp; (STP) d&#8217;éclipse fournit des outils permettant la conception, la configuration, l&#8217;assemblage, le déploiement, la surveillance et la gestion de software conçu dans le cadre de SOA (Service Oriented Architecture).<br />
STP suit les spécifications du SCA (Component Architecture Specification) .</p>
<p>STP comprend donc plusieurs outils (Liste non exhaustive):</p>
<ul>
<li>STP SOA System :Outils pour l&#8217;assemblage, la construction et le deploiement de Services dans des &laquo;&nbsp;Container&raquo;&nbsp; . Avec en plus des moyens de gestion des &laquo;&nbsp;Policy&raquo;&nbsp; lors des déploiement.</li>
<li>STP BPEL 2 Java (B2J) Outil pour traduire BPEL en classes Java.</li>
<li>STP BPMN (BPMN) Outil pour éditer les diagrammes BPMN.</li>
<li>STP Policy Editor (POLICY) Editeur pour &laquo;&nbsp;WS-Policy&raquo;&nbsp; avec un éditeur graphique.</li>
<li>STP SCA (SCA) Editeur graphique pour un SCA composite.</li>
</ul>
<p>Il est possible de télécharger l&#8217;ensemble de ces outils à l&#8217;url :<br />
<a href="http://download.eclipse.org/stp/downloads/"><br />
http://download.eclipse.org/stp/downloads/</a></p>
<p>( J&#8217;ai essayé de mettre à jour par l&#8217;outil update d&#8217;éclipse, ça n&#8217;a pas marché, je conseille donc de télécharger le zip &laquo;&nbsp;All in one&raquo;&nbsp; de le dezipper dans le répertoire d&#8217;eclipse.)</p>
<h2>Section 4. Utiliser l&#8217;éditeur BPMN d&#8217;éclipse</h2>
<p>L&#8217;éditeur STP BPMN se veut simple à utiliser et intuitif.</p>
<p>D&#8217;abord, nous allons apprendre à créer un diagramme BPMN pour modéliser les visiteurs achetant des jouets sur votre site web.</p>
<p>Puis nous apprendrons quel types d&#8217;activités que nous aurons à employer dans ce modèle.</p>
<p>Et finalement, vous verrez comment modéliser vos processus métier en utilisant l&#8217;éditeur BPMN</p>
<h3>Votre premier diagramme BPMN</h3>
<p>C&#8217;est le moment de démarrer Eclipse. Comme l&#8217;éditeur BPMN n&#8217;est pas basé sur un type de projet, vous avez juste à créer un projet générique:</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_1.jpg" alt="Nouveau projet" /></p>
<p>Vous devriez maintenant voir le nouveau projet dans la fenêtre &laquo;&nbsp;Package Explorer&raquo;&nbsp; .</p>
<p>Sélectionnez le et créez un nouveau diagramme BPMN:</p>
<p>File &gt; New &gt; Other. Expand the SOA Tools folder and select Bpmn Diagram.</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_5.jpg" alt="figure 5 " /></p>
<p>Clickez sur &laquo;&nbsp;Finish&raquo;&nbsp; pour créer un diagramme BPMN. Votre projet devrait ressembler à la figure ci-dessous.<br />
Figure 6. La fenêtre Projet</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_6.jpg" alt="figure 6 " width="633" height="546" /></p>
<p>Excellent!</p>
<p>Maintenant, vous ètes prét à manipuler quelques types d&#8217;activités. Ces eléments sont affichés sur la palette de droite.</p>
<h4>Introduction des types d&#8217;activité</h4>
<p>Il y a plusieurs types d&#8217;activité que vous pouvez utiliser pour modéliser votre activité métier.<br />
Nous allons passé en revue 5 des types d&#8217;activité que vous allez utiliser.</p>
<p>&laquo;&nbsp;Empty Start&raquo;&nbsp; , sous &laquo;&nbsp;Start Events&raquo;&nbsp;</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_7.jpg" alt="figure 7 " /></p>
<p>Cette activité démarre le processus, le cercle vide sur la gauche de la Figure 1.</p>
<p>Apprenez à manipuler l&#8217;éditeur: Il faut sélectioner la tache, puis clicker au centre du diagramme.</p>
<p>La prochaine est une tâche, comme representée dessous:</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_8.jpg" alt="figure 8 " /></p>
<p>Les tâches (Task) sont des commandes comme invoquer un Web-Service.</p>
<p>Les deux suivantes sont une des &laquo;&nbsp;gateway&raquo;&nbsp; qui permettent à un processus de se diviser en 2 directions différentes, exclusivement ou en parallèles.</p>
<p>D&#8217;abord est la &laquo;&nbsp;exclusive data-based gateway&raquo;&nbsp;.</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_9.jpg" alt="figure 9 " /></p>
<p>Vous comprendrez comment ca marche plus tard. En bref, c&#8217;est utilisé pour branché le processus métier vers 2 chemins différents,un pour le cas où la commande est un echec, et l&#8217;autre si la commande a été un succes.</p>
<p>Maintenant regardon la &laquo;&nbsp;parallel gateway&raquo;&nbsp;.</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_10.jpg" alt="figure 10 " /></p>
<p>Vous pouvez utiliser ce &laquo;&nbsp;gateway&raquo;&nbsp; pour définir 2 tâches qui seront exécutées en parallèle, comme par exemple envoyé une facture au client et envoyé un ordre d&#8217;envoi au service des expéditions après une commande réussie.</p>
<p>La dernière activité à rajouter est la &laquo;&nbsp;Empty End Event&raquo;&nbsp;, un évènement qui termine le processus.</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_11.jpg" alt="figure 11 " /></p>
<p>Cela correspond au cercle vide sur la droite de la figure 1, terminant le processus.</p>
<h4>Créer le processus metier</h4>
<p>Maintenant il faut modéliser le processus métier.</p>
<p>Pour commencer , clicker sur le &laquo;&nbsp;Empty Start Activity&raquo;&nbsp;. Puis &laquo;&nbsp;double-click&raquo;&nbsp; et appelé cette activité &laquo;&nbsp;start&raquo;&nbsp; par exemple.</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_12.jpg" alt="figure 12 " /></p>
<p>Clicker sur l&#8217;activité de type &laquo;&nbsp;task&raquo;&nbsp;, la placer à la droite de cercle &laquo;&nbsp;start&raquo;&nbsp;, &laquo;&nbsp;double-click&raquo;&nbsp; et l&#8217;appelé &laquo;&nbsp;addToyToCart&raquo;&nbsp;.</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_13.jpg" alt="figure 13 " /></p>
<p>Maintenant, nous allons créer un nouvel arc depuis le cercle &laquo;&nbsp;start&raquo;&nbsp; jusqu&#8217;à la tâche &laquo;&nbsp;addToyToCart&raquo;&nbsp;.</p>
<p>Plcer le curseur sur la bordure droite du cercle &laquo;&nbsp;start&raquo;&nbsp; jusqu&#8217;à ce que 2 petites flèches apparaissent à sa droite.Clicker sur le petit carré à l&#8217;extrémité de la flèche pleine.<br />
L&#8217;étirer jusqu&#8217;à la tâche &laquo;&nbsp;addToyToCart&raquo;&nbsp; jusqu&#8217;à ce qu&#8217;une flèche sombre apparaisse à sa droite.</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_14.jpg" alt="figure 14 " /></p>
<p>Relacher la souris, et un nouveau lien devrait relier les 2 activités, comme ci-dessous:</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_15.jpg" alt="figure 15 " /></p>
<p>Bien, vous avez créé votre premier arc. Votre &laquo;&nbsp;business process&raquo;&nbsp; commence à prendre forme.</p>
<p><img src="http://bertrand.guiral.free.fr/jee/images/bp_16.jpg" alt="figure 16 " width="632" height="205" /></p>
<p>Avec l&#8217;aide de la figure 1, vous devez être capable de créer de nouvelles tâches.</p>
<p>Remarquez que vous pouvez donner un nom aux arcs, ce qui donne encore plus de clarté au shéma.</p>
<p>Une fois terminé, vous pouvez examiner le résultat en BPMN correspondant à votre diagramme en regardant le fichier .bpmn.</p>
<p>Vous pouvez voir les &laquo;&nbsp;vertices&raquo;&nbsp; et les &laquo;&nbsp;sequenceEdges&raquo;&nbsp; qui décrivent le &laquo;&nbsp;business process&raquo;&nbsp; que vous avez modelés.</p>
<p>Félicitations ! Vous avez réussi à modéliser un &laquo;&nbsp;Business Process&raquo;&nbsp; en utilisant le &laquo;&nbsp;BPMN modeler&raquo;&nbsp;.</p>
<p>Maintenant, il vous reste à convertir le BPMN en BPEL, et à déployer le BPEL sur un moteur BPEL (Ode d&#8217;Apache par exemple) . Ce sera peut-être l&#8217;objet de prochains tutoriels . Quand pensez-vous?</p>
]]></content:encoded>
			<wfw:commentRss>http://bertrand.guiral.info/2008/05/07/bpmn-business-process-modeling-notation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SOA et SCA: Le Projet Apache Tuscany</title>
		<link>http://bertrand.guiral.info/2008/05/04/soa-et-sca-le-projet-apache-tuscany/</link>
		<comments>http://bertrand.guiral.info/2008/05/04/soa-et-sca-le-projet-apache-tuscany/#comments</comments>
		<pubDate>Sun, 04 May 2008 14:40:04 +0000</pubDate>
		<dc:creator>Guiral bertrand</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[sca]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[tutoriels]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[tuscany]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://bertrand.guiral.info/?p=10</guid>
		<description><![CDATA[Le projet Tuscany a pour but de créer une infrastructure SOA.

Tuscany est basé sur les spécifications définis par l&#8217;&#187;&#160;Open CSA&#187;&#160;.

SCA (Service Component Architecture) définit un  modèle simple à base de service permettant la construction , l&#8217;assemblage et le déployment de services (Existant et nouveau) et de façon indépendante des languages et technologies.
 
SDO (Service [...]]]></description>
			<content:encoded><![CDATA[<p>Le projet Tuscany a pour but de créer une infrastructure SOA.<br />
<br/><br />
Tuscany est basé sur les spécifications définis par l&#8217;&raquo;&nbsp;Open CSA&raquo;&nbsp;.</p>
<p/>
<p>SCA (Service Component Architecture) définit un  modèle simple à base de service permettant la construction , l&#8217;assemblage et le déployment de services (Existant et nouveau) et de façon indépendante des languages et technologies.<br />
 <br/><br />
SDO (Service Data Object) fournit une interface pour manipuler les différentes formes de données, y compris des documents  XML, qui peuvent exister dans un réseau de Services eet fournit les mécanismes pour des conversions.</p>
<h2>Première Application Tuscany </h2>
<p>Ce tutorial est inspiré (traduit ?) de <a href="http://incubator.apache.org/tuscany/getting-started-with-tuscany-using-the-command-line.html">getting started with tuscany </a></p>
<h2> Etape 1 : Telecharger java, tuscany et maven</h2>
<p>Téléchargement: &laquo;&nbsp;<a href="http://incubator.apache.org/tuscany/sca-java-releases.html">Tuscany Java SCA release</a>&laquo;&nbsp;.<br />
<br/></p>
<h3>Construire le &laquo;&nbsp;Calulator&raquo;&nbsp; en java </h3>
<p>Cet exemple illustre comment définir votre application en restant concentré sur la logique métier. Il vous ammene à travers les étapes de la construction d&#8217;un  &laquo;&nbsp;Calculator&raquo;&nbsp;. Toutes les connections entre les &laquo;&nbsp;Components&raquo;&nbsp; à l&#8217;intérieur du &laquo;&nbsp;Composite&raquo;&nbsp; sont locales et décrires en utilisant des Interfaces Java.</p>
<p/>
<h4>Etape 0 &#8211; Obtenir les librairies nécessaires </h4>
<p>Pour cela il faut utiliser maven.<br />
<br/><br />
voila le POM.xml:</p>
<div class="geshi" style="overflow: auto; width: 560px; height: 300px; padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;project</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://maven.apache.org/POM/4.0.0&quot;</span> <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;modelVersion<span style="font-weight: bold; color: black;">&gt;</span></span></span>0.0.0<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/modelVersion<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span>com.bg.soa.test<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span>bg_soa_test_tutos_tuscany<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;packaging<span style="font-weight: bold; color: black;">&gt;</span></span></span>jar<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/packaging<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;version<span style="font-weight: bold; color: black;">&gt;</span></span></span>1.0-SNAPSHOT<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/version<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>bg_soa_test_tutos_tuscany<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;url<span style="font-weight: bold; color: black;">&gt;</span></span></span>http://maven.apache.org<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/url<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;repositories<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;repository<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;id<span style="font-weight: bold; color: black;">&gt;</span></span></span>apache.incubator<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/id<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;url<span style="font-weight: bold; color: black;">&gt;</span></span></span>http://people.apache.org/repo/m2-incubating-repository<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/url<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/repository<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/repositories<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dependencies<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span>org.apache.tuscany.sca<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span>tuscany-host-embedded<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;version<span style="font-weight: bold; color: black;">&gt;</span></span></span>1.2-incubating<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/version<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span>org.apache.tuscany.sca<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span>tuscany-implementation-java-runtime<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;version<span style="font-weight: bold; color: black;">&gt;</span></span></span>1.2-incubating<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/version<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;scope<span style="font-weight: bold; color: black;">&gt;</span></span></span>runtime<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/scope<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span>org.apache.tuscany.sca<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span>tuscany-binding-ws-axis2<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;version<span style="font-weight: bold; color: black;">&gt;</span></span></span>1.2-incubating<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/version<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;scope<span style="font-weight: bold; color: black;">&gt;</span></span></span>runtime<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/scope<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span>org.apache.tuscany.sca<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span>tuscany-host-tomcat<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;version<span style="font-weight: bold; color: black;">&gt;</span></span></span>1.2-incubating<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/version<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;scope<span style="font-weight: bold; color: black;">&gt;</span></span></span>runtime<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/scope<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span>&nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span>junit<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span>junit<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;version<span style="font-weight: bold; color: black;">&gt;</span></span></span>3.8.1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/version<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;scope<span style="font-weight: bold; color: black;">&gt;</span></span></span>test<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/scope<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dependencies<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/project<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Si vous travaillé avec eclipse, placé ce fichier à la racine de votre projet, puis tapez:</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="java" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mvn eclipse:eclipse</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<h4>Etape 1 &#8211; Définir quels sont les blocs nécessaires.</h4>
<p> Réflechissez à comment votre application peut être divisé en petites fonctions et/ou services.Chaque bloc est une unité logique d&#8217;opération qui peut être utilisée dans une application englobante. Pour notre exemple, le &laquo;&nbsp;Calculator&raquo;&nbsp; sera divisé en 5 blocs: AddService bloc, SubstractService bloc, MultiplyService bloc, DivideService bloc et un bloc principal qui accepte des requètes et les route vers le  service approprié.Nous appelerons ce bloc &laquo;&nbsp;CalculatorService&raquo;&nbsp;.</p>
<div style="border: 1px solid #000000;background-color: #ffffff;padding:20px;margin:30px">
<img  alt="" src="http://bertrand.guiral.free.fr/jee/images/calculatorblocks.png"/>
</div>
<h4>Etape 2 &#8211; Implémenter chaque bloc </h4>
<p>Maintenat que vous avez identifié les blocs de fonctionnalité de votre application, vous ètes prét pour les créer.</p>
<p>En SCA chaque bloc de fonctionnalité est appelé un &laquo;&nbsp;Component&raquo;&nbsp;. Aussi regardons comment on implémente un &laquo;&nbsp;Component&raquo;&nbsp;.</p>
<p>Nous prendrons comme premier exemple le bloc &#8211; ou &laquo;&nbsp;Component&raquo;&nbsp; &#8211; AddService .</p>
<p> Le &laquo;&nbsp;Component&raquo;&nbsp; AddService fournira un service qui additionne 2 nombres l&#8217;un à l&#8217;autre.Le &laquo;&nbsp;Component&raquo;&nbsp; CalculatorService  utilise le &laquo;&nbsp;Component&raquo;&nbsp; AddService à chaque fois qu&#8217;on lui demande de faire une addition.<br />
<br/><br />
Si nous devions écrire le &laquo;&nbsp;Component&raquo;&nbsp; AddService en Java classique, nous pourrions commencer par décrire une Interface Java.</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="java" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">package</span> com.<span style="color: #006600;">bg</span>.<span style="color: #006600;">soa</span>.<span style="color: #006600;">tuscany</span>.<span style="color: #006600;">calculator</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> AddService <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #993333;">double</span> add<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">double</span> n1, <span style="color: #993333;">double</span> n2<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Maintenant , nous fournissons une implementation de cette interface.</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="java" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">package</span> com.<span style="color: #006600;">bg</span>.<span style="color: #006600;">soa</span>.<span style="color: #006600;">tuscany</span>.<span style="color: #006600;">calculator</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> AddServiceImpl <span style="color: #000000; font-weight: bold;">implements</span> AddService <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; @Override</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">double</span> add<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">double</span> n1, <span style="color: #993333;">double</span> n2<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> n1+n2;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Mais Attend! On est en train d&#8217;écrire un &laquo;&nbsp;Component SCA&raquo;&nbsp; ? Ca doit être plus compliqué qu&#8217;une interface et son implementation, non ? Bon, en fait, un SCA &laquo;&nbsp;Component&raquo;&nbsp; peut être écrit en Java classique, c&#8217;est ce que nous avons fait.<br />
<br/><br />
Nous pouvons utiliser SCA pour exposer ce service que fournit le &laquo;&nbsp;Component&raquo;&nbsp; addService à d&#8217;autres acteurs, par exemple des Web-Services, JMS ou RMI, sans changer une ligne de code à l&#8217;implémentation de AddService.</p>
<p/>
Regardons le &laquo;&nbsp;Component&raquo;&nbsp; CalculatorService. Il est interessantparcequ&#8217;il va devoir appelé le &laquo;&nbsp;Component&raquo;&nbsp; AddService.<br />
<br/><br />
Dans l&#8217;application finale, il aura aussi à appeler les &laquo;&nbsp;Component&raquo;&nbsp;  SubstracService,  MultiplyService et  DivideService.<br />
<br/><br />
A nouveau, nous commencerons par définir une interface parceque CalculatoService doit lui-même fournir une interface que d&#8217;autres appelleront.</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="java" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">package</span> com.<span style="color: #006600;">bg</span>.<span style="color: #006600;">soa</span>.<span style="color: #006600;">tuscany</span>.<span style="color: #006600;">calculator</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> CalculatorService <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #993333;">double</span> multiply<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">double</span> n1, <span style="color: #993333;">double</span> n2<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #993333;">double</span> add<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">double</span> n1, <span style="color: #993333;">double</span> n2<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #993333;">double</span> substract<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">double</span> n1, <span style="color: #993333;">double</span> n2<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #993333;">double</span> divide<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">double</span> n1, <span style="color: #993333;">double</span> n2<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Maintenant, nous implementons cette interface:</p>
<div class="geshi" style="overflow: auto; width: 560px; height: 300px; padding-bottom: 15px;"><div class="java" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">package</span> com.<span style="color: #006600;">bg</span>.<span style="color: #006600;">soa</span>.<span style="color: #006600;">tuscany</span>.<span style="color: #006600;">calculator</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import org.osoa.sca.annotations.Reference;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CalculatorServiceImpl <span style="color: #000000; font-weight: bold;">implements</span> CalculatorService <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> AddService addService;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> SubtractService subtractService;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> MultiplyService multiplyService;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> DivideService divideService;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; @<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AReference+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Reference</span></a></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setAddService<span style="color: #66cc66;">&#40;</span>AddService addService<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">addService</span> = addService;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ... <span style="color: #006600;">methodes</span> set pour les autres attributs à rajouter</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">double</span> add<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">double</span> n1, <span style="color: #993333;">double</span> n2<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> addService.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>n1, n2<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; ...<span style="color: #006600;">implementation</span> des autre méthodes définies dans l<span style="color: #ff0000;">'interface ici.</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff0000;">}</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #ff0000;"</span></div></li></ol></div></div>
<p>On aura remarqué l&#8217;annotation &laquo;&nbsp;@Reference&raquo;&nbsp;.<br />
<br/><br />
Nous avons maintenant quelques &laquo;&nbsp;Components&raquo;&nbsp; implémenté en Java.Chaque &laquo;&nbsp;Component&raquo;&nbsp; a une interface bien définie, utilisant java dans notre exemple.</p>
<div style="border: 1px solid #000000;background-color: #ffffff;padding:20px;margin:30px">
<img  alt="" src="http://bertrand.guiral.free.fr/jee/images/calculator3.png"/>
</div>
<h4>Step 3 &#8211; Assembler l&#8217;application: </h4>
<p>Tout est parfait, mais comment exécuter ces deux &laquo;&nbsp;Components&raquo;&nbsp;. Oui bien sûr, le programmeur java qui est en nous veut foncer, écrire les lignes permettant de connecter nos deux &laquo;&nbsp;Components&raquo;&nbsp; ensemble et de les éxecuter. On pourrait le faire facilement dans notre cas:</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="java" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CalculatorClient <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #993333;">void</span> main<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> args<span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AException+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Exception</span></a> <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; CalculatorServiceImpl calculatorService = <span style="color: #000000; font-weight: bold;">new</span> CalculatorServiceImpl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; AddService&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addService&nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #000000; font-weight: bold;">new</span> AddServiceImpl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; calculatorService.<span style="color: #006600;">setAddService</span><span style="color: #66cc66;">&#40;</span>addService<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;3 + 2=&quot;</span> + calculatorService.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span>, <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">//appeler les autres methodes ici, si nous avons implementé SubtractService, MultiplyService, DivideService</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Mais cela n&#8217;utilise pas Tuscany SCA, et étendre ce code pour implementer un Web-Srvice par exemple ne serait pas simple.<br />
<br/><br />
En premier, changeons le code pour appeler le &laquo;&nbsp;Tuscany SCA runtime&raquo;&nbsp; avant d&#8217;appeler nos &laquo;&nbsp;Components&raquo;&nbsp;.</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="java" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">package</span> com.<span style="color: #006600;">bg</span>.<span style="color: #006600;">soa</span>.<span style="color: #006600;">tuscany</span>.<span style="color: #006600;">calculator</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #a1a100;">import org.apache.tuscany.sca.host.embedded.SCADomain;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MainApp <span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #993333;">boolean</span> isOn =<span style="color: #000000; font-weight: bold;">true</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #993333;">void</span> main<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> args<span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AException+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Exception</span></a><span style="color: #66cc66;">&#123;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; SCADomain scaDomain = SCADomain.<span style="color: #006600;">newInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Calculator.composite&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; CalculatorService calculatorService = scaDomain.<span style="color: #006600;">getService</span><span style="color: #66cc66;">&#40;</span>CalculatorService.<span style="color: #000000; font-weight: bold;">class</span>, <span style="color: #ff0000;">&quot;CalculatorServiceComponent&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;3 + 2 = &quot;</span> + calculatorService.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span>, <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AThread+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Thread</span></a>.<span style="color: #006600;">sleep</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10000</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Vous pouvez voir que nous commençons par utiliser une méthode static pour obtenir une instance  de SCADomain.<br />
<br/><br />
Le SCADomain est un concept en SCA qui represente les frontières d&#8217;un sysème SCA.<br />
Il pourrait être distribué entre plusieurs processeurs.<br />
Pour l&#8217;instant, regardons comment cela fonctionne à l&#8217;intérieur d&#8217;une seule JVM.</p>
<p/>
Le paramètre &laquo;&nbsp;Calculator.composite&raquo;&nbsp; fait référence à un fichier xml qui décrit comment les components dans l&#8217;application &laquo;&nbsp;Calculator&raquo;&nbsp; sont assemblés.<br />
<br/><br />
Voilà le XML à l&#8217;intérieur de ce fichier &laquo;&nbsp;Calculator.composite&raquo;&nbsp; qui est dans le classpath.<br />
<br/><br />
la dernière ligne est là pour empécher la JVM de s&#8217;arrêter. Nous verrons plus loin (Quand nos exposerons des WS par exemple) à quoi cela servira.</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;composite</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.osoa.org/xmlns/sca/1.0&quot;</span>&nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Calculator&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;component</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CalculatorServiceComponent&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;implementation</span>.java <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.bg.soa.tuscany.calculator.CalculatorServiceImpl&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;reference</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;addService&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;AddServiceComponent&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- references a SubtractComponent, MultiplyComponent et DivideComponent&nbsp; --&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/component<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;component</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;AddServiceComponent&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;implementation</span>.java <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.bg.soa.tuscany.calculator.AddServiceImpl&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/component<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- definitions de SubtractComponent, MultiplyComponent et DivideComponent --&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/composite<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Vous pouvez observer que nous avons défini 2 &laquo;&nbsp;components&raquo;&nbsp; et spécifié les classes Java implémentant ces &laquo;&nbsp;components&raquo;&nbsp; que Tuscany SCA a besoin de charger.<br />
Ce sont les classes que nous avons juste implémentées.</p>
<p/>
 Remaquez aussi que le &laquo;&nbsp;CalculatorServiceComponent&raquo;&nbsp; a une référence nommée &laquo;&nbsp;addService&raquo;&nbsp;.<br />
 <br/><br />
Dans le XML, cette référence correspond au &laquo;&nbsp;AddServiceComponent&raquo;&nbsp;.<br />
Ce n&#8217;est pas une coincidence que le nom de la référence &laquo;&nbsp;addService&raquo;&nbsp; corresponde au nom du champs addService que nous avons créé quand nous avons implémenté &laquo;&nbsp;CalculatorServiceImpl&raquo;&nbsp;.<br />
 <br/><br />
 Le moteur &laquo;&nbsp;Tuscany SCA&raquo;&nbsp; parse les informations du fichier XML et les utilise pour construire les objets et leurs relations qui représente notre application &laquo;&nbsp;Calculator&raquo;&nbsp;.<br />
 Il crée en premiet des instances de AddServiceImpl et CalculatorServiceImpl.<br />
 Il injecte  ensuite une référence de l&#8217;objet AddServiceImpl dans le champs addService de l&#8217;objet CalculatorServiceImpl.<br />
 Si vous regardez à nouveau comment nous avons implémenté le CalculatorService, vous remarquerez une annotation @Reference qui dit à SCA quel champs sont à référencé.<br />
 <br/><br />
 C&#8217;est equivalent à ce bout de code pour un clent java habituel:<br />
 <br/></p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="java" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; CalculatorServiceImpl calculatorService = <span style="color: #000000; font-weight: bold;">new</span> CalculatorServiceImpl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; AddService&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addService&nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #000000; font-weight: bold;">new</span> AddServiceImpl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; calculatorService.<span style="color: #006600;">setAddService</span><span style="color: #66cc66;">&#40;</span>addService<span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p> <br/><br />
 Une fois que le fichier composite est chargé dans le SCADomain, notre client demande au SCADomain de nous donner une référence vers le component appelé &laquo;&nbsp;CalculatorServiceComponent&raquo;&nbsp;.</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="java" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; CalculatorService calculatorService = scaDomain.<span style="color: #006600;">getService</span><span style="color: #66cc66;">&#40;</span>CalculatorService.<span style="color: #000000; font-weight: bold;">class</span>, <span style="color: #ff0000;">&quot;CalculatorServiceComponent&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p> Nous pouvons utiliser cette référence pour accéder aux méthodes que nous avons créées, ici par exemple, la méthode CalculatorServiceImpl.add().</p>
<p/>
 Les spécifications SCA décrive souvent les applications SCA sous forme de diagramme.<br />
 Cela aide souvent quels sont les components qui composent une application et comment ils sont cablés ensemble.<br />
 Si nous traçons un diagramme de ce que nous avons construit dans notre exemple, nous obtenons quelquechose comme la figure suivante:</p>
<div style="border: 1px solid #000000;background-color: #ffffff;padding:20px;margin:30px">
<img  alt="" src="http://bertrand.guiral.free.fr/jee/images/calculator4.png"/>
</div>
<h4>Step 4 &#8211; Déployer l&#8217;application: </h4>
<p>Si le fichier &laquo;&nbsp;Calculator.composite&raquo;&nbsp; est dans notre class-path, ainsi que les autres librairies (les .jar), nous pouvons éxécuter notre exemple.</p>
<p><br/><br />
Nous proposons ici un exemple de fichier ant permettant la compilation et l&#8217;execution.<br />
<br/><br />
Il faut bien sûr adapter les properties tuscanyHome &#8230;<br />
<br/><br />
On peut remarquer que la liste des librairies (des jar) est définie dans le manifest du tuscany-sca-manifest.jar . Ce jar est livré uniquement avec le binaire de tuscany (Pas avec les sources). </p>
<div class="geshi" style="overflow: auto; width: 560px; height: 300px; padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;sample-calculator-webapp&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;compile&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;tuscanyHome&quot;</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;C:\java\tuscany-sca-1.2-incubating&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;test.class&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.bg.soa.tuscany.calculator.MainApp&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;test.jar&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;bg-sample-calculator.jar&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;init&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;target/classes&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mkdir</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;src/main/resources&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/target<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;compile&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;init&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;javac</span> <span style="color: #000066;">srcdir</span>=<span style="color: #ff0000;">&quot;src/main/java&quot;</span> <span style="color: #000066;">destdir</span>=<span style="color: #ff0000;">&quot;target/classes&quot;</span> <span style="color: #000066;">debug</span>=<span style="color: #ff0000;">&quot;on&quot;</span> <span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;1.5&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;1.5&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;classpath<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${tuscanyHome}/lib/tuscany-sca-manifest.jar&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/classpath<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/javac<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;copy</span> <span style="color: #000066;">todir</span>=<span style="color: #ff0000;">&quot;target/classes&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;src/main/resources&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/copy<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;jar</span> <span style="color: #000066;">destfile</span>=<span style="color: #ff0000;">&quot;target/${test.jar}&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;target/classes&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;manifest<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;attribute</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Main-Class&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;${test.class}&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/manifest<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/jar<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/target<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;run-classes&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;java</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;${test.class}&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;classpath<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;pathelement</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;target/classes&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${tuscanyHome}/lib/tuscany-sca-manifest.jar&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/classpath<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/java<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/target<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;run&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;java</span> <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;${test.class}&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;classpath<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;pathelement</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;target/${test.jar}&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;pathelement</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;${tuscanyHome}/lib/tuscany-sca-manifest.jar&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/classpath<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/java<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/target<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;clean&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;delete</span> <span style="color: #000066;">quiet</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">includeemptydirs</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;target&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/delete<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/target<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/project<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<h3>Utiliser d&#8217;autres configurations</h3>
<p>En regardant en arrière, l&#8217;application &laquo;&nbsp;Calculator&raquo;&nbsp; construite en utilisant le &laquo;&nbsp;Tuscany SCA&raquo;&nbsp; n&#8217;est rien de plus qu&#8217;une application java ordinaire.<br />
Cependant, nous avons un fichier xml &laquo;&nbsp;Composite&raquo;&nbsp; qui décrit comment notre application est assemblée.</p>
<p/>
Cette notion d&#8217;	assemblage est importante et apporte de nombreux avantage si notre application devient plus complexe et que nous voulons la modifier, ou intégrer d&#8217;autres components, sans se soucier du langage dans lequel ils sont écrits.</p>
<p/>
Maintenant , disons que notre &laquo;&nbsp;Calculator&raquo;&nbsp; est devenu populaire que nous voulons la mettre sur l&#8217;intranet de la société et la rendre acessible depuis les browser d&#8217;applications Web2.0.<br />
C&#8217;est ce que nous cherchons depuis le début.Comme nous avons un fichier XML qui décrit notre application, cela devient facile avec &laquo;&nbsp;Tuscany SCA&raquo;&nbsp;.<br />
<br/><br />
Ce qui suit devrait faire l&#8217;affaire:</p>
<p/>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;composite</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.osoa.org/xmlns/sca/1.0&quot;</span>&nbsp; <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Calculator&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;service</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CalculatorService&quot;</span> <span style="color: #000066;">promote</span>=<span style="color: #ff0000;">&quot;CalculatorServiceComponent&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;interface</span>.java <span style="color: #000066;">interface</span>=<span style="color: #ff0000;">&quot;com.bg.soa.tuscany.calculator.CalculatorService&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;binding</span>.ws <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://localhost:8181/CalculatorService&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/service<span style="font-weight: bold; color: black;">&gt;</span></span></span>&nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;component</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CalculatorServiceComponent&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;implementation</span>.java <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.bg.soa.tuscany.calculator.CalculatorServiceImpl&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;reference</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;addService&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;AddServiceComponent&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- references to SubtractComponent, MultiplyComponent and DivideComponent&nbsp; --&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/component<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;component</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;AddServiceComponent&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;implementation</span>.java <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.bg.soa.tuscany.calculator.AddServiceImpl&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/component<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- definitions de SubtractComponent, MultiplyComponent and DivideComponent --&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/composite<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>Tout ce que nous avons fait, c&#8217;est rajouter le tag &lt;service&gt; qui indique à Tuscany comment exposer notre &laquo;&nbsp;CalculatorService&raquo;&nbsp;.<br />
<br/><br />
Nous n&#8217;avons pas modifier une ligne du code!</p>
<p>
Pour tester, il faut prendre un browser et aller à l&#8217;adresse indiquée:<br />
<a href="http://localhost:8181/CalculatorService?wsdl">http://localhost:8181/CalculatorService?wsdl</a></p>
<p/>
Remarque: Lors de l&#8217;éxécution, vous pouvez avoir le message d&#8217;erreur suivant :Address already in use: Une autre application ecoute sur ce port. Cela peut être la même application que vous avez re-lancé.</p>
<p/>
Si nous voulons exposer le service en JSON, il faut modifier le service comme suit:</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;service</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CalculatorService&quot;</span> <span style="color: #000066;">promote</span>=<span style="color: #ff0000;">&quot;CalculatorServiceComponent&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;interface</span>.java <span style="color: #000066;">interface</span>=<span style="color: #ff0000;">&quot;com.bg.soa.tuscany.calculator.CalculatorService&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;binding</span>.ws <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://localhost:8181/CalculatorService&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;binding</span>.jsonrpc<span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/service<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p><br/><br />
Comme je ne suis pas à l&#8217;aise avec cette techno (JSON) , je ne l&#8217;ai pas testé!</p>
<h4> Exposer le service en RMI, &#8230; </h4>
<p>Il faudrait au niveau du service rajouter le tag suivant:</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tuscany:binding</span>.rmi <span style="color: #000066;">host</span>=<span style="color: #ff0000;">&quot;localhost&quot;</span> <span style="color: #000066;">port</span>=<span style="color: #ff0000;">&quot;8099&quot;</span> <span style="color: #000066;">serviceName</span>=<span style="color: #ff0000;">&quot;CalculatorRMIService&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<h4> Rajouter un &laquo;&nbsp;Component&raquo;&nbsp; en script ruby, python, javascript, groovy .. </h4>
<p>Il faut rajouter les dépendances suivantes dans le fichier POM.xml (Ou dans le classpath lors de l&#8217;execution)</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span>org.apache.tuscany.sca<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/groupId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span>tuscany-implementation-script<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;version<span style="font-weight: bold; color: black;">&gt;</span></span></span>1.2-incubating<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/version<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;scope<span style="font-weight: bold; color: black;">&gt;</span></span></span>runtime<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/scope<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/dependency<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p>
Et dans le fichier .composite, il faut rajouter un &laquo;&nbsp;Component&raquo;&nbsp;:<br />
<br/></p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;component</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;SubstractServiceComponent&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tuscany:implementation</span>.script <span style="color: #000066;">script</span>=<span style="color: #ff0000;">&quot;com/bg/soa/tuscany/calculator/SubtractServiceImpl.rb&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/component<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p/>
voilà le fichier composite complet:</p>
<p/>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;composite</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.osoa.org/xmlns/sca/1.0&quot;</span> <span style="color: #000066;">xmlns:tuscany</span>=<span style="color: #ff0000;">&quot;http://tuscany.apache.org/xmlns/sca/1.0&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Calculator&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;service</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CalculatorService&quot;</span> <span style="color: #000066;">promote</span>=<span style="color: #ff0000;">&quot;CalculatorServiceComponent&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;interface</span>.java <span style="color: #000066;">interface</span>=<span style="color: #ff0000;">&quot;com.bg.soa.tuscany.calculator.CalculatorService&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;binding</span>.ws <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">&quot;http://localhost:8183/CalculatorService&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/service<span style="font-weight: bold; color: black;">&gt;</span></span></span>&nbsp; &nbsp; </div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;component</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CalculatorServiceComponent&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;implementation</span>.java <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.bg.soa.tuscany.calculator.CalculatorServiceImpl&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;reference</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;addService&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;AddServiceComponent&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;reference</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;substractService&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;SubstractServiceComponent&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/component<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;component</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;AddServiceComponent&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;implementation</span>.java <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;com.bg.soa.tuscany.calculator.AddServiceImpl&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/component<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;component</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;SubstractServiceComponent&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;tuscany:implementation</span>.script <span style="color: #000066;">script</span>=<span style="color: #ff0000;">&quot;com/bg/soa/tuscany/calculator/SubtractServiceImpl.rb&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/component<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/composite<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p/>
<br/><br />
Il ne faut pas oublier de reférencer ce &laquo;&nbsp;Component&raquo;&nbsp; lors de la définition du &laquo;&nbsp;Component&raquo;&nbsp; CalculatorServiceComponent, ainsi que de rajouter un xmlns:tuscany.</p>
<p>
Et bien sur il faut definir le script  dans le fichier SubtractServiceImpl.rb
</p>
<div class="geshi" style="overflow: auto; width: 560px;padding-bottom: 15px;"><div class="xml" style="color: #000066; border-left: 5px solid rgb(195, 215, 234); background-color: rgb(240, 240, 240); padding:1px;width:100%"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">def substract(n1, n2)</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; return n1 - n2</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">end</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;font: normal normal 8pt 'Courier New', Courier, monospace; color: #003030;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></div></div>
<p><br/></p>
<h4>Conclusion </h4>
<p>Vous venez d&#8217;avoir un apercu de la puissance des SOA: Collaboration entre services, entre plusieurs protocoles, plusieurs technologies.<br />
Et il y encore plus: Les &laquo;&nbsp;Policies&raquo;&nbsp; (Gestion des droits des services), la répartition des applications sur plusieurs serveurs, l&#8217;orchestration de services, le déploiement de tuscany sur Tomcat  &#8230;<br />
C&#8217;est relativement simple à mettre en oeuvre (Beaucoup plus simple que J2EE 2.3 !) Il y a de quoi s&#8217;enthousiasmer.<br />
Qu&#8217;en pensez vous ?</p>
]]></content:encoded>
			<wfw:commentRss>http://bertrand.guiral.info/2008/05/04/soa-et-sca-le-projet-apache-tuscany/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comment choisir un Enterprise Service Bus (ESB) ?</title>
		<link>http://bertrand.guiral.info/2008/05/03/comment-choisir-un-esb/</link>
		<comments>http://bertrand.guiral.info/2008/05/03/comment-choisir-un-esb/#comments</comments>
		<pubDate>Sat, 03 May 2008 09:27:45 +0000</pubDate>
		<dc:creator>Guiral bertrand</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[Entreprise Service Bus]]></category>
		<category><![CDATA[esb]]></category>

		<guid isPermaLink="false">http://bertrand.guiral.info/?p=9</guid>
		<description><![CDATA[Traduction de servicemix faq Servicemix est un projet Apache proposant un ESB (Enterprise Service Bus),un SCA (Service Component Application) et un JBI (Java Business Integration).
Devant les besoins d&#8217;intégration d&#8217;un middleware , il est logique de considérer l&#8217;adoption d&#8217;un ESB. En faisant les évaluations des logiciels, il est important d&#8217;approcher le choses de manière à ce [...]]]></description>
			<content:encoded><![CDATA[<p>Traduction de <a href="http://servicemix.apache.org/how-to-evaluate-an-esb.html">servicemix faq </a>Servicemix est un projet Apache proposant un ESB (Enterprise Service Bus),un SCA (Service Component Application) et un JBI (Java Business Integration).</p>
<p>Devant les besoins d&#8217;intégration d&#8217;un middleware , il est logique de considérer l&#8217;adoption d&#8217;un ESB. En faisant les évaluations des logiciels, il est important d&#8217;approcher le choses de manière à ce que vos exigences soient l&#8217;instrument central du processus. Il y a habituellement deux niveaux d&#8217;évaluation qui doivent être considérés lors de l&#8217;adoption de n&#8217;importe quel software : vos besoins métiers et les fonctionnalités du logiciel (Ici de l&#8217;ESB). Il y a de nombreux points dans ces 2 niveaux, et nous allons les passer en revue.</p>
<h3>Votre objectif métier</h3>
<p> </p>
<p>Ne dites pas que votre objectif métier c&#8217;est le SOA. C&#8217;est le comment, pas le pourquoi. SOA n&#8217;est qu&#8217;une façon de penser l&#8217;architecture logicielle. Votre objectif métier c&#8217;est le but que vous essayez d&#8217;atteindre dans votre activité à travers l&#8217;usage du logiciel que vous êtes en train de mettre en place. Voilà un exemple:</p>
<div style="border: 1px solid #000000;background-color: #ffffff;color:#000000;padding-left:20 px;">
<p>Notre objectif métier est de combiner des données météo avec des cartes pour fournir aux clients des prévisions météo immédiates pour leurs destinations quand ils font des réservations de voyage sur notre portail.<br />
Cela facilite non seulement les projets de voyage, mais aussi permet à notre système d&#8217;annonces publicitaire de mieux cibler les clients . Cela apportera un plus à nos clients, mais permettra de mieux cibler les publicités pour tenter d&#8217;augmenter le taux de conversions (clics sur annonces).</p>
</div>
<p>Remarquez que l&#8217;objectif métier est concentré sur le but du logiciel du point de vue métier. Le but est de:</p>
<ul>
<li>Améliorer l&#8217;expérience des clients grâce à l&#8217;usage de cartes et de météo</li>
<li>Augmenter le taux de conversion des annonces publicitaires</li>
</ul>
<p>Comprendre vos objectifs métiers vous met en meilleure position pour définir des exigences fonctionnelles pour atteindre cet objectif.</p>
<h3>Vos exigences fonctionnelles</h3>
<p>Une fois compris les objectifs métiers du projet, passons aux exigences fonctionnelles. Ci dessous sont listés quelques exemples d&#8217;exigences fonctionnelles pour notre objectif métier:</p>
<div style="border: 1px solid #000000;background-color: #ffffff;color: #000000; ">
<ul>
<li>Fournir un accès aux données météo
<ul>
<li>Cela demande l&#8217;intégration d&#8217;un socket pour récupérer les données</li>
<li>Il faudra parser les données</li>
</ul>
</li>
<li>Fournir un accès aux données géographiques, aux cartes
<ul>
<li>Google offre une API (Google Map API ) pour accéder à ces données</li>
</ul>
</li>
<li>Créer un &laquo;&nbsp;overlay&raquo;&nbsp; permettant d&#8217;intégrer les cartes et la météo sur les destinations des clients</li>
<li>En combinant les prévisions et les destinations , donner des règles au système fournissant les publicités pour adapter les annonces aux destinations et aux prévisions météo</li>
<li>Si le client clicke sur une annonce, sauvegarder cette information en base de donnée et la lier au profil du client. Cela améliorera nos prédictions lorsque le client reviendra une autre fois.</li>
</ul>
</div>
<p>Ces exigences fonctionnelles augmentent dramatiquement lorsque l&#8217;objectif métier est identifié et clairement communiqué à toutes les personnes concernées dans le projet. De telles exigences vont amener les choix d&#8217;architecture du système et du logiciel.</p>
<h3>Vos choix d&#8217;architecture</h3>
<p>Avant de commencer à contacter des fournisseurs, il est important d&#8217;établir quelques choix d&#8217;architecture. Ces choix ne sont pas gravés dans le marbre. Cela peut inclure de concevoir le système d&#8217;une façon &laquo;&nbsp;Orientée Service&raquo;&nbsp;, d&#8217;utiliser certains packages, et peut être le hardware et les softs de test. Vous avez peut être fait ces choix de façon implicite à travers vos expériences précédentes. Si il en est ainsi, il est important d&#8217;identifier et de communiquer ces décisions explicitement aux différentes parties-prenantes pour qu&#8217;il y ait un certain niveau de clarté dans le groupe.</p>
<p>En travaillant à travers ces exercices, vous devriez avoir non seulement un ensemble de solutions à partager, mais vous aurez aussi vos critères d&#8217;évaluation d&#8217;un ESB.</p>
<h3>Vos critère pour évaluer un ESB</h3>
<p>N&#8217;importe quelle évaluation de software demande la connaissance des sujets discutés plus haut. Sans une bonne maîtrise de ces sujets, il est difficile d&#8217;évaluer la capacité d&#8217;un logiciel d&#8217;atteindre des buts spécifiques.</p>
<p>Il est important aussi de ne pas comparer les solutions logicielles fonction par fonction. Cette méthode d&#8217;évaluation ne donne une image quand au but attendu du logiciel.</p>
<p>Par exemple:</p>
<p>Quelle importance si un logiciel A affirme fournir des accès sécurisés vers des ressources X, mais que son API est vraiment compliqué à utiliser ?</p>
<p>Quelle importance si un logiciel B annonce fonctions 1, 2 et 3 mais que ses performances sont déplorables ?</p>
<p>Une expérience personnelle avec un logiciel donné dans votre environnement est une priorité. Quand on parle d&#8217;ESB, c&#8217;est encore plus critique parce que l&#8217;ESB contrôle l&#8217;intégration du système et que deux scénarios d&#8217;intégration ne sont jamais identiques. Déployer un ESB dans votre environnement pour résoudre un ou deux de vos problèmes par une validation de conception vous donnera bien plus d&#8217;informations et de conclusions que n&#8217;importe quelles comparaisons sur papier.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://bertrand.guiral.info/2008/05/03/comment-choisir-un-esb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SOA : Service Oriented Architecture</title>
		<link>http://bertrand.guiral.info/2008/05/02/soa-service-oriented-architecture/</link>
		<comments>http://bertrand.guiral.info/2008/05/02/soa-service-oriented-architecture/#comments</comments>
		<pubDate>Fri, 02 May 2008 16:16:30 +0000</pubDate>
		<dc:creator>Guiral bertrand</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[outils]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[WebSphere]]></category>

		<guid isPermaLink="false">http://bertrand.guiral.info/?p=8</guid>
		<description><![CDATA[Le but des SOA: Unifier des systèmes hétérogènes, permettre une certaine &#171;&#160;agilité&#187;&#160; à des systèmes répartis, accélérer les vitesses de développement et de déploiement, offrir (ou utiliser) des services à (de) partenaires (Cela s&#8217;appelle l&#8217;interopérabilité).
Les moyens:
Des services sont fournis (En général des web-services) , s&#8217;appuyant sur les normes les plus répandues (http, xml, soap, wsdl) [...]]]></description>
			<content:encoded><![CDATA[<p>Le but des SOA: Unifier des systèmes hétérogènes, permettre une certaine &laquo;&nbsp;agilité&raquo;&nbsp; à des systèmes répartis, accélérer les vitesses de développement et de déploiement, offrir (ou utiliser) des services à (de) partenaires (Cela s&#8217;appelle l&#8217;interopérabilité).</p>
<p>Les moyens:<br />
Des services sont fournis (En général des web-services) , s&#8217;appuyant sur les normes les plus répandues (http, xml, soap, wsdl) . Toute les informations necessaires pour invoquer un service sont décrites dans un contrat: le wsdl.</p>
<p>Plusieurs normes et outils sont apparus pour manipuler ces services:<br />
BPEL (Business Process Execution Langage) permet de composer des services à partir d&#8217;autres services. Cela est très puissant &#8230; mais a aussi des limites.</p>
<p>Plusieurs solutions sont apparues autour de ces concepts:<br />
1 &#8211; JBI &laquo;&nbsp;Java Business Integration&raquo;&nbsp; Spécifié la JSR 208 de la JCP (Java Community Process),<br />
2 &#8211; ESB &laquo;&nbsp;Enterprise Service Bus&raquo;&nbsp;,<br />
3 &#8211; SCA &laquo;&nbsp;Service Component Architecture&raquo;&nbsp; Spécifié par l&#8217;OASIS.</p>
<p>Qu&#8217;est ce qu&#8217;il faut en penser? Que choisir ? Que faut-il éliminer? Quelles sont leurs différences ? Leurs points communs ? Lesquels survivront dans 5 ans? Dans 1 ans?<br />
Les spécifs, c&#8217;est clair, sont quasiment illisibles (230 pages pour JBI, J&#8217;ai arrêté l&#8217;impression de la première specif du SCA (Assembly Model Spécification) à 80 pages et ainsi de suite &#8230;).<br />
Les experts (Mais qui sont ils ???? ) , sont tous suspects de partialité, défendent leurs crèmeries ou leurs prestations&#8230;</p>
<p>Restons pragmatique : Au bout du compte, ce sera un produit, un serveur, une application distribuée ou non. Essayons de faire le tour de ce qui existe &#8230;<br />
Au secours! Quoi faire ? Quels critères sélectionnés?</p>
<table border="1">
<tbody>
<tr>
<td>Nom</td>
<td>SCA</td>
<td>JBI</td>
<td>ESB</td>
<td>Version</td>
</tr>
<tr>
<td><a href="http://www.eclipse.org/swordfish/">swordfish</a></td>
<td>***</td>
<td>***</td>
<td>***</td>
<td>Sortie Imminente</td>
</tr>
<tr>
<td><a href="http://mule.mulesource.org/">Mule</a></td>
<td>***</td>
<td>***</td>
<td>*****</td>
<td>-</td>
</tr>
<tr>
<td><a href="http://incubator.apache.org/tuscany/">Tuscany</a></td>
<td>*****</td>
<td>-</td>
<td>-</td>
<td>1.2</td>
</tr>
<tr>
<td><a href="https://open-esb.dev.java.net/">open-esb</a></td>
<td> </td>
<td>*****</td>
<td>*****</td>
<td>2.0</td>
</tr>
<tr>
<td><a href="http://petals.objectweb.org/">petals</a></td>
<td>*****</td>
<td>*****</td>
<td>*****</td>
<td>2.1.2</td>
</tr>
<tr>
<td><a href="http://servicemix.apache.org/home.html">servicemix</a></td>
<td>*****</td>
<td>*****</td>
<td>*****</td>
<td>4.0</td>
</tr>
<tr>
<td><a href="www.ibm.com/websphere/">WebSphere</a></td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td><a href="http://fabric3.codehaus.org/">fabric3</a></td>
<td>*****</td>
<td>*</td>
<td>*</td>
<td>0.5 Alpha2 Release</td>
</tr>
<tr>
<td><a href="http://newton.codecauldron.org">Newton</a></td>
<td>*****</td>
<td>*</td>
<td>*</td>
<td>1.2</td>
</tr>
<tr>
<td><a href="http://www.roguewave.com/products/hydra/hydrasca.php">HydraSCA</a></td>
<td>******</td>
<td>*</td>
<td>*</td>
<td>-</td>
</tr>
<tr>
<td><a href="http://commerce.bea.com/showproduct.jsp?family=WLS&amp;major=10.3SCA&amp;minor=-1">Weblogic</a></td>
<td>*****</td>
<td>*</td>
<td>*</td>
<td>-</td>
</tr>
<tr>
<td><a href="http://www.oracle.com/technologies/soa/events.html">Oracle</a></td>
<td>*****</td>
<td>*</td>
<td>*</td>
<td>-</td>
</tr>
<tr>
<td><a href="http://www.covansys.com/what/SCAFrameworkforSOA.htm">covansys</a></td>
<td>*****</td>
<td>*</td>
<td>*</td>
<td>-</td>
</tr>
</tbody>
</table>
<p>Comment choisir ?</p>
]]></content:encoded>
			<wfw:commentRss>http://bertrand.guiral.info/2008/05/02/soa-service-oriented-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
