Register Web Services with Apache j UDDI Tong
Register Web Services with Apache j. UDDI Tong Shu Department of Computer Science The University of Memphis, TN 38152, USA A Tutorial for COMP 4302 on Apr. 23, 2013
Overview • Apache j. UDDI – – What is j. UDDI? Where to get a j. UDDI Registry Server? How to install / uninstall a j. UDDI Registry Server? How to use a j. UDDI Registry Server? • Demo of How to Register a Web Service – – How to get the source code of an example? Configure the Connection to a j. UDDI Registry Server Publish a web service Query and delete a web service 2
What is j. UDDI? • Introduction – j. UDDI is an open source Java implementation of the Universal Description, Discovery, and Integration (UDDI) v 3 specification for Web Services – The j. UDDI project includes Scout, which is an implementation of the Java Specification Request (JSR) 93 - Java. TM API for XML Registries 1. 0 (JAXR) • j. UDDI Features – Open Source – Platform Independent – Use with any relational database that supports ANSI standard SQL (My. SQL, Oracle, DB 2, Sybase, Derby etc. ) – Deployable on any Java application server that supports the Servlet 2. 3 specification – j. UDDI registry supports a clustered deployment configuration – Easy integration with existing authentication systems – Supports in VM embeddable mode 3
Where to Get a j. UDDI Registry Server? • Binary Package – http: //apache. mirrors. lucidnetworks. net/juddi/3_1_3/ • Version – juddi-portal-bundle-3. 1. 3. zip • j. UDDI User Guide – http: //juddi. apache. org/docs/3. x/userguide/pdf/userguide. pdf 4
Install a j. UDDI Registry Server in Linux • Download Java JDK from – http: //www. oracle. com/technetwork/javase/downloads/jdk 7 downloads-1880260. html • Set environment variables as a root – # vi /etc/profile – Append export JAVA_HOME=/usr/local/jdk 1. 7. 0_21 export PATH=$PATH: /usr/local/jdk 1. 7. 0_21/bin – # source /etc/profile • Unzip the j. UDDI package and enter the subfolder – # unzip juddi-portal-bundle-3. 1. 3. zip – # cd juddi-portal-bundle-3. 1. 3/bin/ • Start up a j. UDDI server (Shutdown the server with script shutdown. sh) – # chmod 777 startup. sh – #. /startup. sh Using CATALINA_BASE: /home/tong/j. UDDI/juddi-portal-bundle-3. 1. 3 Using CATALINA_HOME: /home/tong/j. UDDI/juddi-portal-bundle-3. 1. 3 Using CATALINA_TMPDIR: /home/tong/j. UDDI/juddi-portal-bundle-3. 1. 3/temp Using JRE_HOME: /usr/local/jdk 1. 7. 0_21 Note: Run startup. bat to start up a j. UDDI server in Windows 5
Use a j. UDDI Registry Server • Open a Web Browser – Firefox 20. 0. 1 – Internet Explorer 8 Our j. UDDI Server’s Address and Port • Type “http: //mouse. cs. memphis. edu: 8080/juddiv 3” in the browser address box • The j. UDDI Welcome home page should appear 6
Use a j. UDDI Registry Server (Cont. ) • View service listing – http: //mouse. cs. memphis. edu: 8080/juddiv 3/services • Log in j. UDDI Portal – http: //mouse. cs. memphis. edu: 8080/pluto/portal/j. UDDI – Verify/change username and/or password in the file juddi-portalbundle-3. 1. 3/conf/tomcat-users. xml 7
An Example of a j. UDDI Registry Client • Simple. Publish. java – This java code is an example provided by the Apache Software Foundation for tutoring you on how to publish your own web service to j. UDDI – http: //juddi. apache. org/source-repository. html 8
How to get the buildable source code? • Prerequisites – Install the Java SE Development Kit (JDK) • http: //www. oracle. com/technetwork/javase/downloads/jdk 7 -downloads 1880260. html – Install the Eclipse IDE • http: //www. eclipse. org/downloads/ – Install the Eclipse Subversion plugin • Click Help -> Install New Software… This pops up an Install window. • In the Install window’s Work with: dropdown, select “--All Available Sites--”. In the filter field (initially containing the words “type filter text”), enter Subversive. This causes the Name/Version columns to update. (Eclipse is very slow in updating the table. ) • Check the box next to Subversive SVN Team Provider, and click the Next button. Click through the installation wizard by clicking Next/Finish/etc. , and restart Eclipse when prompted. When Eclipse starts, it pops up an Install Connectors window. • From the Install Connectors window, select the newest version of SVN Kit (not Java. HL), and click Finish. This causes an installation wizard to pop up. • Click through the installation wizard by clicking Next/Finish/etc. , and restart Eclipse when prompted. When Eclipse restarts, you are back at the Welcome screen. • Click the Workbench button. This opens the Java EE perspective. • Click Window -> Open Perspective -> Other… This pops up a list of perspectives. • Select SVN Repository Exploring from the list to open the perspective. The left column of the main Eclipse window has a SVN Repositories view. – Install the Eclipse Maven plugin • http: //matsim. org/node/366 9
How to get the buildable source code? (Cont. ) • Download the buildable source code in Eclipse – Go to the SVN Repository Exploring perspective. – Click the New Repository Location button at the top of the SVN Repositories view. This should open a New Repository Location window with fields for you to fill in. – Fill in the URL field as http: //svn. apache. org/repos/asf/juddi/tags/juddi -3. 1. 3, and click Finish. This should add the repository to the SVN Repositories view. – Expand the contents of the repository by clicking the triangle. You should see a docs/examples/simple-publish folder. – Right click on simple-publish, and select Check Out. Go to the Java EE perspective. You can see the simple-publish project. – Modify the content of all the elements <version> under <dependencies> to 3. 1. 3 in pom. xml in the simple-publish project. – Right click on simple-publish, and click Maven->Enable Dependency Management. The entire buildable source code is downloaded automatically. 10
pom. xml 11
Configure the Connection to a j. UDDI Server • The j. UDDI client has a configuration file, called “uddi. xml”, in which you can change the server name and port number 12
Demo • Publish a web service – j. UDDI Client: Run Simple. Publish. java as a Java Application, and check the result in the console – j. UDDI Server: Check j. UDDI -> UDDIBrowser Portlet, and one more web service should appear • Query and Delete a web service – j. UDDI Client: Run Simple. Delete. java – j. UDDI Server: The queried web service should disappear in j. UDDI -> UDDIBrowser Portlet 13
Steps for publishing • Set up the values to get an authentication token for the 'root' user. • Make API call that retrieves the authentication token for the 'root' user. • Create a new publisher that we will use to publish our entities to. • Add the publisher to the "save" structure, using the 'root' user authentication information and save it. • Our publisher is now saved, so now we want to retrieve its authentication token. • Create the parent business entity that will contain our service. • Add the business entity to the "save" structure, using our publisher's authentication information and save it. • Create a service to save. Only add the minimum data: the parent business key retrieved from saving the business above and a single name. • Add binding templates, etc. . . • Add the service to the "save" structure, using our publisher's authentication information and save it. • Now you have a publisher saved who in turn published a business and service via the j. UDDI API. 14
Reference • [1] Apache i. UDDI Project http: //juddi. apache. org/ • [2] Apache j. UDDI User Guide http: //juddi. apache. org/docs/3. x/userguide/html/index. html • [3] j. UDDI Blog http: //apachejuddi. blogspot. com/search? updated-max=201009 -11 T 14: 43: 00 -07: 00&max-results=7&start=7&bydate=false • [4] Tutorial for Using Eclipse http: //matsim. org/book/export/html/364 15
- Slides: 15