Generating WSDL Documents for a Web Service Application

From RAD Studio
Jump to: navigation, search

Go Up to Writing Servers that Support Web Services


To allow client applications to know what Web Services your application makes available, you can publish a WSDL document that describes your invokable interfaces and indicates how to call them.

To publish a WSDL document that describes your Web Service, include a Soap.WSDLPub.TWSDLHTMLPublish component in your Web Module. (The SOAP Server Application wizard adds this component by default.) TWSDLHTMLPublish is an auto-dispatching component, which means it automatically responds to incoming messages that request a list of WSDL documents for your Web Service. Use the WebDispatch property to specify the path information of the URL that clients must use to access the list of WSDL documents. The Web browser can then request the list of WSDL documents by specifying an URL that is made up of the location of the server application followed by the path in the WebDispatch property. This URL looks something like the following:

 http://www.myco.com/MyService.dll/WSDL 
Tip: If you want to use a physical WSDL file instead, you can display the WSDL document in your Web browser and then save it to generate a WSDL document file.
Note: In addition to the WSDL document, the THWSDLHTMLPublish also generates a WS-Inspection document to describe the service for automated tools. The URL for this document looks something like the following:
 http://www.myco.com/MyService.dll/inspection.wsil 

It is not necessary to publish the WSDL document from the same application that implements your Web Service. To create an application that simply publishes the WSDL document, omit the code that implements and registers the implementation objects and only include the code that defines and registers invokable interfaces, remotable classes that represent complex types, and any remotable exceptions.

By default, when you publish a WSDL document, it indicates that the services are available at the same URL as the one where you published the WSDL document (but with a different path). If you are deploying multiple versions of your Web Service application, or if you are publishing the WSDL document from a different application than the one that implements the Web Service, you will need to change the WSDL document so that it includes updated information on where to locate the Web Service.

To change the URL, use the WSDL administrator. The first step is to enable the administrator. You do this by setting the AdminEnabled property of the TWSDLHTMLPublish component to true. Then, when you use your browser to display the list of WSDL documents, it includes a button to administer them as well. Use the WSDL administrator to specify the locations (URLs) where you have deployed your Web Service application.

See Also