Let's start by creating a simple COM component with a few methods and
calling it from a client application using the ROPE proxy object.
The COM object looks like this starting with the mandatory HelloWorld
method: Figure 2 – The SDL Wizard asks for a COM component to import
The first step is to pick a COM componet that the Wizard will work with.
The Wizard will generate one SDL file for each class you select from the
next dialog:
Figure 2 – The SDL Wizard lets you pick which methods to expose via
the Web Service. Each COM class/interface you select is generated into
a separate SDL and ASP file.
Notice the red methods in Figure 2. These methods mean that the parameters
and return types were not set up with specific types but use variants
instead. SOAP will allow you to use variant parameters but they will always
be returned as Text rather than by their variant types. For example, the
above evaluate method takes a string input parameter but a variant output
parameter so we can return any result that our COM object can EVAL to
(a string, a date or numeric value etc.). If a numeric value is returned
SOAP will return the number but it will be returned as a string. The same
goes for dates and logical values (1 or 0 for True and False respectively).
In the final two steps you need to tell the Wizard where your Web service
will be located:
Figure 3 – You have to specify the HTTP location where the Web service
will be accessed from. This Web virtual directory must already exist –
the Wizard will not create it.
Figure 4 – This dialog requests the physical location for the file
that the Wizard will generate. Again this directory must exist and should
be the physical directory of the Web location chosen in the previous step.
Creating a Web Service from a COM object
#DEFINE CRLF CHR(13)+CHR(10)