Lab 21 Notes Before doing the lab: 1. Browse to http://ant.apache.org/bindownload.cgi and download the ZIP apache-ant-1.9.5-bin.zip. Unzip the archive to the libtrain2 folder - you should end up with a folder named apache-ant-1.9.5. In the Control Panel, search for Environment Variables, then append: ;c:\users\libtrain2\apache-ant-1.9.5\bin; To the User PATH. Close any command-prompts, then open a new one and enter: ant You should see a message: Buildfile: build.xml does not exist! Build failed 2. Browse to https://jax-ws.java.net/2.2.10 and download jaxws-ri-2.2.10.zip. Unzip the archive to the libtrain2 folder. You should end up with a folder named jaxws-ri. Use Windows Explorer to determine your Tomcat installation directory. Open a command prompt and change to the jaxws-ri directory. Enter the following, pressing Enter after each line: SET CATALINA_HOME=c:\users\libtrain2\--TOMCAT DIR--- ant install Part 1: ------- Step 2: Create only the Web project. After creating it, import all of the JARs from jaxws-ri/lib into the the project's WEB-INF/lib folder. Step 3: Should work as written (Eclipse instead of RAD). After doing Step 3, do these two additional steps before going to Step 4: 3a. Open the WEB-INF/web.xml deployment descriptor into the Eclipse XML editor, then add the following above the welcome-file element: com.sun.xml.ws.transport.http.servlet.WSServletContextListener WebServicePort com.sun.xml.ws.transport.http.servlet.WSServlet 1 WebServicePort /myservice 3b. Create a new file in the WEB-INF folder named sun-jaxws.xml and complete it: Step 4: Add the Web project to Tomcat, then start Tomcat. Step 5: Skip this step. Instead: Open a Web browser and navigate to: http://localhost:8080/Lab21Web/HelloWorldService You should see a page describing the service. Click the link for the WSDL and see if you can make any sense of it. Copy and paste the WSDL URL into the clipboard for future use. More Step 5 Additional: From the Eclipse menu, choose Run - Launch The Web Services Explorer and wait for it to open. The Web Services Explorer (WSE) is a generic Web services client provided by Eclipse that lets you easily test your services. Note: We recommend that you double-click on the WSE titlebar tab to maximize the view. You can restore it by double-clicking on the tab again. In the WSE toolbar, in the top right, hover your mouse over the icons to find the icon for WSDL Page, then click on it. Then in the Navigator pane (on the left side), click WSDL Main. Paste the service URL from the clipboard into the WSDL URL entry field, then press Go. In the WSE right-side pane, there's a section labeled Operations that contains a clickable list of the methods exposed as Web services -- in this case, only the hello method. Click on the hello link, and in the resulting window, click the Add link, then enter your name to provide the argument to your Web service method. Press the Go button to invoke the service -- you should see the returned string in the Status pane. Does it match your expectations? You can close the Web Browser for the WSE when you are finished experimenting. Parts 2 and 3: Skip these parts.