<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Petals planet</title>
	
	<link>http://planet.petalslink.com</link>
	<description>Deals with Petals ESB, Petals Suite, SOA, PetalsLink...</description>
	<lastBuildDate>Fri, 12 Mar 2010 15:39:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
<link>http://planet.petalslink.com</link>
<url>http://planete.petalslink.com/home/wp-content/mbp-favicon/favicon.png</url>
<title>Petals planet</title>
</image>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PetalsPlanet" /><feedburner:info uri="petalsplanet" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Extensions de Petals ESB : LifeCycleListener</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/LJBNMUDON0E/</link>
		<comments>http://chamerling.wordpress.com/2010/03/12/extensions-de-petals-esb-lifecyclelistener/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 15:39:53 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[Petals ESB]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[fractal]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jbi]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[ow2]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://chamerling.wordpress.com/?p=350</guid>
		<description><![CDATA[Petals ESB offre des possibilités d&#8217;extensions assez impressionnantes venant du fait que l&#8217;on utilise le Framework à composants Fractal (bon c&#8217;est pas Spring mais on peut faire des choses intéressantes avec des produits issus de la recherche). Dans cet article je vais m&#8217;intéresser à la customisation du démarrage et de l&#8217;arrêt de Petals en proposant [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&#38;blog=3069558&#38;post=350&#38;subd=chamerling&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://petals.ow2.org">Petals ESB</a> offre des possibilités d&#8217;extensions assez impressionnantes venant du fait que l&#8217;on utilise le Framework à composants <a href="http://fractal.ow2.org">Fractal</a> (bon c&#8217;est pas Spring mais on peut faire des choses intéressantes avec des produits issus de la recherche). Dans cet article je vais m&#8217;intéresser à la customisation du démarrage et de l&#8217;arrêt de Petals en proposant une extension sympa et ce sans modifier énormément le code du kernel de Petals (Ca peut aussi servir de tutorial Fractal pour les débutants&#8230;).<br />
Pourquoi? Parce-que actuellement pour moi Petals ESB est le framework SOA que j&#8217;étends pour lui ajouter des fonctionnalités qui ne sont pas fournies par défaut. La fonctionnalité du jour doit me permettre d&#8217;attendre que tous les composants par défaut soit démarrés pour démarrer les miens : Je dois installer des composants JBI (ne marchera pas si je laisse Fractal les installer trop tôt), lier des services (ne marchera pas si mes composants ne sont pas installés et si le service de management de Petals n&#8217;est pas démarré), lancer des tâches de fond, etc&#8230;</p>
<p>l&#8217;API du kernel de Petals propose l&#8217;interface o<em>rg.ow2.petals.kernel.api.server.PetalsStateListener</em> :</p>
<pre class="brush: java;">
package org.ow2.petals.kernel.api.server;

/**
 * Listener notified when a Petals container finish to start or to stop.
 */
public interface PetalsStateListener {

    /**
     * Callback method on PEtALS start up
     */
    void onPetalsStarted();

    /**
     * Callback method on PEtALS stop
     *
     * @param success
     *            {@code true} if PEtALS has stopped successfully
     * @param exception
     *            the exception if the stop has failed, {@code null} otherwise
     */
    void onPetalsStopped(boolean success, Exception exception);
}
&lt;pre&gt;</pre>
<p>Cette interface n&#8217;est malheureusement utilisée que statiquement et une seule fois pour informer le &#8216;launcher&#8217; que le kernel est bien démarré. On a pourtant <em>org.ow2.petals.kernel.api.server.PetalsServer</em> qui définit la méthode <em>addPetalsStateListener(PetalsStateListener)</em>. je vais donc utiliser cette API et modifier simplement l&#8217;implémentation de <em>org.ow2.petals.kernel.api.server.PetalsServer</em> pour ajouter des listeners qui seront appelés lors du démarrage et de l&#8217;arrêt de Petals.</p>
<p>Pour ce faire deux approches sont possibles :</p>
<ol>
<li>Rechercher tous les composants Fractal qui implémentent <em>org.ow2.petals.kernel.api.server.PetalsStateListener</em></li>
<li>Créer un manager qui contient une liste ordonnée de tous les <em>org.ow2.petals.kernel.api.server.PetalsStateListener</em></li>
</ol>
<p>On va ici se pencher sur la solution 2 car la solution 1 ne permet d&#8217;ordonner facilement les listeners à appeler (ca peut valoir le coup de les appeler dans un sens bien définit!).</p>
<p><strong>1/ Le manager de listeners</strong></p>
<p>Simplement un composant Fractal qui détient la liste des listeners définis. Ces listeners sont définis par configuration dans les fichiers ADL de Petals. Son interface :</p>
<pre class="brush: java;">
package foo.bar.petals.kernel.listener;

import java.util.Set;

import org.ow2.petals.kernel.api.server.PetalsStateListener;

/**
 * @author chamerling - eBM WebSourcing
 *
 */
public interface LifeCycleListenerManager {

    /**
     * The binding prefix of the component which is listening petals state
     */
    static final String PREFIX = &quot;petals-state-listener-&quot;;

    /**
     * Get an ordered set of listeners
     *
     * @return
     */
    Set&lt;PetalsStateListener&gt; getListeners();

}
</pre>
<p>et son implémentation :</p>
<pre class="brush: java;">
package foo.bar.petals.kernel.listener;

import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import org.objectweb.fractal.fraclet.annotation.annotations.FractalComponent;
import org.objectweb.fractal.fraclet.annotation.annotations.Interface;
import org.objectweb.fractal.fraclet.annotation.annotations.LifeCycle;
import org.objectweb.fractal.fraclet.annotation.annotations.Monolog;
import org.objectweb.fractal.fraclet.annotation.annotations.Provides;
import org.objectweb.fractal.fraclet.annotation.annotations.Requires;
import org.objectweb.fractal.fraclet.annotation.annotations.type.Cardinality;
import org.objectweb.fractal.fraclet.annotation.annotations.type.Contingency;
import org.objectweb.fractal.fraclet.annotation.annotations.type.LifeCycleType;
import org.objectweb.util.monolog.api.Logger;
import org.ow2.petals.kernel.api.server.PetalsStateListener;
import org.ow2.petals.util.LoggingUtil;

/**
 * @author chamerling
 *
 */
@FractalComponent
@Provides(interfaces = { @Interface(name = &quot;service&quot;, signature = LifeCycleListenerManager.class) })
public class LifeCycleListenerManagerImpl implements LifeCycleListenerManager {

    @Monolog(name = &quot;logger&quot;)
    private Logger logger;

    private LoggingUtil log;

    @Requires(name = PREFIX, signature = PetalsStateListener.class, cardinality = Cardinality.COLLECTION, contingency = Contingency.OPTIONAL)
    private final Map&lt;String, Object&gt; listeners = new Hashtable&lt;String, Object&gt;();

    @LifeCycle(on = LifeCycleType.START)
    protected void start() {
        this.log = new LoggingUtil(this.logger);
        this.log.debug(&quot;Starting...&quot;);
    }

    @LifeCycle(on = LifeCycleType.STOP)
    protected void stop() {
        this.log.debug(&quot;Stopping...&quot;);
    }

    /**
     * {@inheritDoc}
     */
    public Set&lt;PetalsStateListener&gt; getListeners() {
        HashSet&lt;PetalsStateListener&gt; result = new HashSet&lt;PetalsStateListener&gt;();
        if (this.listeners != null) {
            Iterator&lt;String&gt; iter = this.listeners.keySet().iterator();
            while (iter.hasNext()) {
                String key = iter.next();
                Object o = this.listeners.get(key);
                if (o instanceof PetalsStateListener) {
                    result.add((PetalsStateListener) o);
                } else {
                    // warning
                    this.log.warning(o + &quot; is not an instance of &quot;
                            + PetalsStateListener.class.getCanonicalName());
                }
            }
        }
        return result;
    }
}
</pre>
<p>A noter que la Map &#8216;listeners&#8217; est remplie par Fractal au démarrage de Petals.</p>
<p><strong>2/ Modification de PetalsServerImpl</strong></p>
<p>Dans <em>org.ow2.petals.kernel.server.PetalsServerImpl</em> je rajoute la méthode <em>initListeners()</em> :</p>
<pre class="brush: java;">
   private void initListeners() {
        // get the component which owns the listeners
        Component listenerManagerComponent = FractalHelper.getRecursiveComponentByName(
                this.petalsContentController, Constants.FRACTAL_LISTENERS_MANAGER);
        if (listenerManagerComponent != null) {
            try {
                LifeCycleListenerManager manager = (LifeCycleListenerManager) listenerManagerComponent
                        .getFcInterface(&quot;service&quot;);

                if (manager != null) {
                    Set&lt;PetalsStateListener&gt; listeners = manager.getListeners();
                    for (PetalsStateListener petalsStateListener : listeners) {
                        this.addPetalsStateListener(petalsStateListener);
                    }
                } else {
                }
            } catch (Exception e) {
            }
        }

    }
</pre>
<p>Ce code permet de retrouver mon &#8216;listener manager&#8217; (puisque PetalsServerImpl n&#8217;est pas &#8216;Fractalisé&#8217;) et de remplir la liste des listeners. Allez maintenant, on va dire que j&#8217;appelle cette méthode d&#8217;initialisation juste avant d&#8217;appeler les listeners (dans <em>start()</em> de <em>PetalsServerImpl</em>):</p>
<pre class="brush: java;">
    public void start() throws PetalsException {
        // get listeners which have been defined by configuration (Fractal)
        this.initListeners();

        // notify the listener if there is one
        for (PetalsStateListener petalsListener : this.petalsListeners) {
            petalsListener.onPetalsStarted();
        }
    }
</pre>
<p><strong>3/ Configuration des listeners</strong></p>
<p>Dans les fichiers de définition des composants Fractal, je peux maintenant instancier mes listeners et les ajouter à la liste des listeners gérée par le manager de listeners :</p>
<pre class="brush: xml;">
	&lt;!-- lifeCycle Listeners --&gt;
	&lt;component definition=&quot;foo.bar.petals.kernel.FooService&quot; name=&quot;Foo&quot; /&gt;
	&lt;component definition=&quot;foo.bar.petals.kernel.BarService&quot; name=&quot;Bar&quot; /&gt;

	&lt;!-- Listeners manager --&gt;
	&lt;component definition=&quot;eu.soa4all.dsb.petals.kernel.listener.LifeCycleListenerManagerImpl&quot; name=&quot;LifeCycleListenerManagerImpl&quot; /&gt;

	&lt;!-- Fill the map --&gt;
	&lt;binding client=&quot;LifeCycleListenerManagerImpl.petals-state-listener-foo&quot; server=&quot;Foo.service&quot; /&gt;
	&lt;binding client=&quot;LifeCycleListenerManagerImpl.petals-state-listener-bar&quot; server=&quot;Bar.service&quot; /&gt;
</pre>
<p>Le composant <em>foo.bar.petals.kernel.*Listener</em> implémentent  <em>org.ow2.petals.kernel.api.server.PetalsStateListener</em> et sont ajoutés à la liste des listeners managés par <em>LifeCycleListenerManagerImpl</em> lors de la définition des liens (lignes &#8216;binding&#8217;). Tous les listeners ajoutés au manager doivent avoir une valeur de l&#8217;attribut client commençant obligatoirement par <em>LifeCycleListenerManagerImpl.petals-state-listener-</em> (remplissage de la Map par Fractal).</p>
<p>Facile et pratique, non?!</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chamerling.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chamerling.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chamerling.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chamerling.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chamerling.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chamerling.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chamerling.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chamerling.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chamerling.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chamerling.wordpress.com/350/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&blog=3069558&post=350&subd=chamerling&ref=&feed=1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/LJBNMUDON0E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chamerling.wordpress.com/2010/03/12/extensions-de-petals-esb-lifecyclelistener/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chamerling.wordpress.com/2010/03/12/extensions-de-petals-esb-lifecyclelistener/</feedburner:origLink></item>
		<item>
		<title>Mapping WSDL JBI</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/Xf5WWx0TjLU/</link>
		<comments>http://chamerling.wordpress.com/2010/03/11/mapping-wsdl-jbi/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 12:52:03 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[Petals ESB]]></category>
		<category><![CDATA[WebService]]></category>
		<category><![CDATA[jbi]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[ow2]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[wsdl]]></category>
		<category><![CDATA[petalspourlesnuls]]></category>

		<guid isPermaLink="false">http://chamerling.wordpress.com/?p=331</guid>
		<description><![CDATA[Cet article fait suite à une question récurrente des utilisateurs de Petals ESB : &#171;&#160;Pourquoi j&#8217;ai une erreur au déploiement de mon service???&#160;&#187;. Je vais ici tenter de donner une réponse partielle à cette question car il peut y avoir beaucoup de raisons à une erreur de déploiement. La plus courante venant souvent de la [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&#38;blog=3069558&#38;post=331&#38;subd=chamerling&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Cet article fait suite à une question récurrente des utilisateurs de Petals ESB : &laquo;&nbsp;Pourquoi j&#8217;ai une erreur au déploiement de mon service???&nbsp;&raquo;. Je vais ici tenter de donner une réponse partielle à cette question car il peut y avoir beaucoup de raisons à une erreur de déploiement. La plus courante venant souvent de la configuration. Rien que bien technique ni compliqué dans cet article, juste un mini tutoriel pour mieux comprendre la philosophie Petals &#8211; JBI.</p>
<p>La spécification <a href="http://www.jcp.org/en/jsr/detail?id=208">JBI</a> est basée sur l&#8217;état de l&#8217;art des Web services et donc utilise WSDL pour la description des services &#8216;hostés&#8217; ou liés à l&#8217;implémentation JBI. <a href="http://petals.ow2.org">Petals ESB</a> implémente (et étend &#8211; mais ça sera peut être l&#8217;objet d&#8217;un autre article sur le pourquoi du comment&#8230;) la spécification JBI depuis sa première version. Petals ESB est même certifié compatible JBI par SUN (RIP) après le passage du TCK JBI (Outil de test de compatibilité fournit par SUN). Bref, là n&#8217;est pas la question&#8230; Les descripteurs JBI servent à beaucoup de choses dans une implémentation JBI mais nous allons particulièrement regarder comment nous nous en servons dans l&#8217;exposition de services.</p>
<p>Un service exposé dans le bus fournit donc sa description via un WSDL associé. Ce service est activé dans le bus après le déploiement de ce que l&#8217;on appelle communément une &#8216;SA&#8217; (Service Assembly) qui contient des &#8216;SU&#8217; (Service Unit). Pour exposer un service dans le bus afin qu&#8217;il soit accessible à tout les consommateurs, la SU doit être en mode &#8216;provide&#8217; ie fournisseur. Elle doit aussi définir le Endpoint, le Service et l&#8217;Interface qu&#8217;elle veut exposer. Prenons l&#8217;exemple du bon vieux service HelloWorld définit par le WSDL suivant :</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
&lt;ns2:definitions name=&quot;HelloServiceImplService&quot; targetNamespace=&quot;http://sample.petals.ow.org/&quot; xmlns:ns2=&quot;http://schemas.xmlsoap.org/wsdl/&quot; xmlns:ns3=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
	xmlns:ns9=&quot;http://www.w3.org/ns/wsdl/http&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:ns5=&quot;http://schemas.xmlsoap.org/wsdl/soap12/&quot; xmlns:ns6=&quot;http://schemas.xmlsoap.org/wsdl/http/&quot;
	xmlns:ns10=&quot;http://schemas.xmlsoap.org/wsdl/mime/&quot; xmlns:ns7=&quot;http://www.w3.org/ns/wsdl&quot; xmlns:ns8=&quot;http://www.w3.org/ns/wsdl/soap&quot;&gt;
	&lt;ns2:types&gt;
		&lt;xs:schema elementFormDefault=&quot;unqualified&quot; attributeFormDefault=&quot;unqualified&quot; targetNamespace=&quot;http://sample.petals.ow.org/&quot;&gt;
			&lt;xs:element name=&quot;sayHello&quot; type=&quot;tns:sayHello&quot; xmlns:tns=&quot;http://sample.petals.ow.org/&quot; /&gt;
			&lt;xs:element name=&quot;sayHelloResponse&quot; type=&quot;tns:sayHelloResponse&quot; xmlns:tns=&quot;http://sample.petals.ow.org/&quot; /&gt;
			&lt;xs:complexType name=&quot;sayHello&quot;&gt;
				&lt;xs:sequence&gt;
					&lt;xs:element name=&quot;arg0&quot; minOccurs=&quot;0&quot; type=&quot;xs:string&quot; /&gt;
				&lt;/xs:sequence&gt;
			&lt;/xs:complexType&gt;
			&lt;xs:complexType name=&quot;sayHelloResponse&quot;&gt;
				&lt;xs:sequence&gt;
					&lt;xs:element name=&quot;return&quot; minOccurs=&quot;0&quot; type=&quot;xs:string&quot; /&gt;
				&lt;/xs:sequence&gt;
			&lt;/xs:complexType&gt;
		&lt;/xs:schema&gt;
	&lt;/ns2:types&gt;
	&lt;ns2:message name=&quot;sayHelloResponse&quot;&gt;
		&lt;ns2:part element=&quot;tns:sayHelloResponse&quot; name=&quot;parameters&quot; xmlns:tns=&quot;http://sample.petals.ow.org/&quot; /&gt;
	&lt;/ns2:message&gt;
	&lt;ns2:message name=&quot;sayHello&quot;&gt;
		&lt;ns2:part element=&quot;tns:sayHello&quot; name=&quot;parameters&quot; xmlns:tns=&quot;http://sample.petals.ow.org/&quot; /&gt;
	&lt;/ns2:message&gt;
	&lt;ns2:portType name=&quot;HelloService&quot;&gt;
		&lt;ns2:operation name=&quot;sayHello&quot;&gt;
			&lt;ns2:input message=&quot;tns:sayHello&quot; name=&quot;sayHello&quot; xmlns:tns=&quot;http://sample.petals.ow.org/&quot; /&gt;
			&lt;ns2:output message=&quot;tns:sayHelloResponse&quot; name=&quot;sayHelloResponse&quot; xmlns:tns=&quot;http://sample.petals.ow.org/&quot; /&gt;
		&lt;/ns2:operation&gt;
	&lt;/ns2:portType&gt;
	&lt;ns2:binding type=&quot;tns:HelloService&quot; name=&quot;HelloServiceImplServiceSoapBinding&quot; xmlns:tns=&quot;http://sample.petals.ow.org/&quot;&gt;
		&lt;ns3:binding style=&quot;document&quot; transport=&quot;http://schemas.xmlsoap.org/soap/http&quot; /&gt;
		&lt;ns2:operation name=&quot;sayHello&quot;&gt;
			&lt;ns3:operation style=&quot;document&quot; soapAction=&quot;&quot; /&gt;
			&lt;ns2:input name=&quot;sayHello&quot;&gt;
				&lt;ns3:body use=&quot;literal&quot; /&gt;
			&lt;/ns2:input&gt;
			&lt;ns2:output name=&quot;sayHelloResponse&quot;&gt;
				&lt;ns3:body use=&quot;literal&quot; /&gt;
			&lt;/ns2:output&gt;
		&lt;/ns2:operation&gt;
	&lt;/ns2:binding&gt;
	&lt;ns2:service name=&quot;HelloServiceImplService&quot;&gt;
		&lt;ns2:port binding=&quot;tns:HelloServiceImplServiceSoapBinding&quot; name=&quot;HelloServiceImplPort&quot; xmlns:tns=&quot;http://sample.petals.ow.org/&quot;&gt;
			&lt;ns3:address location=&quot;http://localhost:9999/sample/HelloService&quot; /&gt;
		&lt;/ns2:port&gt;
	&lt;/ns2:service&gt;
&lt;/ns2:definitions&gt;
&lt;pre&gt;</pre>
<p>Son descripteur JBI associé sera donc (lié a Petals via le composant Web service dans cet exemple) :</p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;jbi:jbi version=&quot;1.0&quot;
        xmlns:generatedNs=&quot;http://sample.petals.ow.org/&quot;
        xmlns:jbi=&quot;http://java.sun.com/xml/ns/jbi&quot;
	xmlns:petalsCDK=&quot;http://petals.ow2.org/components/extensions/version-5&quot;
	xmlns:soap=&quot;http://petals.ow2.org/components/soap/version-4&quot;
	xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;

	&lt;jbi:services binding-component=&quot;true&quot;&gt;
		&lt;jbi:provides interface-name=&quot;generatedNs:HelloService&quot;
			service-name=&quot;generatedNs:HelloServiceImplService&quot;
			endpoint-name=&quot;HelloServiceImplPort&quot;&gt;

			&lt;!-- CDK specific elements --&gt;
			&lt;petalsCDK:timeout&gt;60000&lt;/petalsCDK:timeout&gt;
			&lt;petalsCDK:wsdl&gt;Service.wsdl&lt;/petalsCDK:wsdl&gt;

			&lt;!-- Component specific elements --&gt;
			&lt;soap:address&gt;http://localhost:9999/sample/HelloService&lt;/soap:address&gt;
			&lt;soap:soap-version&gt;11&lt;/soap:soap-version&gt;
			&lt;soap:add-root&gt;false&lt;/soap:add-root&gt;
			&lt;soap:chunked-mode&gt;false&lt;/soap:chunked-mode&gt;
			&lt;soap:cleanup-transport&gt;true&lt;/soap:cleanup-transport&gt;
			&lt;soap:mode&gt;SOAP&lt;/soap:mode&gt;
		&lt;/jbi:provides&gt;
	&lt;/jbi:services&gt;
&lt;/jbi:jbi&gt;
</pre>
<p>Où on respecte bien que :</p>
<ol>
<li>JBI &#8216;<strong>endpoint-name</strong>&#8216; = Valeur de l&#8217;attribut &#8216;name&#8217; du <strong>Port</strong> dans le WSDL</li>
<li>JBI &#8216;<strong>service-name</strong>&#8216; = Valeur de l&#8217;attribut &#8216;name&#8217; du <strong>Service</strong> dans le WSDL (avec JBI Service NameSpace = targetNamespace du WSDL)</li>
<li>JBI &#8216;<strong>interface-name</strong>&#8216; = Valeur de l&#8217;attribut &#8216;name&#8217; du <strong>PortType</strong> dans le WSDL (avec JBI Interface NameSpace = targetNamespace du WSDL)</li>
</ol>
<p>Petals ESB v3.x ne vous insultera plus lors du déploiement de vos services. Une solution simple pour ne pas se faire insulter, est d&#8217;utiliser le <a href="http://www.petalslink.com/fr/produits/petals-studio">Studio Petals</a> qui facilite grandement la vie des développeurs!</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chamerling.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chamerling.wordpress.com/331/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chamerling.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chamerling.wordpress.com/331/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chamerling.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chamerling.wordpress.com/331/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chamerling.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chamerling.wordpress.com/331/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chamerling.wordpress.com/331/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chamerling.wordpress.com/331/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&blog=3069558&post=331&subd=chamerling&ref=&feed=1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/Xf5WWx0TjLU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chamerling.wordpress.com/2010/03/11/mapping-wsdl-jbi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chamerling.wordpress.com/2010/03/11/mapping-wsdl-jbi/</feedburner:origLink></item>
		<item>
		<title>Permgen Space with Eclipse</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/X7K3jWDkv4c/</link>
		<comments>http://vzurczak.wordpress.com/2010/03/10/permgen-space-with-eclipse/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:35:23 +0000</pubDate>
		<dc:creator>Vincent Zurczak</dc:creator>
				<category><![CDATA[Eclipse tips]]></category>

		<guid isPermaLink="false">http://vzurczak.wordpress.com/?p=75</guid>
		<description><![CDATA[Hi,
If you develop Eclipse plug-ins, you are always brought to run an Eclipse application.
It means that to test your plug-ins, you have to launch a second Eclipse from the one where you develop.
One common problem in this case is the PermGen Space issue.
This is in particular true if you test GMF plug-ins or if there [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak.wordpress.com&#38;blog=10081016&#38;post=75&#38;subd=vzurczak&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>If you develop Eclipse plug-ins, you are always brought to run an Eclipse application.<br />
It means that to test your plug-ins, you have to launch a second Eclipse from the one where you develop.</p>
<p>One common problem in this case is the PermGen Space issue.<br />
This is in particular true if you test GMF plug-ins or if there is a lot of class generation.</p>
<p>To solve this, you can modify the permgen space allocated when you run the other Eclipse.<br />
Go into <strong>Run &gt; Debug Configurations</strong>. Select your Eclipse configration and go into the <strong>Arguments</strong> tab.<br />
The field to upate is the <strong>VM Arguments</strong>.</p>
<p>As an example, when running Talend Open Studio in debug, I have to use the following settings.</p>
<pre style="padding-left:30px;">-Xms256m -Xmx1024m -XX:MaxPermSize=512m
</pre>
<p style="text-align:center;"><a href="http://vzurczak.files.wordpress.com/2010/03/configurations1.jpg"><img class="alignnone size-medium wp-image-79" title="Debug Configuration" src="http://vzurczak.files.wordpress.com/2010/03/configurations1.jpg?w=300&#038;h=216" alt="Debug Configuration" width="300" height="216" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/vzurczak.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/vzurczak.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/vzurczak.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/vzurczak.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/vzurczak.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/vzurczak.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/vzurczak.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/vzurczak.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/vzurczak.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/vzurczak.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=vzurczak.wordpress.com&blog=10081016&post=75&subd=vzurczak&ref=&feed=1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/X7K3jWDkv4c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vzurczak.wordpress.com/2010/03/10/permgen-space-with-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://vzurczak.wordpress.com/2010/03/10/permgen-space-with-eclipse/</feedburner:origLink></item>
		<item>
		<title>Axis2 : Rerouter vos appels de services sans modifier vote code client</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/7LJTesrkw0Q/</link>
		<comments>http://chamerling.wordpress.com/2010/03/09/axis2-rerouter-vos-appels-de-services-sans-modifier-vote-code-client/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 16:08:14 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[WebService]]></category>
		<category><![CDATA[axis2]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[wsdl]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[routage]]></category>

		<guid isPermaLink="false">http://chamerling.wordpress.com/?p=317</guid>
		<description><![CDATA[Imaginons que vous ayez à votre disposition un client de Web service et que pour une raison (qui doit être bonne je l&#8217;accorde), vous avez besoin de rerouter vos appels de service vers un nouveau point d&#8217;accès. Le problème est que vous n&#8217;avez pas le droit de modifier le code client (ou que vous ne [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&#38;blog=3069558&#38;post=317&#38;subd=chamerling&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Imaginons que vous ayez à votre disposition un client de Web service et que pour une raison (qui doit être bonne je l&#8217;accorde), vous avez besoin de rerouter vos appels de service vers un nouveau point d&#8217;accès. Le problème est que vous n&#8217;avez pas le droit de modifier le code client (ou que vous ne l&#8217;avez pas), que vous ne voulez pas regénérer ce code client à partir du WSDL du nouveau service a appeler (qui est exactement le même hormis l&#8217;adresse du endpoint)&#8230; Heureusement, votre client utilise la pile Web service Apache Axis2, et les développeurs d&#8217;Axis2 ont gentiment pensé à introduire des modules dans leur architecture. Une bonne intorduction aux modules est disponible dans <a href="http://ws.apache.org/axis2/1_4_1/Axis2ArchitectureGuide.html">le guide d&#8217;architecture d&#8217;Axis2</a>.</p>
<p>Nous allons donc développer un <a href="http://ws.apache.org/axis2/1_4_1/modules.html">module</a> qui change dynamiquement l&#8217;URL de l&#8217;endpoint à appeler (on utilisera bien sûr Maven2 pour nous aider à créer et packager le projet&#8230;).</p>
<p><strong>1. Créer le projet</strong></p>
<p>Utilisons Maven2 pour créer un projet :</p>
<pre class="brush: bash;">
mvn archetype:generate
</pre>
<p>et je réponds bêtement a Maven quand il me pose des questions sur le groupId, l&#8217;artifactId, etc&#8230; Une fois créé, je génère le projet Eclipse associé et je l&#8217;importe (Eclipse fait aussi parti de mes grand amis) :</p>
<pre class="brush: bash;">
mvn eclipse:eclipse
</pre>
<p>Ill faut modifier le POM pour dire a Maven que l&#8217;on est en train de créer un projet qui n&#8217;est pas une librarie Java mais un module Axis2. Ceci est possible en spécifiant le type de projet dans le POM et en déclarant que l&#8217;on veut utiliser le plugin MAR fournit par Axis2 :</p>
<pre class="brush: xml;">

&lt;project ...&gt;

...

&lt;groupId&gt;foo.bar&lt;/groupId&gt;
&lt;artifactId&gt;reroute&lt;/artifactId&gt;
&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
&lt;packaging&gt;mar&lt;/packaging&gt;

...

&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.apache.axis2&lt;/groupId&gt;
&lt;artifactId&gt;axis2-kernel&lt;/artifactId&gt;
&lt;version&gt;1.5.1&lt;/version&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;

...

&lt;build&gt;
&lt;plugins&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.apache.axis2&lt;/groupId&gt;
&lt;artifactId&gt;axis2-mar-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;1.5.1&lt;/version&gt;
&lt;extensions&gt;true&lt;/extensions&gt;
&lt;configuration&gt;
&lt;moduleXmlFile&gt;src/main/META-INF/module.xml&lt;/moduleXmlFile&gt;
&lt;includeDependencies&gt;false&lt;/includeDependencies&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;/plugins&gt;
&lt;/build&gt;
...
&lt;/project&gt;
</pre>
<p><strong>2. Business code</strong></p>
<p>Créons maintenant notre handler (le module est en fait un handler Axis2 packagé dans une archive avec un descripteur de module). Pour faire simple, je vais étendre la classe AbstractHandler pour créer mon Handler de reroutage et remplacer le &#8216;target EPR&#8217; par le nouveau (bien sûr on peut faire quelque chose de beaucoup plus évolué, on va dire qu&#8217;ici tout part vers un seul service) :</p>
<pre class="brush: java;">
package net.chamerling.blog.axis2module.reroute;

import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.context.MessageContext;
import org.apache.axis2.handlers.AbstractHandler;
import org.apache.axis2.util.LoggingControl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * @author chamerling
 *
 */
public class ReRouteHandler extends AbstractHandler {
	private static final Log log = LogFactory.getLog(AbstractHandler.class);

	private static final String FINAL_EPR_PREFIX = &quot;http://localhost:8082/petals/proxy/&quot;;

	/**
	 * {@inheritDoc}
	 */
	public InvocationResponse invoke(MessageContext messageContext)
			throws AxisFault {
		EndpointReference toEPR = messageContext.getOptions().getTo();
		String finalEPR = FINAL_EPR_PREFIX + toEPR.getAddress();

		if (LoggingControl.debugLoggingAllowed &amp;&amp; log.isDebugEnabled()) {
			log.debug(&quot;Reroute Handler for message : &quot;
					+ messageContext.getMessageID());
			log.debug(&quot;Initial ToEPR is &quot; + toEPR.getAddress()
					+ &quot; and is changed to &quot; + finalEPR);
		}

		toEPR.setAddress(finalEPR);
		return InvocationResponse.CONTINUE;
	}
}
&lt;pre&gt;</pre>
<p>Avec Axis2 c&#8217;est &#8216;facile&#8217;, tout est dans le message context! Je viens de remplacer le service à appeler par le mien en modifiant le champ &#8216;address&#8217; du &#8216;EndpointReference&#8217;.</p>
<p><strong>3. Packager le module</strong></p>
<p>Pour créer un module avec le Handler que l&#8217;on vient de définir, il faut passer par l&#8217;écriture du fichier de description du module, le &#8216;module.xml&#8217;. Ici c&#8217;est simple :</p>
<pre class="brush: xml;">
&lt;module name=&quot;reroute&quot;&gt;
	&lt;OutFlow&gt;
		&lt;handler name=&quot;ReRouteHandler&quot; class=&quot;net.chamerling.blog.axis2module.reroute.ReRouteHandler&quot;&gt;
			&lt;order phase=&quot;reroutePhase&quot; /&gt;
		&lt;/handler&gt;
	&lt;/OutFlow&gt;
&lt;/module&gt;
&lt;pre&gt;</pre>
<p>Mon module s&#8217;appellera donc &#8216;reroute&#8217; et sera appelé que lors de la phase d&#8217;émission de message &#8216;OutFlow&#8217;. Plus d&#8217;informations sur ce qui est possible avec ce fichier sur le site d&#8217;Axis2.</p>
<p><strong>4. Configurer Axis2</strong></p>
<p>Il y a plusieurs façcons de dire à Axis2 d&#8217;utiliser le module que l&#8217;on vient de développer. En se basant sur la contrainte de départ, je n&#8217;ai pas le droit de modifier mes services donc je ne peux pas modifier le descripteur de service &#8217;service.xml&#8217;. Heureusement, j&#8217;ai accès au serveur et je peux modifier le fichier de configuration d&#8217;Axis2 &#8216;axis2.xml&#8217; :</p>
<pre class="brush: xml;">
...
&lt;!-- Engage the reroute module --&gt;
&lt;module ref=&quot;reroute&quot; /&gt;
...
&lt;phaseOrder type=&quot;OutFlow&quot;&gt;
	&lt;!--      user can add his own phases to this area  --&gt;
	&lt;phase name=&quot;soapmonitorPhase&quot; /&gt;
	&lt;phase name=&quot;OperationOutPhase&quot; /&gt;
	&lt;!--system predefined phase--&gt;
	&lt;!--these phase will run irrespective of the service--&gt;
	&lt;phase name=&quot;PolicyDetermination&quot; /&gt;
	&lt;phase name=&quot;reroutePhase&quot; /&gt;
	&lt;phase name=&quot;MessageOut&quot; /&gt;
	&lt;phase name=&quot;Security&quot; /&gt;
&lt;/phaseOrder&gt;
&lt;pre&gt;</pre>
<p>Je viens d&#8217;engager mon module pour tous les services et je l&#8217;ai aussi ajouté dans la collection de phases qui est appelé lors de l&#8217;émission d&#8217;un message. A chaque fois qu&#8217;un message est envoyé vers un service, on passe donc dans le module que l&#8217;on vient de développer. Je viens donc de modifier les services invoqués sans modifier le code client! Je reviendrais bientôt sur l&#8217;utilisation de ce genre de choses dans un vrai cas d&#8217;usage avec du REST, du SOAP, des PROXYs, de l&#8217;ESB distribué sur le Web (bien sûr avec <a href="http://petals.ow2.org">Petals ESB</a>), etc&#8230;</p>
<p><strong>Resources</strong></p>
<p>Le code de ce &#8216;tutoriel&#8217; est bien sûr disponible sur mon Google Code sous <a href="http://code.google.com/p/chamerling/source/browse/#svn/trunk/blog/reroute-axis2">http://code.google.com/p/chamerling/source/browse/#svn/trunk/blog/reroute-axis2</a>.</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chamerling.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chamerling.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chamerling.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chamerling.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chamerling.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chamerling.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chamerling.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chamerling.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chamerling.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chamerling.wordpress.com/317/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&blog=3069558&post=317&subd=chamerling&ref=&feed=1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/7LJTesrkw0Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chamerling.wordpress.com/2010/03/09/axis2-rerouter-vos-appels-de-services-sans-modifier-vote-code-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chamerling.wordpress.com/2010/03/09/axis2-rerouter-vos-appels-de-services-sans-modifier-vote-code-client/</feedburner:origLink></item>
		<item>
		<title>Maven2 : Deployer ses artefacts sur un repo alternatif en FTP ‘a la mano’</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/K7A7t9Fm6lU/</link>
		<comments>http://chamerling.wordpress.com/2010/03/08/maven2-deployer-ses-artefacts-sur-un-repo-alternatif-en-ftp-a-la-mano/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 10:24:00 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[maven]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[altDeploymentRepository]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[ftp]]></category>

		<guid isPermaLink="false">http://chamerling.wordpress.com/?p=307</guid>
		<description><![CDATA[Le besoin du jour : &#171;&#160;J&#8217;ai des artefacts packagés avec Maven2 et je dois les partager avec des partenaires sans passer par un déploiement standard de mon projet mais en passant par un serveur FTP&#160;&#187;. En plus, en terme de contrainte majeure, je ne veux absolument pas modifier mes bon vieux POMs&#8230;
Bon, comme je le [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&#38;blog=3069558&#38;post=307&#38;subd=chamerling&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Le besoin du jour : &laquo;&nbsp;J&#8217;ai des artefacts packagés avec Maven2 et je dois les partager avec des partenaires sans passer par un déploiement standard de mon projet mais en passant par un serveur FTP&nbsp;&raquo;. En plus, en terme de contrainte majeure, je ne veux absolument pas modifier mes bon vieux POMs&#8230;</p>
<p>Bon, comme je le dis souvent &laquo;&nbsp;Google est ton ami&nbsp;&raquo;, mais aujourd&#8217;hui Google ne l&#8217;est pas (comme le temps dehors, de la neige en Mars a Montpellier, mais ou va-t-on?). Bref, faisons le bêtement :</p>
<pre class="brush: bash;">

mvn deploy -DaltDeploymentRepository=chamerling.maven.snapshot::default::ftp://ftpperso.free.fr/maven/repository/snapshot
</pre>
<p>Je viens de dire a Maven2 de déployer mon artefact sur un repository dont l&#8217;ID est chamerling.maven.snapshot (pour rappel, cela veut dire que Maven2 va aller chercher dans mon settings.xml un serveur dont l&#8217;ID est chamerling.maven.snapshot pour récupérer le login et le mot de passe) en FTP sur l&#8217;URL <a href="ftp://ftpperso.free.fr/maven/repository/snapshot" rel="nofollow">ftp://ftpperso.free.fr/maven/repository/snapshot</a>. Et c&#8217;est la que mon autre ami Maven2 (bon OK je n&#8217;ai que des amis virtuels&#8230;) me dit :</p>
<pre class="brush: plain;">

[INFO] Error retrieving previous build number for artifact 'foo:bar:pom': repository metadata for: 'snapshot foo:bar:1-SNAPSHOT' could not be retrieved from repository: chamerling.maven.snapshot due to an error: Unsupported Protocol: 'ftp': Cannot find wagon which supports the requested protocol: ftp
Component descriptor cannot be found in the component repository: org.apache.maven.wagon.Wagonftp.
</pre>
<p>Ok bon c&#8217;est normal&#8230; Wagon est la librairie de transport abstraite utilisée par Maven2 et par défaut FTP n&#8217;est pas supporté. D&#8217;ailleurs sur le site du plugin deploy de Maven2 on remarque bien qu&#8217;il faut normalement définir dans le POM que l&#8217;on veut utiliser l&#8217;extension FTP de Wagon :</p>
<pre class="brush: xml;">

&lt;build&gt;
&lt;extensions&gt;
&lt;!-- Enabling the use of FTP --&gt;
&lt;extension&gt;
&lt;groupId&gt;org.apache.maven.wagon&lt;/groupId&gt;
&lt;artifactId&gt;wagon-ftp&lt;/artifactId&gt;
&lt;version&gt;1.0-beta-6&lt;/version&gt;
&lt;/extension&gt;
&lt;/extensions&gt;
&lt;/build&gt;
</pre>
<p>Oui mais moi je ne veux pas modifier mon POM! L&#8217;astuce c&#8217;est de rajouter l&#8217;extension FTP-Wagon dans le classpath de Maven2 ie ajouter la librairie Wagon FTP dans M2_HOME/lib et la &#8216;Oh Miracle&#8217;, ca ne marche pas&#8230;</p>
<pre class="brush: plain;">

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------

[INFO] Error retrieving previous build number for artifact 'foo:bar:pom': repository metadata for: 'snapshot foo:bar:1-SNAPSHOT' could not be retrieved from repository: chamerling.maven.snapshot due to an error: Unsupported Protocol: 'ftp': Cannot find wagon which supports the requested protocol: ftp
org.apache.commons.net.ProtocolCommandListener
[INFO] ------------------------------------------------------------------------
</pre>
<p>Normal, Wagon FTP utilise commons-net pour tout ce qui est communication, j&#8217;ajoute donc le JAR de commons-net  2.0 dans mon M2_HOME/lib et là ça marche beaucoup mieux :</p>
<pre class="brush: plain;">

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
</pre><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chamerling.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chamerling.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chamerling.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chamerling.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chamerling.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chamerling.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chamerling.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chamerling.wordpress.com/307/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chamerling.wordpress.com/307/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chamerling.wordpress.com/307/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&blog=3069558&post=307&subd=chamerling&ref=&feed=1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/K7A7t9Fm6lU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chamerling.wordpress.com/2010/03/08/maven2-deployer-ses-artefacts-sur-un-repo-alternatif-en-ftp-a-la-mano/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chamerling.wordpress.com/2010/03/08/maven2-deployer-ses-artefacts-sur-un-repo-alternatif-en-ftp-a-la-mano/</feedburner:origLink></item>
		<item>
		<title>Comment utiliser le SE-POJO (en 1 leçon)</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/QMl1_hzyxHg/</link>
		<comments>http://planet.petalslink.com/home/pygibello/2010/03/01/comment-utiliser-le-se-pojo-en-1-lecon/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 15:41:10 +0000</pubDate>
		<dc:creator>gibello</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://planet.petalslink.com/home/pygibello/?p=6</guid>
		<description><![CDATA[Avez-vous entendu parler du SE-POJO ?
Son principal avantage : pouvoir assez simplement scripter en java des traitements internes à Petals, éventuellement complexes. Par exemple :

Consommer des Endpoint, les orchestrer librement en fonction de conditions.
Faire des traitements spécifiques (comme lire un fichier à un format exotique, le convertir en XML, et l&#8217;envoyer à un autre Endpoint)
Etc&#8230;

Le [...]]]></description>
			<content:encoded><![CDATA[<p>Avez-vous entendu parler du SE-POJO ?</p>
<p>Son principal avantage : pouvoir assez simplement scripter en java des traitements internes à Petals, éventuellement complexes. Par exemple :</p>
<ul>
<li>Consommer des Endpoint, les orchestrer librement en fonction de conditions.</li>
<li>Faire des traitements spécifiques (comme lire un fichier à un format exotique, le convertir en XML, et l&#8217;envoyer à un autre Endpoint)</li>
<li>Etc&#8230;</li>
</ul>
<p>Le problème, c&#8217;est que le POJO est assez peu documenté, à ce jour : la doc est quand même utile, donc lisez-là (<a href="http://download.forge.objectweb.org/petals/petals-se-pojo-2.0.2-en.pdf" >http://download.forge.objectweb.org/petals/petals-se-pojo-2.0.2-en.pdf</a>).</p>
<h2>Etape 1 : Développer un POJO compatible avec Petals et le SE-POJO</h2>
<p>Sous PetalsStudio :</p>
<p>- Créer un projet java &#8220;classique&#8221;, qui contiendra le code de votre POJO. Ce projet aura besoin de librairies de Petals, notamment celles du CDK (component development kit).</p>
<p>Le meilleur moyen de se les procurer, c&#8217;est de dézipper un composant : par exemple, téléchargez le SE-POJO (de toutes façons, vous en aurez besoin), et dézippez-le.</p>
<p>Les librairies dont vous aurez besoin sont les suivantes ([version] désigne les numéros de version, qui peuvent varier&#8230; selon la version ! Prenez celles qui sont dans votre composant POJO) :</p>
<ul>
<li>petals-jbi-[version].jar</li>
<li>petals-cdk-jbidescriptor-[version].jar</li>
<li>petals-cdk-api-[version].jar</li>
<li>petals-cdk-core-[version].jar</li>
</ul>
<p>Copiez ces librairies dans un répertoire de votre projet java (par exemple, un répertoire &#8220;lib/&#8221;), et faites pointer le &#8220;Build path&#8221; d&#8217;Eclipse dessus.</p>
<p>- Créez un package et une classe dans les sources : ce sera l&#8217;implémentation de votre POJO.</p>
<p>Voici un exemple (cet exemple consomme un autre EndPoint : dans mon cas, un &#8220;FileTransfer&#8221; pour enregistrer le message, soit une SU déployée sur le BC-FILETRANSFER. Mais vous pouvez commenter tout le code qui consomme cet Endpoint, et vous contenter d&#8217;un POJO genre &#8220;Hello world&#8221; !) :</p>
<div style="border: 2px solid #000000;overflow: scroll;width: 480px;height: 380px;background-color: #ffffff">
<pre><code>
package org.ow2.petals.test;

import java.io.StringReader;

import javax.jbi.component.ComponentContext;
import javax.xml.namespace.QName;
import javax.xml.transform.stream.StreamSource;

import org.ow2.petals.component.framework.api.Message.MEPConstants;
import org.ow2.petals.component.framework.api.message.Exchange;
import org.ow2.petals.component.framework.jbidescriptor.generated.Consumes;
import org.ow2.petals.component.framework.listener.AbstractJBIListener;

public class TestPojo {
  AbstractJBIListener jbiListener;
  ComponentContext ctx;

  public void setJBIListener(AbstractJBIListener jbiListener) {
    this.jbiListener = jbiListener;
  }
  public void setComponentContext(ComponentContext ctx) {
    this.ctx = ctx;
  }

  public boolean onExchange(Exchange exchange)
  throws Exception {

    // Consume a "provides" endpoint (referenced by Interface/Service/Endpoint name,
    // as specified in the "provides" endpoint's jbi.xml)
    Consumes ep = new Consumes();
    ep.setInterfaceName(new QName("http://petals.test.com", "WriteContentInterface"));
    ep.setServiceName(new QName("http://petals.test.com", "WriteContent"));
    ep.setEndpointName("TestFileEndpoint");

    System.out.println("POJO: before consume");
    Exchange out =
       jbiListener.createConsumeExchange(ep,MEPConstants.IN_ONLY_PATTERN);
    out.setInMessageContent(
       new StreamSource(new StringReader(
         "&lt;pojo&gt;Hello from Pojo !&lt;/pojo&gt;")));

    jbiListener.sendSync(out);
    System.out.println("POJO: consume done");

    // Answer if needed (In[Optional]Out)
    if(exchange.isInOutPattern() || exchange.isInOptionalOutPattern()) {
      System.out.println("POJO: sending response");
      exchange.setOutMessageContent(
         new StreamSource(new StringReader("&lt;pojo&gt;Ok&lt;/pojo&gt;")));
    }

    return true;
  }

  public void init() {
    System.out.println("SamplePojo inits.");
  }
}
</code></pre>
</div>
<p>- Une fois votre POJO prêt, vous devrez le packager sous forme de fichier .jar (File/Export/General/Java/Jar file).<br />
Le fichier .jar résultant pourra ensuite être intégré à votre SU POJO.</p>
<h2>Etape 2 : Créer la SU pour y intégrer votre POJO</h2>
<p>Sous PetalsStudio : File / New / Project / Petals / Use a Petals Technical Service / Use POJO.</p>
<p>Dans la fenêtre &#8220;WSDL File&#8221; (etc&#8230;)</p>
<ul>
<li>Spécifiez des &#8220;namespace&#8221; identiques pour l&#8217;interface et le service (çà doit ressembler à des URL&#8230; exemple : http://pojo.test.org).</li>
<li>Nommez vos Interface / Service / Endpoint à votre convenance.</li>
<li>Inutile de spécifier un WSDL.</li>
</ul>
<p>Dans la fenêtre &#8220;Jar Files&#8221; (etc&#8230;)</p>
<ul>
<li>Donnez le chemin d&#8217;accès vers le jar créé lors de l&#8217;étape précédente (bouton &#8220;browse&#8221;, sélectionnez le fichier jar)</li>
<li>Faites ensuite &#8220;Browse&#8221; pour la boîte &#8220;Service Class&#8221;, vous pourrez y choisir la classe du POJO présent dans votre jar.</li>
</ul>
<p>Terminez le processus (allez jusqu&#8217;à &#8220;Finish&#8221;, et cliquez dessus).</p>
<p>PetalsStudio va alors générer un projet &#8220;su-POJO-&lt;nom-du-projet&gt;-provide, avec un dossier &#8220;resources/&#8221; contenant le fichier jar du POJO, et un dossier META-INF contenant le descripteur de déploiement Petals (jbi.xml).</p>
<p><span style="color: #ff0000">Attention : la version 1.0 Beta2 de PetalsStudio comporte un bug&#8230; à tout hasard, éditez META-INF/jbi.xml. Si vous y trouvez la chaîne suivante :<br />
</span></p>
<p><span style="color: #ff0000">&#8220;</span><span style="color: #ff0000">http://petals.ow2.org/components/extensions/version-4.0&#8243;</span></p>
<p><span style="color: #ff0000">remplacez &#8220;4.0&#8243; par &#8220;5&#8243;, comme ceci :</span></p>
<p><span style="color: #ff0000">&#8220;</span><span style="color: #ff0000">http://petals.ow2.org/components/extensions/version-5&#8243;</span></p>
<p><span style="color: #ff0000">(puis sauvegardez).</span></p>
<p>Cliquez le projet avec le bouton droit, puis &#8220;Petals / Package for Petals&#8221;.</p>
<p>Vous aurez alors un fichier &#8220;sa-POJO-&lt;nom-du-projet&gt;-provide.zip&#8221;, prêt à être déployé dans Petals (comme SU associée au SE-POJO).</p>
<h2>Etape 3 : Déploiement sur Petals</h2>
<ul>
<li>Démarrez Petals</li>
<li>Déployez le SE-POJO</li>
<li>Déployez votre SU générée à l&#8217;étape 2 (sa-POJO-&lt;nom-du-projet&gt;-provide.zip).</li>
</ul>
<p>Et voilà le travail !</p>
<img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/QMl1_hzyxHg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://planet.petalslink.com/home/pygibello/2010/03/01/comment-utiliser-le-se-pojo-en-1-lecon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://planet.petalslink.com/home/pygibello/2010/03/01/comment-utiliser-le-se-pojo-en-1-lecon/</feedburner:origLink></item>
		<item>
		<title>Outils Petals ESB : Librarie pour binder des services Web</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/KpnvAbeqRRw/</link>
		<comments>http://chamerling.wordpress.com/2010/03/01/outils-petals-esb-librarie-pour-binder-des-services-web/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 11:29:55 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[Petals ESB]]></category>
		<category><![CDATA[WebService]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jbi]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[pom]]></category>
		<category><![CDATA[soa]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false">http://chamerling.wordpress.com/?p=303</guid>
		<description><![CDATA[Dans un précédent article, je décrivais comment &#8216;proxifier&#8217; un Web service dans Petals ESB avec un plugin Maven maison. Ce plugin Maven utilise une librairie Java que j&#8217;ai développé pour lier et exposer des Web services dans/avec Petals ESB.
Le &#8216;problème&#8217; actuel de Petals ESB est qu&#8217;il est pleinement basé sur la spécification JBI, cela veut [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&#38;blog=3069558&#38;post=303&#38;subd=chamerling&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Dans un <a href="http://chamerling.wordpress.com/2009/06/02/proxify-web-services-in-petals-with-maven/">précédent article</a>, je décrivais comment &#8216;proxifier&#8217; un Web service dans <a href="http://petals.ow2.org">Petals ESB</a> avec un plugin Maven maison. Ce plugin Maven utilise une librairie Java que j&#8217;ai développé pour lier et exposer des Web services dans/avec Petals ESB.</p>
<p>Le &#8216;problème&#8217; actuel de Petals ESB est qu&#8217;il est <strong>pleinement</strong> basé sur la spécification JBI, cela veut dire que actuellement, si on veut exposer un service JBI en tant que Web service, il faut créer un fichier de configuration (le fameux JBI.xml), le packager dans une unité de service (Service Unit &#8211; SU), et packager cette SU dans un assemblage de services (Service Assembly &#8211; SA). Bien sur des outils comme le Petals Studio sont la pour aider les développeurs à intégrer leurs services, moi je me place plus dans la peau du &#8216;Core Developper&#8217; et je pour le moment je n&#8217;ai pas eu l&#8217;utilité d&#8217;outils graphiques pour configurer Petals.</p>
<p>Dans une de mes taches actuelles, je suis en train d&#8217;étendre Petals pour le faire communiquer sur Internet et je développe ce que j&#8217;appelle l&#8217;API de Monitoring &amp; Management (M&amp;M API) qui est exposée (pour le moment seulement) en Web service. La partie Management de l&#8217;API doit permettre à un administrateur de la plateforme, de &#8216;binder&#8217; des services (Web, REST, &#8230;) sans se soucier de la partie JBI.<br />
L&#8217;API fournit donc une opération du style <em>bind(URI wsdl). </em>Coté serveur, j&#8217;utilise :</p>
<ol>
<li>Une librairie maison de génération de SA</li>
<li>Je déploie localement cette SA pour &#8216;binder&#8217; un Web service au bus.</li>
<li>J&#8217;expose ce service de management avec la feature expliquée dans ce <a href="http://chamerling.wordpress.com/2009/10/07/exposing-fractal-components-as-webservices-in-petals-esb/">post</a></li>
</ol>
<p>Un exemple d&#8217;utilisation de la librairie est donné dans le listing suivant (binder au bus, le Service Web Version de Axis2) :</p>
<pre class="brush: java;">

package org.ow2.petals.tools.generator.jbi;

import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
import org.ow2.petals.tools.generator.jbi.api.JBIGenerationException;
import org.ow2.petals.tools.generator.jbi.ws2jbi.WS2Jbi;

public class BindAxis2Version {

public static void main(String[] args) throws JBIGenerationException, URISyntaxException {

String wsdl = &quot;http://localhost:8080/axis2/services/Version?wsdl&quot;;
Map&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();

// let's say that we want to generate SA for SOAP component 4.0
map.put(org.ow2.petals.tools.generator.commons.Constants.COMPONENT_VERSION, &quot;4.0&quot;);

URI wsdlURI = new URI(wsdl);

File f = new WS2Jbi(wsdlURI, map).generate();

System.out.println(&quot;Service Assembly is available at &quot; + f.getAbsolutePath());

}
}
</pre>
<p>Pour utiliser WS2Jbi, utilisez dans votre projet Maven, la dépendance :</p>
<pre class="brush: xml;">

&lt;dependency&gt;

&lt;groupId&gt;org.ow2.petals.sandbox&lt;/groupId&gt;

&lt;artifactId&gt;petals-ws2jbi&lt;/artifactId&gt;

&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;

&lt;/dependency&gt;
</pre>
<p>Celle ci est normalement disponible est mise a jour régulièrement sur le repository Maven d&#8217;OW2 <a href="http://maven.ow2.org/maven2-snapshot/">http://maven.ow2.org/maven2-snapshot/</a>. Les sources sont disponibles dans ma <a href="http://websvn.ow2.org/listing.php?repname=petals&amp;path=%2Fsandbox%2Fchamerling%2F#path_sandbox_chamerling_">Sandbox Petals</a>.</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chamerling.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chamerling.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chamerling.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chamerling.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chamerling.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chamerling.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chamerling.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chamerling.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chamerling.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chamerling.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&blog=3069558&post=303&subd=chamerling&ref=&feed=1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/KpnvAbeqRRw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chamerling.wordpress.com/2010/03/01/outils-petals-esb-librarie-pour-binder-des-services-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chamerling.wordpress.com/2010/03/01/outils-petals-esb-librarie-pour-binder-des-services-web/</feedburner:origLink></item>
		<item>
		<title>Maven est ton ami #2 : Effective POM</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/KqYl6bcbPl8/</link>
		<comments>http://chamerling.wordpress.com/2010/03/01/maven-est-ton-ami-2-effective-pom/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 10:34:51 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[maven]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://chamerling.wordpress.com/?p=298</guid>
		<description><![CDATA[Après &#171;&#160;Maven est ton ami #1 : Dependency tree&#171;&#160;, le court article du jour est juste une note pour les personnes qui se (et me) demandent souvent pourquoi ils n&#8217;arrivent pas a releaser (entre autres)&#8230;
Ce qui est bien avec Maven2, c&#8217;est que l&#8217;on peut &#8216;overrider&#8217;, utiliser des parents, définir ses mots de passe sans les [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&#38;blog=3069558&#38;post=298&#38;subd=chamerling&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Après &laquo;&nbsp;<a href="http://chamerling.wordpress.com/2009/07/22/maven-est-ton-ami-1-dependency-tree/">Maven est ton ami #1 : Dependency tree</a>&laquo;&nbsp;, le court article du jour est juste une note pour les personnes qui se (et me) demandent souvent pourquoi ils n&#8217;arrivent pas a releaser (entre autres)&#8230;<br />
Ce qui est bien avec Maven2, c&#8217;est que l&#8217;on peut &#8216;overrider&#8217;, utiliser des parents, définir ses mots de passe sans les publier publiquement&#8230; Mais ce qui est moins bien, quand on ne maitrise pas Maven, c&#8217;est que l&#8217;on se perd vite dans toutes ses configurations (ajoutez par dessus un proxy, de l&#8217;authentification, des repositories privés&#8230;). Est c&#8217;est la que l&#8217;on se demande comment on peut s&#8217;y retrouver&#8230;</p>
<p>Heureusement, les gens de chez Maven2 ne sont pas si bêtes, le <a href="http://maven.apache.org/plugins/maven-help-plugin/usage.html">plugin Help</a> permet de lister le POM effectif du projet courant en lancant la commande</p>
<blockquote><p><em># mvn help:effective-pom</em></p></blockquote>
<p>Simple et efficace. Les gens qui se demandent, par exemple, pourquoi ils ne sont pas bien authentifiés lors d&#8217;une release peuvent alors verifier dans le POM généré, que leurs login/password ne sont pas définis pour le bon ID de serveur&#8230;</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chamerling.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chamerling.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chamerling.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chamerling.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chamerling.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chamerling.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chamerling.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chamerling.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chamerling.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chamerling.wordpress.com/298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&blog=3069558&post=298&subd=chamerling&ref=&feed=1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/KqYl6bcbPl8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chamerling.wordpress.com/2010/03/01/maven-est-ton-ami-2-effective-pom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chamerling.wordpress.com/2010/03/01/maven-est-ton-ami-2-effective-pom/</feedburner:origLink></item>
		<item>
		<title>One more JBI component : SOAP Proxy</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/gCw3dShqZhk/</link>
		<comments>http://chamerling.wordpress.com/2010/02/02/one-more-jbi-component-soap-proxy/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 14:38:22 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[Petals ESB]]></category>
		<category><![CDATA[WebService]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jbi]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[ow2]]></category>
		<category><![CDATA[soa]]></category>

		<guid isPermaLink="false">http://chamerling.wordpress.com/?p=287</guid>
		<description><![CDATA[I just developped a new JBI component for Petals ESB. This component, named &#8216;petals-bc-soapproxy&#8217; is based on the work I did on the standard SOAP binding component and provide an easy way to proxify SOAP based Web services with Petals ESB.
This component, based on Apache Axis2, uses a small part of WS-Addressing to provide the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&#38;blog=3069558&#38;post=287&#38;subd=chamerling&#38;ref=&#38;feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I just developped a new JBI component for <a href="http://petals.ow2.org">Petals ESB</a>. This component, named &#8216;petals-bc-soapproxy&#8217; is based on the work I did on the standard SOAP binding component and provide an easy way to proxify SOAP based Web services with Petals ESB.</p>
<p>This component, based on Apache Axis2, uses a small part of WS-Addressing to provide the proxy feature. &#8216;Small part&#8217; means that for now, by using Axis2, I need to bypass the mustUnderstand attribute of the WS-Addressing elements. Why? Because I need to use the WSA:To element to specify the Web service I want to finally invoke and I need to set the mustUnderstand attribute to false to bypass one implementation detail on Axis2 which is not &#8216;friendly&#8217; with my own implementation. Why (again)?&#8230; By setting some mustUnderstand attribute to true in the SOAP message header, it means that the SOAP engine (ie Axis2) must understand the header during message processing. A mustUnderstand attribute set to true in the WS-Addressing header means that the SOAP engine must handle the WS-Addressing information and here I do not want to. If I set this attribute to true, I need to add the Axis2 addressing module, which will handle the WS-Addressing header, and will put all the addressing information in the Axis2 message context. I can do that and get the information from this context for for some reason it does not work like I expect&#8230; Maybe an Axis2 update will fix this&#8230;Need some time to investigate, and for now time is not my friend&#8230; So, here is how it work :</p>
<p><strong>1.</strong> The SOAP client sends the SOAP message to the Petals SOAP Proxy (by default this service is exposed at <a href="http://localhost:8085/petals/services/SOAPProxyWebService)" rel="nofollow">http://localhost:8085/petals/services/SOAPProxyWebService)</a>. The SOAP message header contains the WS-Addressing information which will be used to reach the final Web service. A SOAP message sample is for example :</p>
<pre class="brush: xml;">

&lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:wsap=&quot;http://wsapi.petals.dsb.soa4all.eu/&quot;&gt;
&lt;soapenv:Header xmlns:wsa=&quot;http://www.w3.org/2005/08/addressing&quot;&gt;
&lt;wsa:Action&gt;http://wsapi.petals.dsb.soa4all.eu/HelloService/sayHello&lt;/wsa:Action&gt;
&lt;wsa:To&gt;http://localhost:7600/petals/ws/HelloService&lt;/wsa:To&gt;
&lt;/soapenv:Header&gt;
&lt;soapenv:Body&gt;
&lt;wsap:sayHello&gt;
&lt;!--Optional:--&gt;
&lt;arg0&gt;Say hello!&lt;/arg0&gt;
&lt;/wsap:sayHello&gt;
&lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;
</pre>
<p>where <a href="http://localhost:7600/petals/ws/HelloService" rel="nofollow">http://localhost:7600/petals/ws/HelloService</a> is the final Web service I want to invoke.</p>
<p><strong>2.</strong> The SOAP message is handled by the SOAP proxy component, transformed as JBI message and sent to the right JBI endpoint.</p>
<p><strong>3.</strong> The JBI endpoint gets the WS-Addressing information from the JBI message, the SOAP message from the JBI message payload and send all of this stuff to the final Web service. Invokcation response is sent back to the initial consumer through the ESB.</p>
<p>A simple schema of what happens with three ESB nodes is given in the figure below :</p>
<p><a href="http://chamerling.files.wordpress.com/2010/02/diapositive5.jpg"><img class="aligncenter size-full wp-image-288" title="Diapositive5" src="http://chamerling.files.wordpress.com/2010/02/diapositive5.jpg?w=500&#038;h=375" alt="" width="500" height="375" /></a></p>
<p>So, the main question is why using such a proxy and why not invoking the service directly? There are many answers to these questions and since I already said that the time is a missing resource, it will be probably part of a future article&#8230;</p>
<p>The first version of the component is available on the OW2 SVN repository under my sandbox (have a look to <a href="http://websvn.ow2.org/listing.php?repname=petals&amp;path=%2Fsandbox%2Fchamerling%2Fproxy%2Fpetals-bc-soap%2F#path_sandbox_chamerling_proxy_petals-bc-soap_">http://websvn.ow2.org/listing.php?repname=petals&amp;path=%2Fsandbox%2Fchamerling%2Fproxy%2Fpetals-bc-soap%2F#path_sandbox_chamerling_proxy_petals-bc-soap_</a>)</p>
<p>Note : Using <a href="http://soapui.org">SOAPUI</a> for WS-Addressing testing works fine (even if I had some exchanges with SOAPUI guy (<a href="http://twitter.com/olensmar" rel="nofollow">http://twitter.com/olensmar</a>) on Twitter&#8230;)&#8230; Sorry to have doubts on SOAPUI!</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chamerling.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chamerling.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chamerling.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chamerling.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chamerling.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chamerling.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chamerling.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chamerling.wordpress.com/287/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chamerling.wordpress.com/287/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chamerling.wordpress.com/287/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chamerling.wordpress.com&blog=3069558&post=287&subd=chamerling&ref=&feed=1" /><img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/gCw3dShqZhk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://chamerling.wordpress.com/2010/02/02/one-more-jbi-component-soap-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://chamerling.wordpress.com/2010/02/02/one-more-jbi-component-soap-proxy/</feedburner:origLink></item>
		<item>
		<title>PetalsStudio ou Eclipse Linux : problème de clic souris sur les boutons ?</title>
		<link>http://feedproxy.google.com/~r/PetalsPlanet/~3/mvul5P65OTY/</link>
		<comments>http://planet.petalslink.com/home/pygibello/2010/01/25/petalsstudio-ou-eclipse-linux-probleme-de-clic-souris-sur-les-boutons/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 15:48:03 +0000</pubDate>
		<dc:creator>gibello</dc:creator>
				<category><![CDATA[Non classé]]></category>
		<category><![CDATA[PetalsStudio / Eclipse]]></category>
		<category><![CDATA[PetalsStudio Eclipse souris]]></category>

		<guid isPermaLink="false">http://planet.petalslink.com/home/pygibello/2010/01/25/petalsstudio-ou-eclipse-linux-probleme-de-clic-souris-sur-les-boutons/</guid>
		<description><![CDATA[Symptôme : le clic sur certains boutons (particulièrement les wizards de création de projet &#8211; boutons &#8220;next&#8221;, &#8220;cancel&#8221;, etc&#8230;) reste sans effet, alors que les raccourcis clavier fonctionnent.
Le même problème se produit sur un Eclipse &#8220;standard&#8221;.
Constaté sur un Ubuntu 9.10, ce problème a également été signalé sur d&#8217;autres Linux.
Solution : positionner la variable d&#8217;environnement GDK_NATIVE_WINDOWS [...]]]></description>
			<content:encoded><![CDATA[<p>Symptôme : le clic sur certains boutons (particulièrement les wizards de création de projet &#8211; boutons &#8220;next&#8221;, &#8220;cancel&#8221;, etc&#8230;) reste sans effet, alors que les raccourcis clavier fonctionnent.<br />
Le même problème se produit sur un Eclipse &#8220;standard&#8221;.<br />
Constaté sur un Ubuntu 9.10, ce problème a également été signalé sur d&#8217;autres Linux.</p>
<p>Solution : positionner la variable d&#8217;environnement GDK_NATIVE_WINDOWS à &#8220;true&#8221;.</p>
<p>Exemple :<br />
$ GDK_NATIVE_WINDOWS=true PetalsStudio</p>
<p>Ou:<br />
$ export GDK_NATIVE_WINDOWS=true<br />
$ PetalsStudio</p>
<img src="http://feeds.feedburner.com/~r/PetalsPlanet/~4/mvul5P65OTY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://planet.petalslink.com/home/pygibello/2010/01/25/petalsstudio-ou-eclipse-linux-probleme-de-clic-souris-sur-les-boutons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://planet.petalslink.com/home/pygibello/2010/01/25/petalsstudio-ou-eclipse-linux-probleme-de-clic-souris-sur-les-boutons/</feedburner:origLink></item>
	</channel>
</rss>
