Connecting to a Web Service and Opening Files
In this section, you will learn how:
•A web service can be accessed using XMLSpy
•A WSDL file on the web can be opened in XMLSpy
•An XML Schema associated with the WSDL document can be opened in XMLSpy
Accessing a web service
A web service is typically accessed via an HTML page. One such page is DebuggerClient.htm, which is in the Examples folder as well as in the XMLSpy project Examples/Soap Debugger (open Examples.spp to work with the project). To access the web service displayed on this page, do the following:
1. | Activate the Project window if it is not visible (using the menu option Window | Project window). |
2. | Click the expand icon next to the SOAP Debugger folder, and double-click the file DebuggerClient.htm. This opens the SOAP Debugger Example Client in the Main Window. |
Opening a WSDL file in XMLSpy
To open a web-based WSDL file in XMLSpy, do the following:
1.Select the menu option File | Open and, in the Open dialog, click the Switch to URL button. Then enter or copy the address http://www.nanonull.com/TimeService/TimeService.asmx?WSDL into the File URL field of the dialog box.
2. | Click Open to load the WSDL file. The WSDL file is displayed in Text View. |
3. | Select the menu option File | Save As, and save the file locally, naming it, say, timeservice.wsdl. |
4. | Click the WSDL View tab to display the file in the graphical WSDL editor. |
Viewing the schema file associated with the active WSDL file
With the timeservice.wsdl file as the active document in WSDL View, select the menu option WSDL | Types | Edit Schema(s) in Schema View. This opens the schema file that defines all the datatypes used in the timeservice.wsdl file. You can modify the schema and save changes. These changes will take effect as soon as the WSDL file is re-parsed.
Note: | It is recommended to access WSDL by using its file name (for example: timeservice.wsdl) rather than by using the ?wsdl query method. This is because the query method might return a WSDL file that lacks some features of the original WSDL file, or one which does not work correctly. |