Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Register Web Services with Apache jUDDI Tong Shu Department of Computer Science The University of Memphis Memphis, TN 38152, USA A Tutorial for COMP 4302 on Apr. 23, 2013 Overview • Apache jUDDI – – – – What is jUDDI? Where to get a jUDDI Registry Server? How to install / uninstall a jUDDI Registry Server? How to use a jUDDI Registry Server? • Demo of How to Register a Web Service – – – – How to get the source code of an example? Configure the Connection to a jUDDI Registry Server Publish a web service Query and delete a web service 2 What is jUDDI? • Introduction – jUDDI is an open source Java implementation of the Universal Description, Discovery, and Integration (UDDI) v3 specification for Web Services – The jUDDI project includes Scout, which is an implementation of the Java Specification Request (JSR) 93 - JavaTM API for XML Registries 1.0 (JAXR) • jUDDI Features – Open Source – Platform Independent – Use with any relational database that supports ANSI standard SQL (MySQL, Oracle, DB2, Sybase, Derby etc.) – Deployable on any Java application server that supports the Servlet 2.3 specification – jUDDI registry supports a clustered deployment configuration – Easy integration with existing authentication systems – Supports in VM embeddable mode 3 Where to Get a jUDDI Registry Server? • Binary Package – http://apache.mirrors.lucidnetworks.net/juddi/3_1_3/ • Version – juddi-portal-bundle-3.1.3.zip • jUDDI User Guide – http://juddi.apache.org/docs/3.x/userguide/pdf/userguide.pdf 4 Install a jUDDI Registry Server in Linux • Download Java JDK from – http://www.oracle.com/technetwork/java/javase/downloads/jdk7downloads-1880260.html • Set environment variables as a root – # vi /etc/profile – Append export JAVA_HOME=/usr/local/jdk1.7.0_21 export PATH=$PATH:/usr/local/jdk1.7.0_21/bin – # source /etc/profile • Unzip the jUDDI package and enter the subfolder – # unzip juddi-portal-bundle-3.1.3.zip – # cd juddi-portal-bundle-3.1.3/bin/ • Start up a jUDDI server (Shutdown the server with script shutdown.sh) – # chmod 777 startup.sh – # ./startup.sh Using CATALINA_BASE: /home/tong/jUDDI/juddi-portal-bundle-3.1.3 Using CATALINA_HOME: /home/tong/jUDDI/juddi-portal-bundle-3.1.3 Using CATALINA_TMPDIR: /home/tong/jUDDI/juddi-portal-bundle-3.1.3/temp Using JRE_HOME: /usr/local/jdk1.7.0_21 Note: Run startup.bat to start up a jUDDI server in Windows 5 Use a jUDDI Registry Server • Open a Web Browser – Firefox 20.0.1 – Internet Explorer 8 Our jUDDI Server’s Address and Port • Type “http://mouse.cs.memphis.edu:8080/juddiv3” in the browser address box • The jUDDI Welcome home page should appear 6 Use a jUDDI Registry Server (Cont.) • View service listing – http://mouse.cs.memphis.edu:8080/juddiv3/services • Log in jUDDI Portal – http://mouse.cs.memphis.edu:8080/pluto/portal/jUDDI – Verify/change username and/or password in the file juddi-portalbundle-3.1.3/conf/tomcat-users.xml 7 An Example of a jUDDI Registry Client • SimplePublish.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 jUDDI – 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/java/javase/downloads/jdk7-downloads1880260.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 JavaHL), 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 jUDDI Server • The jUDDI 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 – jUDDI Client: Run SimplePublish.java as a Java Application, and check the result in the console – jUDDI Server: Check jUDDI -> UDDIBrowser Portlet, and one more web service should appear • Query and Delete a web service – jUDDI Client: Run SimpleDelete.java – jUDDI Server: The queried web service should disappear in jUDDI -> 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 jUDDI API. 14 Reference • [1] Apache iUDDI Project http://juddi.apache.org/ • [2] Apache jUDDI User Guide http://juddi.apache.org/docs/3.x/userguide/html/index.html • [3] jUDDI Blog http://apachejuddi.blogspot.com/search?updated-max=201009-11T14:43:00-07:00&max-results=7&start=7&bydate=false • [4] Tutorial for Using Eclipse http://matsim.org/book/export/html/364 15