<?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>Christophe Hamerling [Archive] &#187; WebService</title>
	<atom:link href="http://planet.petalslink.com/home/chamerling/tag/webservice/feed/" rel="self" type="application/rss+xml" />
	<link>http://planet.petalslink.com/home/chamerling</link>
	<description>Things around SOA, Web Services, Open Source and more...</description>
	<lastBuildDate>Wed, 07 Oct 2009 13:16:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>EasyWSDL 1.2 is out</title>
		<link>http://planet.petalslink.com/home/chamerling/2009/07/09/easywsdl-12-is-out/</link>
		<comments>http://planet.petalslink.com/home/chamerling/2009/07/09/easywsdl-12-is-out/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 07:26:20 +0000</pubDate>
		<dc:creator>Christophe Hamerling</dc:creator>
				<category><![CDATA[soa]]></category>
		<category><![CDATA[WebService]]></category>
		<category><![CDATA[easywsdl]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false">http://blog.ebmwebsourcing.com/home/chamerling/?p=138</guid>
		<description><![CDATA[OW2 EasyWSDL WSDL manipulation library has just been released. This release fix many bugs and introduces some new tooling such as java2wsdl (create WSDL from Java interfaces) and xsd2xml (create XML from XSD definition). EasyWSDL is easy since you can manipulate both WSDL 1.1 and WSDL 2.0 with the same object model. // Read a [...]]]></description>
			<content:encoded><![CDATA[<p>OW2 EasyWSDL WSDL manipulation library has just been released. This release fix many bugs and introduces some new tooling such as java2wsdl (create WSDL from Java interfaces) and xsd2xml (create XML from XSD definition).</p>
<p>EasyWSDL is easy since you can manipulate both WSDL 1.1 and WSDL 2.0 with the same object model.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Read a WSDL 1.1 or 2.0</span>
WSDLReader reader <span style="color: #339933;">=</span> WSDLFactory.<span style="color: #006633;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">newWSDLReader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Description desc <span style="color: #339933;">=</span> reader.<span style="color: #006633;">readWSDL</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URI<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://file/path/document.wsdl&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Write a WSDL 1.1 or 2.0 (depend of desc version)</span>
<span style="color: #003399;">Document</span> doc <span style="color: #339933;">=</span> WSDLFactory.<span style="color: #006633;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">newWSDLWriter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getDocument</span><span style="color: #009900;">&#40;</span>desc<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Create a WSDL 1.1 or 2.0</span>
Description desc11 <span style="color: #339933;">=</span> WSDLFactory.<span style="color: #006633;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">newDescription</span><span style="color: #009900;">&#40;</span>WSDLVersionConstants.<span style="color: #006633;">WSDL11</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Description desc20 <span style="color: #339933;">=</span> WSDLFactory.<span style="color: #006633;">newInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">newDescription</span><span style="color: #009900;">&#40;</span>WSDLVersionConstants.<span style="color: #006633;">WSDL20</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Once the Description object is loaded from the WSDL document, you can maniulate all parts of the service description. Let&#8217;s look at endpoints :</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Endpoints take place in services.</span>
<span style="color: #666666; font-style: italic;">// Select a service</span>
Service service <span style="color: #339933;">=</span> desc.<span style="color: #006633;">getServices</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// List endpoints</span>
<span style="color: #003399;">List</span> endpoints <span style="color: #339933;">=</span> service.<span style="color: #006633;">getEndpoints</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">// Read specific endpoint</span>
Endpoint specificEndpoint <span style="color: #339933;">=</span> service.<span style="color: #006633;">getEndpoint</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;endpointName&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Add endpoint to service</span>
service.<span style="color: #006633;">addEndpoint</span><span style="color: #009900;">&#40;</span>specificEndpoint<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Remove a specific enpoint</span>
service.<span style="color: #006633;">removeEndpoint</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;endpointName&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Create endpoint</span>
Endpoint createdEndpoint <span style="color: #339933;">=</span> service.<span style="color: #006633;">createEndpoint</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
service.<span style="color: #006633;">addEndpoint</span><span style="color: #009900;">&#40;</span>createdEndpoint<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Easy!</p>
]]></content:encoded>
			<wfw:commentRss>http://planet.petalslink.com/home/chamerling/2009/07/09/easywsdl-12-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proxify Web Services in PEtALS with Maven</title>
		<link>http://planet.petalslink.com/home/chamerling/2009/06/02/proxify-web-services-in-petals-with-maven/</link>
		<comments>http://planet.petalslink.com/home/chamerling/2009/06/02/proxify-web-services-in-petals-with-maven/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 14:16:21 +0000</pubDate>
		<dc:creator>Christophe Hamerling</dc:creator>
				<category><![CDATA[PEtALS]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[WebService]]></category>

		<guid isPermaLink="false">http://blog.ebmwebsourcing.com/home/chamerling/?p=124</guid>
		<description><![CDATA[This is quite the same thing than the previous post where I introduced how to expose JAXWS service in PEtALS ESB with Maven. This time, let&#8217;s proxify a Web service in PEtALS with Maven. Here is the Maven descriptor snippet : &#60;build&#62; &#60;plugins&#62; &#60;plugin&#62; &#60;groupId&#62;org.ow2.petals&#60;/groupId&#62; &#60;artifactId&#62;maven-petals-wsproxy&#60;/artifactId&#62; &#60;version&#62;1.0-SNAPSHOT&#60;/version&#62; &#60;executions&#62; &#60;execution&#62; &#60;id&#62;generate-jbi&#60;/id&#62; &#60;phase&#62;package&#60;/phase&#62; &#60;configuration&#62; &#60;wsdl&#62; http://localhost:8080/Service?wsdl &#60;/wsdl&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>This is quite the same thing than the previous post where I introduced how to expose JAXWS service in <a href="http://petals.ow2.org">PEtALS ESB</a> with Maven. This time, let&#8217;s proxify a Web service in PEtALS with Maven.</p>
<p>Here is the Maven descriptor snippet :</p>
<pre>
&lt;build&gt;
	&lt;plugins&gt;
		&lt;plugin&gt;
			&lt;groupId&gt;org.ow2.petals&lt;/groupId&gt;
			&lt;artifactId&gt;maven-petals-wsproxy&lt;/artifactId&gt;
			&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
			&lt;executions&gt;
				&lt;execution&gt;
					&lt;id&gt;generate-jbi&lt;/id&gt;
					&lt;phase&gt;package&lt;/phase&gt;
					&lt;configuration&gt;
						&lt;wsdl&gt;

http://localhost:8080/Service?wsdl

						&lt;/wsdl&gt;
					&lt;/configuration&gt;
					&lt;goals&gt;
						&lt;goal&gt;wsproxy&lt;/goal&gt;
					&lt;/goals&gt;
				&lt;/execution&gt;
			&lt;/executions&gt;
		&lt;/plugin&gt;
	&lt;/plugins&gt;
&lt;/build&gt;
</pre>
<p>This will generate a JBI Service Assembly that you can then deploy intoo PEtALS to proxify the service defined in http://localhost:8080/Service?wsdl</p>
<p>You can give it a try, the snapshot version is available on the <a href="http://maven.ow2.org">OW2 Maven repository</a>&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://planet.petalslink.com/home/chamerling/2009/06/02/proxify-web-services-in-petals-with-maven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache CXF Clients : null result when using bad client factory</title>
		<link>http://planet.petalslink.com/home/chamerling/2009/04/09/apache-cxf-clients-null-result-when-using-bad-client-factory/</link>
		<comments>http://planet.petalslink.com/home/chamerling/2009/04/09/apache-cxf-clients-null-result-when-using-bad-client-factory/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 13:12:06 +0000</pubDate>
		<dc:creator>Christophe Hamerling</dc:creator>
				<category><![CDATA[WebService]]></category>
		<category><![CDATA[cxf]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.ebmwebsourcing.com/home/chamerling/?p=91</guid>
		<description><![CDATA[Just a quick note to show that the client factory choice is important with Apache CXF 2.1.4. The service interface definition : package org.ow2.petals.usecase.soapaddressing.server; &#160; import javax.jws.WebMethod; import javax.jws.WebService; &#160; /** * @author chamerling - eBM WebSourcing * */ @WebService public interface AddressingService &#123; &#160; /** * Get the local information * * @return */ [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to show that the client factory choice is important with Apache CXF 2.1.4.</p>
<p><strong>The service interface definition :</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">org.ow2.petals.usecase.soapaddressing.server</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jws.WebMethod</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jws.WebService</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * @author chamerling - eBM WebSourcing
 *
 */</span>
@WebService
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> AddressingService <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Get the local information
     * 
     * @return
     */</span>
    @WebMethod
    <span style="color: #003399;">String</span> getInfo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>The client with the bad client factory :</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">org.ow2.petals.usecase.soapaddressing.client</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.cxf.frontend.ClientProxyFactoryBean</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.ow2.petals.usecase.soapaddressing.server.AddressingService</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * @author chamerling - eBM WebSourcing
 *
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> BadFactory <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * @param args
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        ClientProxyFactoryBean factory <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ClientProxyFactoryBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        factory.<span style="color: #006633;">setServiceClass</span><span style="color: #009900;">&#40;</span>AddressingService.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        factory.<span style="color: #006633;">setAddress</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://localhost:8084/petals/services/Service01&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        AddressingService client <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>AddressingService<span style="color: #009900;">&#41;</span> factory.<span style="color: #006633;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> info <span style="color: #339933;">=</span> client.<span style="color: #006633;">getInfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>info<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>With that client code, the Web Service is really invoked, but the result of the getInfo operation is null. So, let&#8217;s do it with the right client factory&#8230;</p>
<p><strong>The client with the good client factory :</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">org.ow2.petals.usecase.soapaddressing.client</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.cxf.jaxws.JaxWsProxyFactoryBean</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.ow2.petals.usecase.soapaddressing.server.AddressingService</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * @author chamerling - eBM WebSourcing
 *
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> GoodFactory <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * @param args
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        JaxWsProxyFactoryBean factory <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> JaxWsProxyFactoryBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        factory.<span style="color: #006633;">setServiceClass</span><span style="color: #009900;">&#40;</span>AddressingService.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        factory.<span style="color: #006633;">setAddress</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://localhost:8084/petals/services/Service01&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        AddressingService client <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>AddressingService<span style="color: #009900;">&#41;</span> factory.<span style="color: #006633;">create</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> info <span style="color: #339933;">=</span> client.<span style="color: #006633;">getInfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>info<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This time the result is not null and is really the one expected&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://planet.petalslink.com/home/chamerling/2009/04/09/apache-cxf-clients-null-result-when-using-bad-client-factory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

