Web Service Objects .wso File
The .wso file is an INI file that makes it possible to access web service functions in a DataFlex application. The web service functions must be programmed in a cWebService object. The INI file may look like:
[WebService]
Application=WebOrder
Object=oCustOrderWebService
ServicePageGenerator=DefaultWebServiceHomePage.xslt
TestPageGenerator=DefaultWebServiceMethodPage.xslt
WSDLGenerator=DefaultWebServiceDescription.xslt
SoapBodyStyle=document
Each line contains a key (e.g., Application) and a value (e.g., WebOrder). The different keys are:
Application
This tells the DataFlex WebApp Server what application should be addressed. The name is case sensitive.
Object
The name of the cWebService object in the application.
ServicePageGenerator
The value for this key needs to be an XSLT (Extensible Stylesheet Language Transformations) file, which by default generates a human-readable page containing a header naming the service and a list of all published web service functions with documentation read from the Description meta-data tag. Each of the service functions can be clicked, and WebAppServer generates a test page for the function.
The default value for this key is DefaultWebServiceHomePage.xslt. This file resides in the LIB folder of the DataFlex installation environment. The folder also contains an alternative file that can be used instead, which disables the human-readable information about the web service. When you don't want to expose information about the web service, change the ServicePageGenerator value from DefaultWebServiceHomePage.xslt to DisabledWebServiceHomePage.xslt. However, it is not limited to this; by creating a custom XSLT file, it is possible to style the method page to match the application style.
TestPageGenerator
Like the ServicePageGenerator key in the INI file, this file creates a human-readable page that can be used to test a particular published function in this web service.
The default value for this key is DefaultWebServiceMethodPage.xslt. This file also resides in the LIB folder of the DataFlex installation environment. The folder contains an alternative file that can be used instead, which disables the human-readable test page for published functions of the web service. When you don't want to allow testing a particular function, change the TestPageGenerator value from DefaultWebServiceMethodPage.xslt to DisabledWebServiceMethodPage.xslt. Again, it is not limited to this; by creating a custom XSLT file, it is possible to style the method page to match the application style.
WSDLGenerator
This last generator key in the INI file generates a WSDL (Web Service Description Language) file. This is an XML file that most web service client tools will understand and can parse into code that can be used to call the functions of the web service.
The default value for this key is DefaultWebServiceDescription.xslt. While tweaking the results for the web service is possible via a custom XSLT file, it is more likely that the setting gets replaced by an XSLT file that disables the feature to generate a WSDL document. The new value will then be DisabledWebServiceDescription.xslt. Changing the setting results in an HTML document telling the caller that the function is disabled.
SoapBodyStyle
This setting tells what type of web service is in use. It can be either Document or RPC style.
Security
For all three generator settings, replacing the default setting with a disabled generator setting means that functions can still be called, but the caller needs to know the names, the parameters, and the return type for each function. This can be seen as a first step in making your web services more secure, as they cannot be discovered.