<?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>Bandos&#039; Arcade &#187; SOA</title>
	<atom:link href="http://www.nuwanbando.com/tag/soa/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nuwanbando.com</link>
	<description>&#34;It&#039;s not about how it is, but how I see it &#34; - Stranger Than Fiction</description>
	<lastBuildDate>Mon, 30 Aug 2010 07:37:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WSO2 Stratos &#8211; A true cloud story</title>
		<link>http://www.nuwanbando.com/2010/06/wso2-stratos-a-true-cloud-story/</link>
		<comments>http://www.nuwanbando.com/2010/06/wso2-stratos-a-true-cloud-story/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 08:37:15 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[PaaS]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2]]></category>
		<category><![CDATA[WSO2 Stratos]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=479</guid>
		<description><![CDATA[Stratos Services Yesterday (1st of June), A little over a 12 developer team at WSO2, took a great middle-ware platform in to the cloud. It&#8217;s not just putting all our server products on an EC2 instance, but embedding all cloud-native features into them. The PaaS (Platform as a Service) is named as WSO2 Stratos, which [...]]]></description>
			<content:encoded><![CDATA[		<div style="float:right;margin:0px 0px 10px 10px;">
			<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F06%2Fwso2-stratos-a-true-cloud-story%2F&title=WSO2+Stratos+%26%238211%3B+A+true+cloud+story&related=no" ><span style="display:none">Stratos Services Yesterday (1st of June), A little over a 12 developer team at WSO2, took a great middle-ware platform in to the cloud. It&#8217;s not just putting all our server products on an EC2 instance, but embedding all cloud-native features into them. The PaaS (Platform as a Service) is named as WSO2 Stratos, which [...]</span></a>		
		</div>		
		<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F06%2Fwso2-stratos-a-true-cloud-story%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F06%2Fwso2-stratos-a-true-cloud-story%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<div class="mceTemp">
<dl id="attachment_492" class="wp-caption alignleft" style="width: 306px;">
<dt class="wp-caption-dt"><a href="http://www.nuwanbando.com/wp-content/uploads/2010/06/products1.png"><img class="size-full wp-image-492" title="products" src="http://www.nuwanbando.com/wp-content/uploads/2010/06/products1.png" alt="" width="296" height="354" /></a></dt>
<dd class="wp-caption-dd">Stratos  Services</dd>
</dl>
</div>
<p>Yesterday (1st of June), A little over a 12 developer team at WSO2, <a href="http://samisa-abeysinghe.blogspot.com/2010/06/six-weeks-and-12-people-magic.html">took a great middle-ware platform in to the cloud</a>. It&#8217;s not just putting all our server products on an EC2 instance, but embedding all <a href="http://pzf.fremantle.org/2010/05/cloud-native.html">cloud-native</a> features into them. The <a href="http://en.wikipedia.org/wiki/Platform_as_a_service">PaaS</a> (Platform as a Service) is named as WSO2 Stratos, which is based on award winning WSO2 Carbon middle-ware platform. As the Alpha-1 release, Stratos offers number of WSO2 products integrated, namely <a href="http://wso2.com/products/governance-registry">Governance Registry (GREG)</a>, <a href="http://wso2.com/products/identity-server">Identity Server (IS)</a>, <a href="http://wso2.com/products/business-activity-monitor">Business Activity Monitor (BAM)</a>, <a href="http://wso2.com/products/mashup-server">Mashup Server (MS)</a> and <a href="http://wso2.com/products/gadget-server">WSO2 Gadget Server (GS)</a>.</p>
<p>Stratos is also offered as a downloadable version for the private cloud within your enterprise. If you are quite serious about using SOA for your enterprise and do not need to worry about deployment, scalability and server maintenance, Stratos would be the ideal solution for you.</p>
<p><img class="alignnone" src="http://lh6.ggpht.com/_Ni8BgaCmQow/TAUt8ch38JI/AAAAAAAAAUg/C1TTIWkAvco/%5BUNSET%5D.png?imgmax=800" alt="" width="193" height="42" /></p>
<div id="fb-root"></div>
       <script>
       window.fbAsyncInit = function() {
       FB.init({appId: "108492862525832", status: true, cookie: true,
             xfbml: true});
        };
     (function() {
      var e = document.createElement("script"); e.async = true;
     e.src = document.location.protocol +
       "//connect.facebook.net/en_US/all.js";
     document.getElementById("fb-root").appendChild(e);
   }());
   </script><div class = "fb-div"><fb:like href="http://www.nuwanbando.com/2010/06/wso2-stratos-a-true-cloud-story/" layout="standard" show_faces="true" width="450" action="like" colorscheme="light" /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2010/06/wso2-stratos-a-true-cloud-story/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Scraping &amp; Parsing HTML to XML in Javascript</title>
		<link>http://www.nuwanbando.com/2010/04/web-scraping-parsing-html-to-xml-in-javascript/</link>
		<comments>http://www.nuwanbando.com/2010/04/web-scraping-parsing-html-to-xml-in-javascript/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 19:55:50 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Google gadgets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2]]></category>
		<category><![CDATA[WSO2 Gadget Server]]></category>
		<category><![CDATA[WSO2 Mashup Server]]></category>
		<category><![CDATA[Mashup]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=412</guid>
		<description><![CDATA[Today I was working on a customer POC and happened to create few Google gadgets to visualize selected data sets from *.gov.uk sites. The scenario which is implemented was, mixed with inter-gadget communication and content search over data.gov.uk sites. I created three simple gadgets which communicates with each other, and one acted as the controlling [...]]]></description>
			<content:encoded><![CDATA[		<div style="float:right;margin:0px 0px 10px 10px;">
			<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F04%2Fweb-scraping-parsing-html-to-xml-in-javascript%2F&title=Web+Scraping+%26%23038%3B+Parsing+HTML+to+XML+in+Javascript&related=no" ><span style="display:none">Today I was working on a customer POC and happened to create few Google gadgets to visualize selected data sets from *.gov.uk sites. The scenario which is implemented was, mixed with inter-gadget communication and content search over data.gov.uk sites. I created three simple gadgets which communicates with each other, and one acted as the controlling [...]</span></a>		
		</div>		
		<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F04%2Fweb-scraping-parsing-html-to-xml-in-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F04%2Fweb-scraping-parsing-html-to-xml-in-javascript%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Today I was working on a customer POC and happened to create few <a href="http://code.google.com/apis/gadgets/">Google gadgets</a> to visualize selected data sets from *.gov.uk sites. The scenario which is implemented was, mixed with inter-gadget communication and content search over data.gov.uk sites. I created three simple gadgets which communicates with each other, and one acted as the controlling gadget which pushed the search parameters to other two gadgets. The two content gadgets showed UK (1) primary school information and (2) electoral information. The pushed parameter was the postal code of different parts of UK. The <a href="http://www.direct.gov.uk/en/index.htm" target="_blank">direct.gov.uk</a> has a form based implementation of this.</p>
<p><a href="http://www.nuwanbando.com/wp-content/uploads/2010/04/Screenshot.png"><img class="size-medium wp-image-413 alignleft" title="Screenshot" src="http://www.nuwanbando.com/wp-content/uploads/2010/04/Screenshot-241x300.png" alt="" width="241" height="300" /></a></p>
<p>The Requirements for the POC was, simple and we already had working samples of <a href="http://wso2.org/library/articles/2010/03/wso2-gadget-server-inter-gadget-communication-pubsub" target="_blank">such a scenario</a> at WSO2 library.</p>
<ol>
<li>Show how one gadget can pass the context to other gadgets</li>
<li>How gadgets can harvest data in various formats (in my previous post I explained on how to get data from RDF endpoints, which are also available in *.gov.uk sites)</li>
</ol>
<p>The building blocks for the implementation was the search url, which was quite straight forward. for all the requests based on postal codes the direct.gov site served in the same manner (because of this important fact, the automation process became trivial). for an instance the url for primary school information retrial was,</p>
<p><a href="http://local.direct.gov.uk/LDGRedirect/LocationSearch.do?LGSL=13&amp;searchtype=1&amp;LGIL=8&amp;Style=&amp;formsub=t&amp;text=SE1+7DU" target="_blank">http://local.direct.gov.uk/LDGRedirect/LocationSearch.do?LGSL=13&amp;searchtype=1&amp;LGIL=8&amp;Style=&amp;formsub=t&amp;text=<strong>SE1+7DU</strong></a></p>
<p>Where the param &#8220;text&#8221; changed according to the postal code. So far everything seemed straight forward, however at implementation, while using <a href="http://code.google.com/apis/gadgets/docs/dev_guide.html">Gadgets API</a> for content retrial, I faced problems in parsing text with javascript. Hence the <a href="http://code.google.com/apis/opensocial/docs/0.7/reference/gadgets.io.html#makeRequest" target="_blank">gadgets.io.makeRequest </a>supported HTML as text and the API method returned the retrieved HTML document as string making it quite impossible to process.</p>
<p>With some thinking and advise, I brought the <a href="http://wso2.com/products/mashup-server/">Mashup Server</a> in to the picture and used it to retrieve the data from the gov site and returned the result in XML format. Using the Mashup Server web scraping seems to be a piece of cake, We created a simple mashup using the scraper host-object and captured the result set in the search result page. The mashup code as follows,</p>
<pre class="js" name="code">
function search(searchUrl) {
	var scraper = new Scraper(
		<config>
		    <var-def name="url">{searchUrl}</var-def>
			<var-def name="response">
			    <xpath expression="//div[@id='bodyContent']//ul[@class='resultsList']/li/a">
				<html-to-xml>
				   <http method='get' url='${url}'/>
				</html-to-xml>
			     </xpath>
			</var-def>
		</config>
	);
	return new XMLList(scraper.response);
}
</pre>
<p>And finally the two gadgets were making service calls to the mashup service and retrieved the data as an XML object, making the data processing painless. The final version at the Gadget Server looked quite appealing.</p>
<div id="attachment_427" class="wp-caption aligncenter" style="width: 829px"><a href="http://www.nuwanbando.com/wp-content/uploads/2010/04/gs.png"><img class="size-large wp-image-427 " title="gs" src="http://www.nuwanbando.com/wp-content/uploads/2010/04/gs-1024x509.png" alt="WSO2 Gadget Server with UK gov data" width="819" height="407" /></a><p class="wp-caption-text">Gadget Server look - in the end</p></div>
<p>Special thanks goes to <a href="http://ruchirawageesha.blogspot.com/">Ruchira</a> for helping me out with the mashup service <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  You can <a href="http://www.nuwanbando.com/wp-content/uploads/2010/04/wso2gs-samples.zip">download</a> the Gadget code and the Mashup service and try the scenario yourself.</p>
<div id="fb-root"></div>
       <script>
       window.fbAsyncInit = function() {
       FB.init({appId: "108492862525832", status: true, cookie: true,
             xfbml: true});
        };
     (function() {
      var e = document.createElement("script"); e.async = true;
     e.src = document.location.protocol +
       "//connect.facebook.net/en_US/all.js";
     document.getElementById("fb-root").appendChild(e);
   }());
   </script><div class = "fb-div"><fb:like href="http://www.nuwanbando.com/2010/04/web-scraping-parsing-html-to-xml-in-javascript/" layout="standard" show_faces="true" width="450" action="like" colorscheme="light" /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2010/04/web-scraping-parsing-html-to-xml-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mashing up RDF data with WSO2 Mashup Server</title>
		<link>http://www.nuwanbando.com/2010/04/mashing-up-rdf-data-with-wso2-mashup-server/</link>
		<comments>http://www.nuwanbando.com/2010/04/mashing-up-rdf-data-with-wso2-mashup-server/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 20:27:21 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[RDF]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[SPARQL]]></category>
		<category><![CDATA[Semantic web]]></category>
		<category><![CDATA[WSO2]]></category>
		<category><![CDATA[WSO2 Gadget Server]]></category>
		<category><![CDATA[Mashup]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[WSO2 Mashup Server]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=341</guid>
		<description><![CDATA[Okey so this is the fun part that I promised to write about . I managed to cook up a use-case to demonstrate RDF querying and making use of the semantic data. The data that I am using for querying, is the rdf data sources available in the UK data.gov site. With some analysis I [...]]]></description>
			<content:encoded><![CDATA[		<div style="float:right;margin:0px 0px 10px 10px;">
			<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F04%2Fmashing-up-rdf-data-with-wso2-mashup-server%2F&title=Mashing+up+RDF+data+with+WSO2+Mashup+Server&related=no" ><span style="display:none">Okey so this is the fun part that I promised to write about . I managed to cook up a use-case to demonstrate RDF querying and making use of the semantic data. The data that I am using for querying, is the rdf data sources available in the UK data.gov site. With some analysis I [...]</span></a>		
		</div>		
		<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F04%2Fmashing-up-rdf-data-with-wso2-mashup-server%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2010%2F04%2Fmashing-up-rdf-data-with-wso2-mashup-server%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Okey so this is the fun part that I promised to write about <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . I managed to cook up a use-case to demonstrate RDF querying and making use of the semantic data. The data that I am using for querying, is the rdf data sources available in the UK data.gov site. With some analysis I figured out that this task can be fundamentally archived using the combination of Mashup and Gadget Technologies. My choice of tools were <a href="http://wso2.com/products/mashup-server/">WSO2 Mashup Server</a> and <a href="http://wso2.com/products/gadget-server/">WSO2 Gadget Server</a> for their great flexibility and of cause for other obvious reasons <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . However the Mashup Server does not natively support RDF data retrieval, hence I had to do some work to get such functionality integrated. The great fact about the mashup server is its extensibility, the <a href="http://en.wikipedia.org/wiki/WSO2_Mashup_Server">concept of host objects</a> and the ability to write custom host objects and its pluggable nature comes handy in such cases. The high level architecture of what I am trying to achieve is as follows.</p>
<div id="attachment_348" class="wp-caption aligncenter" style="width: 850px"><a href="http://www.nuwanbando.com/wp-content/uploads/2010/04/rdf.png"><img class="size-full wp-image-348" style="background-color: #ffffff;" title="rdf" src="http://www.nuwanbando.com/wp-content/uploads/2010/04/rdf.png" alt="" width="840" height="262" /></a><p class="wp-caption-text">RDF data retrival with WSO2 Mashup server / WSO2 Gadget Server</p></div>
<p style="text-align: left;">To implement the above architecture with the tools at hand I created a <a href="http://wso2.org/library/tutorials/writing-custom-hostobjectttp://" target="_blank">custom host object</a> that can be plugged to the Mashup Server. When dealing with semantic web related tasks and RDF data handling HP&#8217;s <a href="http://jena.sourceforge.net/" target="_blank">Jena</a> java library comes in handy. With the use of <a href="http://openjena.org/ARQ/">Jena-ARQ</a> (for <a href="http://en.wikipedia.org/wiki/SPARQL" target="_blank">SPARQL</a>) api I managed to get the host object working with few lines of code.</p>
<p style="text-align: left;">
<pre name="code" class="java">.....
            Dataset dataSet = DatasetFactory.create(sparqlObject.rdfDataSource);
            // Create a new query form a given user query
            String queryString = sparqlObject.spaqrlQuery;
            Query query = QueryFactory.create(queryString);
            QueryExecution qe = QueryExecutionFactory.create(query, dataSet);
            ResultSet results = qe.execSelect();
.....
           resultString = ResultSetFormatter.asXMLString(results);
..... OR.....
           ByteArrayOutputStream bos = new ByteArrayOutputStream();
           ResultSetFormatter.outputAsJSON(bos, results);
</pre>
<p style="text-align: left;">With the host object in place, the next task was to create a Mashup in-order to query the rdf data with a given source (EndPoint or data source). The javascript service (Mashup) is created to serve this purpose, where the consumer can specify the RDF endpoint or the data source with the SPARQL query and retrieve the dataset in XML or JSON.</p>
<pre name="code" class="js">.....
function RdfDocQueryService(rdfDataSource, rdfQuery, resultType) {
   var sparqlObj = new SparqlHostObject();
   sparqlObj.rdfDataSource = rdfDataSource;
   sparqlObj.spaqrlQuery = rdfQuery;
   sparqlObj.resultType = resultType;
   return new XML(sparqlObj.getDataFromRdfSource());
}
</pre>
<p>Finally to bind everything together, lets try querying some data. My example usecase is to use the query at <a href="http://blogs.talis.com/n2/archives/836" target="_blank">N2 blog</a> to retrieve traffic monitoring points in UK roads. The query to retrieve the data set as follows,</p>
<pre name="code" class="sql">#List the uri, latitude and longitude for road traffic monitoring points on the M5
PREFIX road:
PREFIX rdf:
PREFIX geo:
PREFIX wgs84:
PREFIX xsd:
SELECT ?point ?lat ?long WHERE {
  ?x a road:Road.
  ?x road:number "A4"^^xsd:NCName.
  ?x geo:point ?point.
  ?point wgs84:lat ?lat.
  ?point wgs84:long ?long.
}
</pre>
<p>To visualize these points I have created a gadget with the aid of Google Maps api. This gadget can be hosted in the Gadget Server, where it can dynamically retrieve traffic monitoring points for each road in the UK and display them in the map as follows.</p>
<p style="text-align: center;">
<div id="attachment_362" class="wp-caption aligncenter" style="width: 841px"><a href="http://www.nuwanbando.com/wp-content/uploads/2010/04/WSO2-Gadget-Server_1271189245784.png"><img class="size-full wp-image-362" title="WSO2 Gadget Server_1271189245784" src="http://www.nuwanbando.com/wp-content/uploads/2010/04/WSO2-Gadget-Server_1271189245784.png" alt="" width="831" height="414" /></a><p class="wp-caption-text">Traffic points in A4 road, UK</p></div>
<div id="fb-root"></div>
       <script>
       window.fbAsyncInit = function() {
       FB.init({appId: "108492862525832", status: true, cookie: true,
             xfbml: true});
        };
     (function() {
      var e = document.createElement("script"); e.async = true;
     e.src = document.location.protocol +
       "//connect.facebook.net/en_US/all.js";
     document.getElementById("fb-root").appendChild(e);
   }());
   </script><div class = "fb-div"><fb:like href="http://www.nuwanbando.com/2010/04/mashing-up-rdf-data-with-wso2-mashup-server/" layout="standard" show_faces="true" width="450" action="like" colorscheme="light" /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2010/04/mashing-up-rdf-data-with-wso2-mashup-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Authoring, deploying and using XML Gadgets in WSO2 Gadget Server</title>
		<link>http://www.nuwanbando.com/2009/12/authoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server/</link>
		<comments>http://www.nuwanbando.com/2009/12/authoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 11:39:16 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2 Gadget Server]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[Shindig]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=251</guid>
		<description><![CDATA[We are about to release The long awaited WSO2 Gadget Server within few days of time. These few days I was doing some documentation and content writing about the Gadget Server, Apache Shindig and Google gadgets specification. My 1st article about authoring gadgets is now published on WSO2 Oxygen Tank as a help/Tutorial for Gadget [...]]]></description>
			<content:encoded><![CDATA[		<div style="float:right;margin:0px 0px 10px 10px;">
			<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F12%2Fauthoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server%2F&title=Authoring%2C+deploying+and+using+XML+Gadgets+in+WSO2+Gadget+Server&related=no" ><span style="display:none">We are about to release The long awaited WSO2 Gadget Server within few days of time. These few days I was doing some documentation and content writing about the Gadget Server, Apache Shindig and Google gadgets specification. My 1st article about authoring gadgets is now published on WSO2 Oxygen Tank as a help/Tutorial for Gadget [...]</span></a>		
		</div>		
		<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F12%2Fauthoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F12%2Fauthoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://code.google.com/apis/gadgets/images/landing_07_01_files/gadget_1.gif" alt="" width="100" height="100" /><img style="margin-left: 10px;" src="http://code.google.com/apis/gadgets/images/landing_07_01_files/gadget_2.gif" alt="" width="100" height="100" /><img style="margin-left: 10px;" src="http://code.google.com/apis/gadgets/images/landing_07_01_files/gadget_3.gif" alt="" width="100" height="100" /><a href="http://wso2.com/wp-content/themes/wso2ng-v2/images/logos/gs_logo_h42.gif"><img style="margin-left: 10px;" src="http://wso2.com/wp-content/themes/wso2ng-v2/images/logos/gs_logo_h42.gif" alt="" /></a></p>
<p>We are about to release The long awaited <a href="http://wso2.org/projects/gadget-server" target="_blank">WSO2 Gadget Server</a> within few days of time. These few days I was doing some documentation and content writing about the Gadget Server, Apache Shindig and Google gadgets specification. <a href="http://wso2.org/library/articles/first-step-towards-wso2-gadget-server-authoring-deploying-u++sing-xml-gadgets" target="_blank">My 1st article about authoring gadgets</a> is now published on <a href="http://wso2.org">WSO2 Oxygen Tank</a> as a help/Tutorial for Gadget server users. You can also download the Gadget Server <a href="http://bit.ly/7svU4O" target="_blank">release candidate 2</a> and play with it. Also Paul had written an <a href="http://pzf.fremantle.org/2009/12/portal.html" target="_blank">interesting article</a> about portals and Gadgets Server&#8217;s role.</p>
<div id="fb-root"></div>
       <script>
       window.fbAsyncInit = function() {
       FB.init({appId: "108492862525832", status: true, cookie: true,
             xfbml: true});
        };
     (function() {
      var e = document.createElement("script"); e.async = true;
     e.src = document.location.protocol +
       "//connect.facebook.net/en_US/all.js";
     document.getElementById("fb-root").appendChild(e);
   }());
   </script><div class = "fb-div"><fb:like href="http://www.nuwanbando.com/2009/12/authoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server/" layout="standard" show_faces="true" width="450" action="like" colorscheme="light" /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/12/authoring-deploying-and-using-xml-gadgets-in-wso2-gadget-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Shindig talk at Apache Con Asia 09</title>
		<link>http://www.nuwanbando.com/2009/12/apache-shindig-talk-at-apache-con-asia-09/</link>
		<comments>http://www.nuwanbando.com/2009/12/apache-shindig-talk-at-apache-con-asia-09/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 09:54:03 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2 Gadget Server]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=244</guid>
		<description><![CDATA[As I have mentioned in some previous post, today I did a talk about Apache shindig and its use cases (WSO2 Gadget Server) at Apache Con 09 with my Colleague Tyrell. So without writing about the whole talk let me share the presentation slides. The Talk turned up great, audience were quite interested, too bad [...]]]></description>
			<content:encoded><![CDATA[		<div style="float:right;margin:0px 0px 10px 10px;">
			<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F12%2Fapache-shindig-talk-at-apache-con-asia-09%2F&title=Apache+Shindig+talk+at+Apache+Con+Asia+09&related=no" ><span style="display:none">As I have mentioned in some previous post, today I did a talk about Apache shindig and its use cases (WSO2 Gadget Server) at Apache Con 09 with my Colleague Tyrell. So without writing about the whole talk let me share the presentation slides. The Talk turned up great, audience were quite interested, too bad [...]</span></a>		
		</div>		
		<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F12%2Fapache-shindig-talk-at-apache-con-asia-09%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F12%2Fapache-shindig-talk-at-apache-con-asia-09%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>As I have mentioned in some previous post, today I did a talk about Apache shindig and its use cases (WSO2 Gadget Server) at Apache Con 09 with my Colleague Tyrell. So without writing about the whole talk let me share the presentation slides. The Talk turned up great, audience were quite interested, too bad we had very limited time and missed to do a demo. <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<div style="width:425px;text-align:left; margin-left: 60px;" id="__ss_2646975;"><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=shindig-apachecon-asia-09-091204001804-phpapp02&#038;stripped_title=shindig-apachecon-asia-09" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=shindig-apachecon-asia-09-091204001804-phpapp02&#038;stripped_title=shindig-apachecon-asia-09" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/nuwanbando">Nuwan Bandara</a>.</div>
</div>
<div id="fb-root"></div>
       <script>
       window.fbAsyncInit = function() {
       FB.init({appId: "108492862525832", status: true, cookie: true,
             xfbml: true});
        };
     (function() {
      var e = document.createElement("script"); e.async = true;
     e.src = document.location.protocol +
       "//connect.facebook.net/en_US/all.js";
     document.getElementById("fb-root").appendChild(e);
   }());
   </script><div class = "fb-div"><fb:like href="http://www.nuwanbando.com/2009/12/apache-shindig-talk-at-apache-con-asia-09/" layout="standard" show_faces="true" width="450" action="like" colorscheme="light" /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/12/apache-shindig-talk-at-apache-con-asia-09/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The SOA Workshop day</title>
		<link>http://www.nuwanbando.com/2009/09/the-soa-workshop-day/</link>
		<comments>http://www.nuwanbando.com/2009/09/the-soa-workshop-day/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 15:59:48 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[About Me]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=217</guid>
		<description><![CDATA[Today was &#8220;THE Workshop Day&#8221; for WSO2 folks, an event organized by WSO2 with an intention to make an awareness of SOA building blocks. I was (proudly ) among the audience as a WSO2 crew member, listening to all the tech talks of my collogues. It was a great session we had today, starting from [...]]]></description>
			<content:encoded><![CDATA[		<div style="float:right;margin:0px 0px 10px 10px;">
			<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F09%2Fthe-soa-workshop-day%2F&title=The+SOA+Workshop+day&related=no" ><span style="display:none">Today was &#8220;THE Workshop Day&#8221; for WSO2 folks, an event organized by WSO2 with an intention to make an awareness of SOA building blocks. I was (proudly ) among the audience as a WSO2 crew member, listening to all the tech talks of my collogues. It was a great session we had today, starting from [...]</span></a>		
		</div>		
		<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F09%2Fthe-soa-workshop-day%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F09%2Fthe-soa-workshop-day%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Today was &#8220;THE Workshop Day&#8221; for WSO2 folks, an event organized by <a href="http://wso2.com/">WSO2</a> with an intention to make an awareness of SOA building blocks. I was (proudly <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) among the audience as a WSO2 crew member, listening to all the tech talks of my collogues. It was a great session we had today, starting from <a href="http://pzf.fremantle.org/">Paul&#8217;s</a> introduction to SOA  and until <a href="http://www.asankama.com/">Asanka&#8217;s</a> talk about enterprise SOA pattern&#8217;s. The whole set of talks took me back in time where I was reading about SOA concepts for my bachelor&#8217;s thesis. If I had experienced this workshop then, life would have been much easier <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> .</p>
<p>Guys,.. cheers !! for a job well done <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><center><img class="aligncenter size-medium wp-image-218" title="com-workshop-banner" src="http://www.nuwanbando.com/wp-content/uploads/2009/09/com-workshop-banner-300x126.jpg" alt="com-workshop-banner" width="300" height="126" /></center></p>
<div id="fb-root"></div>
       <script>
       window.fbAsyncInit = function() {
       FB.init({appId: "108492862525832", status: true, cookie: true,
             xfbml: true});
        };
     (function() {
      var e = document.createElement("script"); e.async = true;
     e.src = document.location.protocol +
       "//connect.facebook.net/en_US/all.js";
     document.getElementById("fb-root").appendChild(e);
   }());
   </script><div class = "fb-div"><fb:like href="http://www.nuwanbando.com/2009/09/the-soa-workshop-day/" layout="standard" show_faces="true" width="450" action="like" colorscheme="light" /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/09/the-soa-workshop-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing custom queries to retrieve data from WSO2 Governance Registry</title>
		<link>http://www.nuwanbando.com/2009/08/custom-queries-to-retrieve-data-from-wso2-governance-registry/</link>
		<comments>http://www.nuwanbando.com/2009/08/custom-queries-to-retrieve-data-from-wso2-governance-registry/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 11:58:55 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2]]></category>
		<category><![CDATA[G-reg]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=176</guid>
		<description><![CDATA[WSO2 Governance Registry is a big part of wso2 governance product stack. Even though it is primarily aimed at managing, versioning, rating, and commenting on SOA artifacts it can also be used as a simple data store. with the 3.0 version the G-Reg gave support to custom query execution from the client side. This feature [...]]]></description>
			<content:encoded><![CDATA[		<div style="float:right;margin:0px 0px 10px 10px;">
			<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F08%2Fcustom-queries-to-retrieve-data-from-wso2-governance-registry%2F&title=Writing+custom+queries+to+retrieve+data+from+WSO2+Governance+Registry&related=no" ><span style="display:none">WSO2 Governance Registry is a big part of wso2 governance product stack. Even though it is primarily aimed at managing, versioning, rating, and commenting on SOA artifacts it can also be used as a simple data store. with the 3.0 version the G-Reg gave support to custom query execution from the client side. This feature [...]</span></a>		
		</div>		
		<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F08%2Fcustom-queries-to-retrieve-data-from-wso2-governance-registry%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F08%2Fcustom-queries-to-retrieve-data-from-wso2-governance-registry%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://wso2.org/projects/governance-registry">WSO2 Governance Registry</a> is a big part of wso2 governance product stack. Even though it is primarily aimed at managing, versioning, rating, and commenting on SOA artifacts it can also be used as a simple data store. with the 3.0 version the G-Reg gave support to custom query execution from the client side. This feature helps immensely when you use the registry for non-standard tasks. For me I had to do some pagination work for the comments that belongs to a particular resource, hence my approach was to write few custom quires to get the job done. The code is as follows.</p>
<pre name="code" class="java">
	/**
	 * Returns a chunk of comments
	 *
	 * @param resPath	Path to the comment
	 * @param start		The beginning index
	 * @param size		Size of the chunk
	 * @return			an array of comments
	 */
 public Comment[] getCommentSet(String resPath, int start, int size) {
		Registry registry = null;
		try {
			registry = ; // get an instance of the registry 

			Resource comQuery = registry.newResource();

                        // The Sql Statement
			String sql = "SELECT REG_COMMENT_ID FROM REG_RESOURCE_COMMENT RC, REG_RESOURCE R, REG_PATH P WHERE "
					+ "RC.REG_VERSION=R.REG_VERSION AND "
					+ "R.REG_NAME=? AND "
					+ "P.REG_PATH_VALUE=? AND "
					+ "P.REG_PATH_ID=R.REG_PATH_ID LIMIT ?, ?";

			// Set SQL statement as the resource content
                        comQuery.setContent(sql);

                       // Setting the media type and properties
			comQuery.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);
			comQuery.addProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME, RegistryConstants.COMMENTS_RESULT_TYPE);

			registry.put("system/myQueries/query", comQuery);
                 String resourceName = "testResource";
                 String pathToResource = "/system/myResources"

			Map<String, String> params = new HashMap<String, String>();

                        //Setting the parameters
			params.put("1", resourceName);
			params.put("2", pathToResource);
			params.put("3", start);
			params.put("4", size);

                       // Executing the SQL statement
			Collection qResults = registry.executeQuery("system/myQueries/query", params);

			String[] qPaths = (String[]) qResults.getContent();

			Comment[] comments = new Comment[qPaths.length];
                        // Loading the comment data to comment object array
			for (int i = 0; i < qPaths.length; i++) {
				if (registry.resourceExists(qPaths[i])) {
					comments[i] = (Comment) registry.get(qPaths[i]);
				}
			}

			return comments;

		} catch (Exception e) {
			String errorMsg = "Backend server error - could not get comment set";
			log.error(new MyTestException(errorMsg, e));
			return null;
		}

	}
</pre>
<p>Yeah simple as that you get your resources set without much effort. A big thank goes to <a href="http://www.dimuthu.org/">Dimuthu</a></p>
<div id="fb-root"></div>
       <script>
       window.fbAsyncInit = function() {
       FB.init({appId: "108492862525832", status: true, cookie: true,
             xfbml: true});
        };
     (function() {
      var e = document.createElement("script"); e.async = true;
     e.src = document.location.protocol +
       "//connect.facebook.net/en_US/all.js";
     document.getElementById("fb-root").appendChild(e);
   }());
   </script><div class = "fb-div"><fb:like href="http://www.nuwanbando.com/2009/08/custom-queries-to-retrieve-data-from-wso2-governance-registry/" layout="standard" show_faces="true" width="450" action="like" colorscheme="light" /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/08/custom-queries-to-retrieve-data-from-wso2-governance-registry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best of SOA Summer School</title>
		<link>http://www.nuwanbando.com/2009/08/best-of-soa-summer-school/</link>
		<comments>http://www.nuwanbando.com/2009/08/best-of-soa-summer-school/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 16:07:09 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[FOSS]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WSO2]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=160</guid>
		<description><![CDATA[During this entire summer, WSO2 conducted a series of trainings on SOA best practices, How-Tos and trends, titled &#8220;SOA Summer School&#8220;. With the dawn of the autumn the series of online summer classes came to an end. With the popular demand, a 3 hour session is going to be held tomorrow the 13th August summarizing [...]]]></description>
			<content:encoded><![CDATA[		<div style="float:right;margin:0px 0px 10px 10px;">
			<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F08%2Fbest-of-soa-summer-school%2F&title=Best+of+SOA+Summer+School&related=no" ><span style="display:none">During this entire summer, WSO2 conducted a series of trainings on SOA best practices, How-Tos and trends, titled &#8220;SOA Summer School&#8220;. With the dawn of the autumn the series of online summer classes came to an end. With the popular demand, a 3 hour session is going to be held tomorrow the 13th August summarizing [...]</span></a>		
		</div>		
		<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F08%2Fbest-of-soa-summer-school%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F08%2Fbest-of-soa-summer-school%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>During this entire summer, <a href="http://www.wso2.com" target="_blank">WSO2</a> conducted a series of trainings on SOA best practices, How-Tos and trends, titled &#8220;<a href="http://wso2.org/training/best_soa_summer_school_encore_session" target="_blank">SOA Summer School</a>&#8220;. With the dawn of the autumn the series of online summer classes came to an end. With the popular demand, a 3 hour session is going to be held tomorrow the 13th August summarizing the 8 weeks of lessons and highlighting their key areas.<br/><br />
<img class="aligncenter" title="summer sschool" src="http://wso2.org/files/ot_ss_banner.jpg" alt="" width="608" height="219" /><br/><br />
<img class="size-full wp-image-161 aligncenter" title="Untitled" src="http://www.nuwanbando.com/wp-content/uploads/2009/08/Untitled.png" alt="Untitled" width="640" height="400" /><br/><br />
for a better insight I have attached tomorrow&#8217;s agenda, and it is conducted by <a href="http://samisa-abeysinghe.blogspot.com/">Samisa Abeysinghe</a>, <a href="http://blog.ruwan.org/">Ruwan Linton</a>, <a href="http://psiriwardena.blogspot.com/">Prabath Siriwardena</a>, <a href="http://www.keith-chapman.org/">Keith Chapman</a> and <a href="http://nandikaj.blogspot.com/">Nandika Jayawardena</a>. The online trainings are totally free and any one who is interested in SOA and EA can gain a good knowledge of its dynamics.</p>
<div id="fb-root"></div>
       <script>
       window.fbAsyncInit = function() {
       FB.init({appId: "108492862525832", status: true, cookie: true,
             xfbml: true});
        };
     (function() {
      var e = document.createElement("script"); e.async = true;
     e.src = document.location.protocol +
       "//connect.facebook.net/en_US/all.js";
     document.getElementById("fb-root").appendChild(e);
   }());
   </script><div class = "fb-div"><fb:like href="http://www.nuwanbando.com/2009/08/best-of-soa-summer-school/" layout="standard" show_faces="true" width="450" action="like" colorscheme="light" /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/08/best-of-soa-summer-school/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSF, Spring together with apache CXF</title>
		<link>http://www.nuwanbando.com/2009/01/jsf-spring-together-with-apache-cxf/</link>
		<comments>http://www.nuwanbando.com/2009/01/jsf-spring-together-with-apache-cxf/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 09:43:23 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[FOSS]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CXF]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.nuwanbando.com/?p=113</guid>
		<description><![CDATA[Good tutorials and resources on Apache CXF How Tos are not easy to digg. I had to spend hours searching and reading to make my small application up and running, Integrating Spring with JSF was pretty straightforward, but when it comes to integrating those two with JSF i got stuck. So this post is about [...]]]></description>
			<content:encoded><![CDATA[		<div style="float:right;margin:0px 0px 10px 10px;">
			<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F01%2Fjsf-spring-together-with-apache-cxf%2F&title=JSF%2C+Spring+together+with+apache+CXF&related=no" ><span style="display:none">Good tutorials and resources on Apache CXF How Tos are not easy to digg. I had to spend hours searching and reading to make my small application up and running, Integrating Spring with JSF was pretty straightforward, but when it comes to integrating those two with JSF i got stuck. So this post is about [...]</span></a>		
		</div>		
		<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F01%2Fjsf-spring-together-with-apache-cxf%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2009%2F01%2Fjsf-spring-together-with-apache-cxf%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Good tutorials and resources on Apache CXF How Tos are not easy to digg. I had to spend hours searching and reading to make my small application up and running, Integrating Spring with JSF was pretty straightforward, but when it comes to integrating those two with JSF i got stuck.</p>
<p>So this post is about <strong>exposing a web service</strong> as a web project using <strong>JSF front end / Spring backed and CXF</strong> for service invocation</p>
<p>before starting I should mention few valuable resource around the net.</p>
<ul>
<li><a href="http://cwiki.apache.org/CXF20DOC/index.html" target="_blank">The CXF documentation (Hope it will be completed soon)</a></li>
<li><a href="http://wheelersoftware.com/articles/spring-cxf-consuming-web-services.html" target="_blank">Make Web Services Transparent with Spring 2.5 and Apache CXF 2.0 by Willie Wheeler</a></li>
<li><a href="http://www.ibm.com/developerworks/webservices/library/ws-pojo-springcxf/index.html?S_TACT=105AGX04&amp;S_CMP=EDU">Introduction to Web services creation using CXF and Spring by Rajeev Hathi and Naveen Balani</a></li>
<li><a href="http://www.netbeans.org/kb/60/websvc/client.html">Developing JAX-WS Web Service Clients &#8211; netbeans</a></li>
<li><a href="http://weblogs.java.net/blog/caroljmcdonald/archive/2007/09/sample_applicat_3.html" target="_blank">Sample Application using JAX-WS, JSF, Spring, and Java by Carol Mcdonal</a></li>
</ul>
<p>The web service u used was the publicly available spelling checker which is used in the <a href="http://www.netbeans.org/kb/60/websvc/client.html">netbeans tutorial.</a></p>
<p><strong>The Step by step guide as follows &gt;&gt;</strong></p>
<p><strong>Step 1 : </strong></p>
<p>Create the classes from the WSDL you can use netbeans for this task or WSDL2JAVA command (wsdl2java [URL]) in the shell.</p>
<p><span id="more-113"></span></p>
<p><strong>Step2 :</strong></p>
<p>Put the generated classes to your WEB-INF/classes directory and simply write a java class to bind to the JSF front and to expose the web service. I was too lazy to iterate the whole list when showing the incorrect words. so please bare with me <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Example :</p>
<blockquote><p>package demo;</p>
<p>import com.cdyne.ws.CheckSoap;<br />
import com.cdyne.ws.Words;<br />
import java.util.List;</p>
<p>public class SpellChecker {</p>
<p>private CheckSoap service;<br />
private String textArea;<br />
private String wrongWord;</p>
<p>public void setWrongWord(String wrongWord) {<br />
this.wrongWord = wrongWord;<br />
}</p>
<p>public String getWrongWord() {<br />
return wrongWord;<br />
}</p>
<p>public void setTextArea(String textArea) {<br />
this.textArea = textArea;<br />
}</p>
<p>public String getTextArea() {<br />
return textArea;<br />
}</p>
<p>//the spring context sets the service using cxf dynamic proxy</p>
<p><strong>public void setService(CheckSoap service) {<br />
this.service = service;<br />
}</strong></p>
<p>public void checkSpelling() {<br />
try{<br />
System.out.println(&#8220;Checking spelli&#8230;&#8221;);<br />
com.cdyne.ws.DocumentSummary doc = service.checkTextBody(textArea, &#8220;&#8221;);<br />
List allwrongwords = doc.getMisspelledWord();<br />
wrongWord = ((Words) allwrongwords.get(0)).getWord();<br />
}catch (Exception e){<br />
e.printStackTrace();<br />
}</p>
<p>}</p>
<p>}</p></blockquote>
<p><strong>Step 3:</strong></p>
<p>Write a small JSF form to display and for use inputs,</p>
<p>Some thing like,</p>
<blockquote><p>&lt;h:form id=&#8221;spellingForm&#8221;&gt;<br />
&lt;h:outputLabel id=&#8221;label1&#8243; value=&#8221;ENTER you text : &#8221; /&gt;<br />
&lt;br /&gt;<br />
&lt;h:inputTextarea id=&#8221;textarea1&#8243; value=&#8221;#{spellingBean.textArea}&#8221; /&gt;<br />
&lt;br /&gt;<br />
&lt;h:commandButton id=&#8221;cmd1&#8243; value=&#8221;check&#8221; action=&#8221;#{spellingBean.checkSpelling}&#8221; /&gt;<br />
&lt;br /&gt;<br />
&lt;h:outputLabel id=&#8221;lab2&#8243; value=&#8221;The misspelled word is : &#8221; /&gt;<br />
&lt;h:outputText id=&#8221;text2&#8243; value=&#8221;#{spellingBean.wrongWord}&#8221; /&gt;<br />
&lt;/h:form&gt;</p></blockquote>
<p><strong>Step 4:</strong></p>
<p>Here comes the good stuff <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Write a Spring Context file for me it was spellapp-servlet.xml</p>
<blockquote><p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br />
&lt;beans xmlns=&#8221;http://www.springframework.org/schema/beans&#8221;<br />
xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;<br />
xmlns:context=&#8221;http://www.springframework.org/schema/context&#8221;<br />
xsi:schemaLocation=&#8221;http://www.springframework.org/schema/beans</p>
<p>http://www.springframework.org/schema/beans/spring-beans-2.5.xsd</p>
<p>http://www.springframework.org/schema/context</p>
<p>http://www.springframework.org/schema/context/spring-context-2.5.xsd&#8221;&gt;</p>
<p><strong>&lt;bean id=&#8221;client&#8221; class=&#8221;com.cdyne.ws.CheckSoap&#8221;<br />
factory-bean=&#8221;clientFactory&#8221; factory-method=&#8221;create&#8221;/&gt;</strong></p>
<p><strong>&lt;bean id=&#8221;clientFactory&#8221; class=&#8221;org.apache.cxf.jaxws.JaxWsProxyFactoryBean&#8221;&gt;<br />
&lt;property name=&#8221;serviceClass&#8221; value=&#8221;com.cdyne.ws.CheckSoap&#8221;/&gt;<br />
&lt;property name=&#8221;address&#8221; value=&#8221;http://ws.cdyne.com/SpellChecker/check.asmx?WSDL&#8221;/&gt;<br />
&lt;/bean&gt;</strong></p>
<p>&lt;/beans&gt;</p></blockquote>
<p><strong>Step 5: </strong></p>
<p>The Faces config (faces-config.xml)</p>
<blockquote><p>&lt;faces-config version=&#8221;1.2&#8243;<br />
xmlns=&#8221;http://java.sun.com/xml/ns/javaee&#8221;<br />
xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;<br />
xsi:schemaLocation=&#8221;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd&#8221;&gt;<br />
&lt;application&gt;<br />
&lt;variable-resolver&gt;org.springframework.web.jsf.DelegatingVariableResolver&lt;/variable-resolver&gt;<br />
&lt;/application&gt;</p>
<p>&lt;managed-bean&gt;<br />
&lt;managed-bean-name&gt;spellingBean&lt;/managed-bean-name&gt;<br />
&lt;managed-bean-class&gt;<br />
demo.SpellChecker<br />
&lt;/managed-bean-class&gt;<br />
&lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt;<br />
<strong>&lt;managed-property&gt;<br />
&lt;property-name&gt;service&lt;/property-name&gt;<br />
&lt;value&gt;#{client}&lt;/value&gt;<br />
&lt;/managed-property&gt;</strong></p>
<p>&lt;/managed-bean&gt;</p>
<p>&lt;/faces-config&gt;</p></blockquote>
<p><strong>Step 6:</strong></p>
<p>The web.xml</p>
<blockquote><p>&lt;web-app version=&#8221;2.5&#8243; xmlns=&#8221;http://java.sun.com/xml/ns/javaee&#8221; xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221; xsi:schemaLocation=&#8221;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&#8221;&gt;<br />
&lt;!&#8211; Spring Application Context configuration &#8211;&gt;<br />
<strong>&lt;context-param&gt;<br />
&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;<br />
&lt;param-value&gt;</strong><br />
<strong>/WEB-INF/spellapp-servlet.xml<br />
&lt;/param-value&gt;</strong><br />
&lt;/context-param&gt;<br />
&lt;context-param&gt;<br />
&lt;param-name&gt;javax.faces.CONFIG_FILES&lt;/param-name&gt;<br />
&lt;param-value&gt;/WEB-INF/faces-config.xml&lt;/param-value&gt;<br />
&lt;/context-param&gt;</p>
<p>&lt;context-param&gt;<br />
&lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;<br />
&lt;param-value&gt;server&lt;/param-value&gt;<br />
&lt;/context-param&gt;<br />
&lt;listener&gt;<br />
<strong>&lt;listener-class&gt;<br />
org.springframework.web.context.request.RequestContextListener<br />
&lt;/listener-class&gt;</strong><br />
&lt;/listener&gt;<br />
&lt;context-param&gt;<br />
&lt;param-name&gt;com.sun.faces.verifyObjects&lt;/param-name&gt;<br />
&lt;param-value&gt;false&lt;/param-value&gt;<br />
&lt;/context-param&gt;<br />
&lt;context-param&gt;<br />
&lt;param-name&gt;com.sun.faces.validateXml&lt;/param-name&gt;<br />
&lt;param-value&gt;true&lt;/param-value&gt;<br />
&lt;/context-param&gt;<br />
<strong>&lt;listener&gt;<br />
&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;<br />
&lt;/listener&gt;</strong><br />
&lt;servlet&gt;<br />
&lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;<br />
&lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;<br />
&lt;load-on-startup&gt;3&lt;/load-on-startup&gt;<br />
&lt;/servlet&gt;<br />
&lt;servlet&gt;<br />
&lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;<br />
&lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;<br />
&lt;load-on-startup&gt;2&lt;/load-on-startup&gt;<br />
&lt;/servlet&gt;<br />
&lt;servlet-mapping&gt;<br />
&lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;<br />
&lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;<br />
&lt;/servlet-mapping&gt;<br />
&lt;servlet-mapping&gt;<br />
&lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;<br />
&lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;<br />
&lt;/servlet-mapping&gt;<br />
&lt;session-config&gt;<br />
&lt;session-timeout&gt;<br />
30<br />
&lt;/session-timeout&gt;<br />
&lt;/session-config&gt;<br />
&lt;welcome-file-list&gt;<br />
&lt;welcome-file&gt;redirect.jsp&lt;/welcome-file&gt;<br />
&lt;/welcome-file-list&gt;<br />
&lt;/web-app&gt;<br />
<strong><br />
</strong></p></blockquote>
<p><strong>Step 7:</strong></p>
<p>That&#8217;s It Build it deploy it. Have fun <img src='http://www.nuwanbando.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <strong><br />
</strong></p>
<div id="fb-root"></div>
       <script>
       window.fbAsyncInit = function() {
       FB.init({appId: "108492862525832", status: true, cookie: true,
             xfbml: true});
        };
     (function() {
      var e = document.createElement("script"); e.async = true;
     e.src = document.location.protocol +
       "//connect.facebook.net/en_US/all.js";
     document.getElementById("fb-root").appendChild(e);
   }());
   </script><div class = "fb-div"><fb:like href="http://www.nuwanbando.com/2009/01/jsf-spring-together-with-apache-cxf/" layout="standard" show_faces="true" width="450" action="like" colorscheme="light" /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2009/01/jsf-spring-together-with-apache-cxf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UDDI Tutorial : JUDDI / UDDI4J ( publish &amp; inquiry using juddi console and uddi4j client API )</title>
		<link>http://www.nuwanbando.com/2007/09/tutorial-juddi-uddi4j-publish-inquiry-using-juddi-console-and-uddi4j-client-api/</link>
		<comments>http://www.nuwanbando.com/2007/09/tutorial-juddi-uddi4j-publish-inquiry-using-juddi-console-and-uddi4j-client-api/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 10:08:05 +0000</pubDate>
		<dc:creator>Nuwan Bandara</dc:creator>
				<category><![CDATA[FOSS]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[protocols]]></category>
		<category><![CDATA[UDDI]]></category>

		<guid isPermaLink="false">http://nuwanbando.com/?p=59</guid>
		<description><![CDATA[Last two weeks i was busy with my office work trying to figure out some tasks related to an EU project called sensoria. I had to integrate the Events plugin of Joomla (CMS) with Google calender (which i am hoping to write about in future) and I had to compose a case study documentation for [...]]]></description>
			<content:encoded><![CDATA[		<div style="float:right;margin:0px 0px 10px 10px;">
			<a class="DiggThisButton DiggMedium" href="http://digg.com/submit?url=http%3A%2F%2Fwww.nuwanbando.com%2F2007%2F09%2Ftutorial-juddi-uddi4j-publish-inquiry-using-juddi-console-and-uddi4j-client-api%2F&title=UDDI+Tutorial+%3A+JUDDI+%2F+UDDI4J+%28+publish+%26%23038%3B+inquiry+using+juddi+console+and+uddi4j+client+API+%29&related=no" ><span style="display:none">Last two weeks i was busy with my office work trying to figure out some tasks related to an EU project called sensoria. I had to integrate the Events plugin of Joomla (CMS) with Google calender (which i am hoping to write about in future) and I had to compose a case study documentation for [...]</span></a>		
		</div>		
		<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.nuwanbando.com%2F2007%2F09%2Ftutorial-juddi-uddi4j-publish-inquiry-using-juddi-console-and-uddi4j-client-api%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.nuwanbando.com%2F2007%2F09%2Ftutorial-juddi-uddi4j-publish-inquiry-using-juddi-console-and-uddi4j-client-api%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Last two weeks i was busy with my office work trying to figure out some tasks related to an EU project called <a href="http://www.sensoria-ist.eu/">sensoria.</a> I had to integrate the Events plugin of Joomla (CMS) with Google calender (which i am hoping to write about in future) and I had to compose a case study documentation for service discovery using UDDI (Universal Description, Discovery and Integration). It took me few days to setup a test environment to get things actually working.<a href="http://nuwanbando.com/wp-content/uploads/2007/09/pict_uddi_1.gif" title="pict_uddi_1.gif"><img src="http://nuwanbando.com/wp-content/uploads/2007/09/pict_uddi_1.gif" alt="pict_uddi_1.gif" /></a></p>
<p>As I saw, that in this area there aren&#8217;t many help or online tutorials.. you have to collect tits and bits from every where and put some effort to make things work..</p>
<p>SO yeah thats why i thought to publish a small tutorial on setting up a UDDI server and handling the UDDI4J java client API..</p>
<p align="left">&nbsp;</p>
<p class="Sensoriatext" align="left"><span id="more-59"></span><br />
<strong>        What is UDDI</strong></p>
<p class="Sensoriatext" align="left">Universal description discovery and integration (UDDI) is a special directory service which is implemented to use for indexing all the available services, a company offer. UDDI registries keep records of the details of the company, the details of the offering services and the technical specifications to use them.</p>
<p class="Sensoriatext" align="left">UDDI creates a standard interoperable platform that enables companies and applications to quickly, easily, and dynamically find and use Web services over the Internet. UDDI also allows operational registries to be maintained for different purposes in different contexts.</p>
<p class="Sensoriatext" align="left"><strong>More details</strong></p>
<p class="Sensoriatext" align="left">You can read more details about UDDI data structure and the technical architecture from <a href="http://www.tutorialspoint.com/uddi/index.htm">tutorialspoint</a> where i got a good idea how things did work in the ground level.</p>
<p class="Sensoriatext" align="left"><a href="http://nuwanbando.com/wp-content/uploads/2007/09/apache.gif" title="apache.gif"><img src="http://nuwanbando.com/wp-content/uploads/2007/09/apache.gif" alt="apache.gif" /></a><a href="http://ws.apache.org/juddi/"><strong>Apache jUDDI</strong></a></p>
<p class="Sensoriatext" align="left">jUUDI is an Open source UDDI server which have to be integrated with the apache tomcat application server. jUDDI provides a console where the uses can publish and inquire businesses / Services and tmodels along with the binding templates. Apache provides the HOW-TO setup guide it its <a href="http://wiki.apache.org/ws/jUDDI_HOW-TOs">wiki</a>, yet its bit confusing and out of date.</p>
<p class="Sensoriatext" align="left"><strong>Step by Step setup guide<em> ( jUDDI on tomcat )</em></strong><span style="font-size: 11pt" lang="EN-GB"></span></p>
<ul>
<li> Unzip the jUDDI archive to a directory.</li>
<li> Copy the MySQL JDBC driver to {TOMCAT}/common/lib. This makes the MySQL database runtime available to Tomcat.</li>
<li>As a test for confirmation of successful database restoration execute a SELECT query in the MySQL prompt                        SELECT COUNT(*) FROM PUBLISHER</li>
</ul>
<p>If the result is &#8220;1&#8243;. The database is successfully restored.</p>
<ul>
<li>Copy the {JUDDI}/webapps/juddi directory to {TOMCAT}/webapps. This installs the jUDDI web application into Tomcat.</li>
<li>In the {TOMCAT}/webapps/juddi/META-INF directory, create a file named context.xml. Enter the following into the file:</li>
</ul>
<blockquote></blockquote>
<blockquote></blockquote>
<blockquote><p>&lt;Context path=&#8221;/juddi&#8221; docBase=&#8221;juddi&#8221; debug=&#8221;5&#8243; reloadable=&#8221;true&#8221;<br />
crossContext=&#8221;true&#8221;&gt;</p>
<blockquote><p> &lt;Logger className=&#8221;org.apache.catalina.logger.FileLogger&#8221;<br />
prefix=&#8221;localhost_juddiDB_log&#8221; suffix=&#8221;.txt&#8221;<br />
timestamp=&#8221;true&#8221;/&gt;</p></blockquote>
<blockquote><p> &lt;Resource name=&#8221;jdbc/juddiDB&#8221;<br />
auth=&#8221;Container&#8221;<br />
type=&#8221;javax.sql.DataSource&#8221;<br />
username=&#8221;MySQL_username&#8221; password=&#8221;MySQL_password&#8221;<br />
driverClassName=&#8221;com.mysql.jdbc.Driver&#8221;<br />
url=&#8221;jdbc:mysql://host.domain.com:3306/juddi?autoReconnect=true&#8221;<br />
validationQuery=&#8221;select publisher_ID from PUBLISHER&#8221;/&gt;</p></blockquote>
<blockquote><p> &lt;Resource name=&#8221;jdbc/juddi&#8221;<br />
auth=&#8221;Container&#8221;<br />
type=&#8221;javax.sql.DataSource&#8221;<br />
username=&#8221;MySQL_username&#8221; password=&#8221;MySQL_password&#8221;<br />
driverClassName=&#8221;com.mysql.jdbc.Driver&#8221;<br />
url=&#8221;jdbc:mysql://host.domain.com:3306/juddi?autoReconnect=true&#8221;<br />
validationQuery=&#8221;select publisher_ID from PUBLISHER&#8221;/&gt;</p></blockquote>
<p>&lt;/Context&gt;</p></blockquote>
<p>configures two DataSources so that the jUDDI application can use the MySQL database tables which are created in an earlier step.</p>
<ul>
<li>Edit the {TOMCAT}/webapps/juddi/WEB-INF/web.xml  file and near the bottom, copy the existing resource-ref element so there are two. Edit the copy to define a res-ref-name of jdbc/juddi. The two resource-ref elements should look like:</li>
</ul>
<blockquote><p>&lt;resource-ref&gt;</p></blockquote>
<blockquote>
<blockquote><p> &lt;description&gt;jUDDI DataSource&lt;/description&gt;<br />
&lt;res-ref-name&gt;jdbc/juddiDB&lt;/res-ref-name&gt;<br />
&lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;<br />
&lt;res-auth&gt;Container&lt;/res-auth&gt;</p></blockquote>
</blockquote>
<blockquote><p> &lt;/resource-ref&gt;<br />
&lt;resource-ref&gt;</p>
<blockquote><p> &lt;description&gt;jUDDI DataSource&lt;/description&gt;<br />
&lt;res-ref-name&gt;jdbc/juddi&lt;/res-ref-name&gt;<br />
&lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;<br />
&lt;res-auth&gt;Container&lt;/res-auth&gt;</p></blockquote>
<p>&lt;/resource-ref&gt;</p></blockquote>
<ul>
<li>Restart tom cat server.</li>
</ul>
<ul>
<li>Test jUDDI by opening a Web browser and entering the following URL:</li>
</ul>
<p>http://localhost:8080/juddi/happyjuddi.jsp</p>
<p>there should not be any errors on the page (no red text).</p>
<ul>
<li>As the final test. Enter the following URL into your browser: http://localhost:8080/juddi/console/get_authToken.jsp</li>
</ul>
<p>In the top multi-line entry area, change the userID from *** to jdoe and the cred from *** to an empty string. Then press the Submit button.<br />
In the bottom multi-line area, if there is a returned SOAP message with an authInfo element containing text of the form authToken:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. That means JUDDI is successfully installed and configured.</p>
<p><strong>JUDDI console</strong><em> ( http://localhost:8080/juddi/console/ )</em></p>
<p>using JUDDI console, a new business / Tmodel / Service can be created.</p>
<ul>
<li>using the link get_authToken using the publisher username and the password, take a authentication token.</li>
<li>use the link save_business create a new business by putting the received authentication code.</li>
<li>Publish a tmodel for a relevant category (save_tmodel).</li>
<li>Save a service giving the associating tmodel key (save _service).</li>
</ul>
<p>but this is not the case always.. you need to build a client to lookup the UDDI registry remotely or need to publish your business data. for this task there are several client APIs available.. and the flowing is the java implementation.</p>
<p><a href="http://nuwanbando.com/wp-content/uploads/2007/09/uddi4j.jpeg" title="uddi4j.jpeg"><img src="http://nuwanbando.com/wp-content/uploads/2007/09/uddi4j.jpeg" alt="uddi4j.jpeg" /></a><strong>UDDI client API</strong> <em>(<a href="http://uddi4j.sourceforge.net/">UDDI4J</a>)</em></p>
<p>UDDI4J is a Java class library that provides an API that is can be used to interact with a UDDI registry. This class library generates and parses messages sent to and received from a UDDI server.<br />
The central class in this set of APIs is <strong>org.uddi4j.client.UDDIProxy</strong>. It is a proxy for the UDDI server that is accessed from client code. Its methods map to the UDDI Version 2.0 API Specification.<br />
The classes within <strong>org.uddi4j.datatype</strong> represent data objects used to send or receive UDDI information. and in the, business, service, tmodel subpackages represent data objects that are sent on calls or received from the server.<br />
The subpackage <strong>org.uddi4j.request</strong> contains messages sent to the server. These classes are typically not used directly, rather the UDDIProxy class uses these classes.<br />
Similarly, the subpackage <strong>org.uddi4j.response</strong> represents response messages from a UDDI server.</p>
<p>Pluggable transports are supported by the package <strong>org.uddi4j.transport</strong>.</p>
<p><strong>Getting the Service url</strong></p>
<p>When you download the UDDI4J archive and unzip it you get a folder with some examples. in these examples you can find the methodologies to publish and lookup for businesses. but what was bit dificult was to get the service URL which is the most important. so I thought of adding that piece of code where you can get  the service url easily.</p>
<p>I assume there are some Services are published to the registry.</p>
<blockquote><p>try {</p>
<blockquote><p> UDDIProxy proxy = new UDDIProxy();<br />
proxy.setInquiryURL(INQ_URL);Vector names = new Vector();<br />
names.add(new Name(SERVICE_NAME));</p>
<p>FindQualifiers findQualifiers = new FindQualifiers();<br />
Vector qualifier = new Vector();<br />
qualifier.add(new FindQualifier(FindQualifier.exactNameMatch));<br />
findQualifiers.setFindQualifierVector(qualifier);</p>
<p>ServiceList serviceList = proxy.find_service(null, names, null,<br />
null, findQualifiers, MAX_ROWS);<br />
Vector serviceInfoVector = serviceList.getServiceInfos()<br />
.getServiceInfoVector();</p>
<p>/* service end point URL list */<br />
Vector urlList = new Vector();</p>
<p>for (int i = 0; i &lt; serviceInfoVector.size(); i++) {</p>
<blockquote><p> ServiceInfo sInfo = (ServiceInfo) serviceInfoVector<br />
.elementAt(i);<br />
BindingDetail btd = proxy.find_binding(null, sInfo<br />
.getServiceKey(), null, MAX_ROWS);<br />
BindingTemplate bt = (BindingTemplate)btd.getBindingTemplateVector().elementAt(0);<br />
urlList.add(bt.getAccessPoint().getText());</p></blockquote>
<p>}</p>
<p>/* select a suitable service as to the given criteria, here we just<br />
* select the service randomly */<br />
int i = (int)(Math.random() * urlList.size());<br />
return new AmbulanceServiceStub((String)urlList.elementAt(i));<br />
} catch (Exception e) {</p>
<blockquote><p> System.out.println(e);<br />
return null;</p></blockquote>
<p>}</p></blockquote>
</blockquote>
<p><strong>Bibliography</strong></p>
<ul>
<li>UDDI:UDDI tutorial. 2007. [online]. [Accessed 7th September 2007]. Available from World Wide Web: &lt; <a href="http://www.tutorialspoint.com/uddi/index.htm">http://www.tutorialspoint.com/uddi/index.htm</a> &gt;</li>
</ul>
<ul>
<li>UDDI4J lets Java do the walking : André Tost, JavaWorld.com, 08/24/2001. [Accessed 7th September 2007]. Available from World Wide Web: <a href="http://www.javaworld.com/javaworld/jw-08-2001/jw-0824-uddi.html?page=1">http://www.javaworld.com/javaworld/jw-08-2001/jw-0824-uddi.html?page=1</a>&gt;</li>
<li>UDDI4J:UDDI4J documentation. [online]. [Accessed 12th September 2007]. Available from World Wide Web: &lt; <a href="http://uddi4j.sourceforge.net/doc.html">http://uddi4j.sourceforge.net/doc.html</a>&gt;</li>
</ul>
<ul>
<li>JUDDI: Apache JUDDI . [online]. [Accessed 12th September 2007]. Available from World Wide Web: &lt; <a href="http://ws.apache.org/juddi/usersguide.html">http://ws.apache.org/juddi/usersguide.html</a>&gt;</li>
</ul>
<p>I hope this article will make sense to you. but if you get any problem during the server setup or while using uddi4j please feel free to leave a comment or email.</p>
<p>cheers !!</p>
<div id="fb-root"></div>
       <script>
       window.fbAsyncInit = function() {
       FB.init({appId: "108492862525832", status: true, cookie: true,
             xfbml: true});
        };
     (function() {
      var e = document.createElement("script"); e.async = true;
     e.src = document.location.protocol +
       "//connect.facebook.net/en_US/all.js";
     document.getElementById("fb-root").appendChild(e);
   }());
   </script><div class = "fb-div"><fb:like href="http://www.nuwanbando.com/2007/09/tutorial-juddi-uddi4j-publish-inquiry-using-juddi-console-and-uddi4j-client-api/" layout="standard" show_faces="true" width="450" action="like" colorscheme="light" /></div>]]></content:encoded>
			<wfw:commentRss>http://www.nuwanbando.com/2007/09/tutorial-juddi-uddi4j-publish-inquiry-using-juddi-console-and-uddi4j-client-api/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
