Initial Setup for Sending SOAP Requests
You can send SOAP HTTP requests to the server computer that is running Microsoft® SQLXML to execute a stored procedure or an XML template. The server running SQLXML executes the requested and returns the corresponding SOAP response to the client.
The following initial setup is necessary before you can send SOAP HTTP requests to the server running SQLXML:
- Create a virtual directory. In this virtual directory, you must define a virtual name of soap type. For more information about creating a virtual directory, see IIS Virtual Directory Management for SQL Server.
- Configure the virtual name of the soap type that was created in the previous step. This configuration process generates the Web Services Description Language (WSDL) file that describes the service, along with the operations (stored procedures, user-defined functions, and templates) in the service that a client can request.
After you have created the WSDL file, write your client application to send SOAP requests for specific operations (as defined in the WSDL) to the server running SQLXML.
Step 1: Creating the Virtual Directory and Virtual Name
The virtual directory and a virtual name of soap type can be created either by using the IIS Virtual Directory Management for SQLXML 3.0 utility (see Using the IIS Virtual Directory Management for SQLXML 3.0 Utility) or programmatically by using the IIS Virtual Directory Management for SQL Server object model (see IIS Virtual Directory Management for SQL Server Object Model).
Each virtual name of soap type has a WSDL file associated with it. The WSDL file defines a service that consists of a set of operations (methods) (the stored procedures, user-defined functions, and templates) that a client can request (call).
The sample applications that are provided in Sample Applications for Sending SOAP Requests provide you with step-by-step instructions for creating a virtual directory with a virtual name of soap type. This virtual directory is then used in the sample applications.
Step 2: Configuring the Virtual Name
A virtual name of soap type must be configured. In this process, you identify a list of stored procedures, user-defined functions (UDFs), and templates that you want to make available for the client to call. The configuration process establishes the necessary mapping between these stored procedures, UDFs, templates and the SOAP operations by creating the corresponding WSDL file. This mapping is then used to execute the requested operation.
The stored procedures that you add during the configuration process must not return XML (that is, the FOR XML clause must not be specified for the queries in the stored procedures) because the XML formatting (RAW or Nested) is applied on the client-side, as specified in the configuration process.
The configuration process also creates a configuration file (with an .ssc file extension) in the folder that is associated with the virtual name of soap type. The WSDL file is then automatically generated from the configuration file and stored in the same folder. The Web service name that you specify when you create the virtual name of soap type is used as the file name for the configuration and WSDL files. Each time you modify the configuration, the configuration file is updated and the corresponding WSDL file automatically regenerated.
In a virtual directory, you can create several virtual names of soap type. Each of these virtual names has its own configuration file and WSDL file.
Now you can write your client application to send SOAP requests to the server running SQLXML. For more information, see Writing Client Applications.
IIS Virtual Directory Management for SQL Server
Sample Applications for Sending SOAP Requests
Guidelines and Limitations of SOAP Support in SQLXML