Distributing XML Web Services

Support for XML Web services in Visual FoxPro provided by the Microsoft SOAP Toolkit make it possible for you to publish Visual COM Servers (OLEPUBLIC) as XML Web services that can be accessed from the Web. The extensions and objects available in the SOAP Toolkit provide publishing capabilities for XML Web services. For information about publishing Visual FoxPro COM Servers as XML Web services, see Walkthrough: Creating XML Web Services with Visual FoxPro.

Specifying a Default Location for XML Web Services

Before you publish an XML Web service, you can specify a default location for publication. This location is a local Web server Uniform Resource Locator (URL) or a virtual directory that you use to store XML Web service support files, such as ASP listeners and WSDL files. Although this location is optional, it can simplify the process of publishing XML Web services.

Note   The Visual FoxPro XML Web Service Location dialog box appears the first time you select Web Services on the Wizards menu. If you do not provide a default location, Visual FoxPro prompts you for the default location each time you publish a new XML Web service. You can change the location later by clicking Advanced in the Visual FoxPro XML Web Services Publisher dialog box.

For more information, see Visual FoxPro XML Web Service Location Dialog Box and Visual FoxPro XML Web Services Publisher Dialog Box.

To specify a default location for an XML Web service

  1. On the Tools menu, point to Wizards, and click Web Services.

  2. In the dialog box that appears, click OK.

  3. In the Visual FoxPro XML Web Service Location dialog box, to select an existing location to publish your XML Web service, click Existing and select a location in the Select Location (Virtual Directory) box.

    -or-

    To select a new location, click New, select a location in the Select Location (Virtual Directory) box, click the Ellipsis (...) button to specify a file output path if desired, and type a name for the directory in the New Virtual Directory Name box.

Settings for each XML Web service are preserved so that you can easily update the XML Web service, for example, if the content of the WSDL changes. These settings are stored in the FoxWS3.dbf table in the same directory as the FoxCode.dbf table (_FOXCODE).

Publishing XML Web Services

You can publish a Visual FoxPro COM Server as an XML Web service to make it available on the Web.

Note   Publishing XML Web services through the Visual FoxPro Web Services Publisher dialog box is supported only for generating WSDL files containing a single service and port or class. If you want to select multiple classes, you should use the wizard available in the SOAP Toolkit.

To publish an XML Web service

  1. On the Tools menu, click Task Pane.
  2. On the Task Pane Manager toolbar, click More Panes.
  3. In the XML Web Services pane, click Publish Your XML Web Service.
  4. In the Visual FoxPro XML Web Services Publisher dialog box, click the Ellipsis (...) button to browse for and select the Visual FoxPro COM Server you want.

You can also publish your COM Server by clicking Web Services on the Wizards menu, right-clicking an open COM Server project, clicking Builder on the shortcut menu, and selecting Web Services Publisher in the Wizard Selection dialog box. You can also open the Visual FoxPro XML Web Services Publisher dialog box using the following code:

DO (_wizard) WITH "project",,"Web"

For more information, see Visual FoxPro XML Web Services Publisher.

Test and Rebuild Process for COM Servers

When rebuilding your COM Server, you can generate XML Web service support files automatically by creating a project hook for the COM Server project that calls the XML Web service engine to rebuild the XML Web service support files. You can select this option in the Advanced dialog box of the Visual FoxPro XML Web Services Publisher dialog box. The project hook (WSHOOK) is stored in the XML Web services foundation class library, _WS3Utils.vcx, located in the ...\Ffc folder. For more information, see XML Web Services Foundation Classes.

When you are working with and testing your XML Web service, it is likely that IIS caches your COM Server for performance reasons. To rebuild your COM Server, you might need to first end the process that has the COM Server in use, for example, the IIS Out-Of-Process Pooled Applications COM+ application; otherwise, a denial of access message is generated during the project build process. This process can be a cumbersome if you must test and rebuild the COM Server frequently. The project hook in the XML Web service foundation class library, _WS3Utils.vcx, can close this process for you.

Note   You might need to change the default setting in the project hook so that the application ends, depending on which OS platform and version of IIS you are running.

For more information, see XML Web Services Foundation Classes.

Deployment of XML Web Services

When deploying Visual FoxPro applications that use XML Web services, you must include the redistributable components from the SOAP Toolkit. If your application accesses only existing XML Web services, you must include only the SOAP Client merge module.

For applications that publish XML Web services, you must include the client-side and server merge modules from the SOAP Toolkit. In addition, you must include the specific server support files, for example, ASP listener and WSDL files. You should also consider using the XML Web services foundation class files, _WS3Utils.vcx and _WS3Client.vcx, to automate this process when running the deployed application for the first time.

If you automate the XML Web service publishing process, you can create a virtual directory created and generate support files on the fly. However, it is recommended that you perform extensive Setup testing if you choose this approach for deployment.

See Also

XML Web Services in Visual FoxPro | Accessing XML Web Services