Now that you have deployed your Web Service to an application server, it s time to test your Web Service. Ultimately you will want to write a client or at least a sample client to provide to your customers or vendors (i.e., users of the Web Service), but the quickest way to test the Web Service is via the Web Service home page.
For each Web Service that you deploy, Oracle s Application Server automatically generates a supporting Web Service home page. The home page includes a link to the WSDL file, a link to each available method, and proxy links. If you forgot the URL to access each of your Web Services, simply double-click the Web Service and click the File Locations tab. As you can see in 17-22, the Web Service endpoint field contains the URL.
For each of our three examples, the respective URLs are
http://tuscbdb3.tusc.com:8888/Oracle10gWebServices-Project-context-root/DatabaseStatus
http://tuscbdb3.tusc.com:8888/Oracle10gWebServices-Project-context-root/DOMESTICTAPI
http://tuscbdb3.tusc.com:8888/Oracle10gWebServices-Project-context-root/COMPANY
Breaking down the above URLs:
http:// Hypertext transfer protocol that is used to access the application server from a browser (or client, too).
tuscbdb3.tusc.com Name (including the domain name ) of our application server.
8888 Port the application service is running on.
Oracle10 g WebServices-Project-context-root Root directory for our Web Services.
DatabaseStatus, DOMESTICTAPI, and COMPANY Names of the specific Web Service.
We executed the DatabaseStatus URL, which resulted in a browser page showing the available methods (only one for this Web Service), as shown in Figure 17-27. Next , we clicked the databaseUp method, then entered a number of values, as shown in Figure 17-28. Finally, we executed the Web Service by clicking the Invoke button. You can see the results (in XML) of the invocation in Figure 17-29. As you can see from the result set, this procedure returns a Boolean (i.e., true or false) result.
We executed the DOMESTICTAPI URL, which resulted in the browser page showing the available methods, as depicted in Figure 17-30. This class required that we execute the openWebService, noLocalDB, and openTable methods before we could execute the fetchTableSet method. Finally, we executed the fetchTableSet method by clicking the Invoke button after entering the number of rows to return. You can see the results (in XML) of the invocation in Figure 17-31, which only shows a partial row from the DOMESTIC spreadsheet. If we execute the fetchTableSet method again within 20 seconds, we ll retrieve the next set of records from the DOMESTIC spreadsheet. Otherwise, the data set will again start at the beginning.
We executed the COMPANY URL, and then added an employee using the addEmp method. Next, we executed the getEmp method using an ID of 1, then clicked the Invoke button. You can see the results (in XML) of the invocation in Figure 17-32.