<?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; UDDI</title>
	<atom:link href="http://www.nuwanbando.com/tag/uddi/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>Thu, 02 Feb 2012 08:52:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<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 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&amp;b=2" 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>
]]></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>

