On December 19, 2000, Microsoft published a new version
of its SOAP Toolkit (2.0 Beta 1), supporting WSDL. This
latest version SOAP Toolkit provides:
- client-side components for invoking Web Services described
by a WSDL document
- server-side components which use the WSDL and WSML (Web
Service Meta Language) documents residing on the server
to perform mapping between the Web Services invoked and
the COM object methods
- components for deserializing (breaking down), transmitting
and reserializing (putting back together) SOAP messages
Toolkit 2.0 Beta 1 makes it possible to call services and
publish them according to two Application Program Interface
(API) levels: high or low. The choice will depend on the
characteristics of the SOAP message that you wish to send
or the level of monitoring of the service to be called.
toolkit also provides a means to generate WSDL from the
services described in a COM object. You give the service
endpoint, the location of the related DLL, the name of the
WSDL file that you wish to build… and the wizard does the
rest. For unrecognized parameter types, it sends back '?????'
and you will then need to specify the types yourself.
the old version of SOAP Toolkit for Visual Basic 6.0 used
proprietary format SDL files, Microsoft was not making any
progress in boosting interoperability of Web Services. But
by releasing this new version of the toolkit, Microsoft
is changing its strategy and taking a step towards standardization
or, at least, interoperability of implementations. Our tests
revealed a fair level of interoperability, although some
problems were encountered with the Apache implementation.
The purpose of this document is to explain precisely how
Microsoft's SOAP Toolkit is used.
and server objects run in a Windows environment.
- SOAP client objects run in Windows 98, ME, NT4.0 and
- SOAP server objects run in Active Server Pages in Windows
2000 and NT4.0 Sp6
the Toolkit is installed, the XML parser (MSXML3.0) is saved
in the system. New DLLs are also registered if you have
been using the old version of SOAPToolkit released in November.
The SOAP Toolkit features two approaches for using SOAP:
a Usage approach (High API) and a Development approach (Low
Usage approach: High API
approach makes programming easy for developers by keeping
all the technical details hidden.
side: calling a Web Service with high API
following example features a Web Service available on http://www.xmethods.net
and performs a ping from the Xmethods server to a host using
the WSDL of the related service. First of all, the client
application instantiates a SoapClient object which is implemented
soapclient = CreateObject("MSSOAP.SoapClient")
instantiation is complete, the SOAP object can call the
mssoapinit() method. This method has three parameters: the
URI of the WSDL file, the name of the service (same name
as the SERVICE tag in the WSDL) and the port name (the same
name as the PORT tag in the WSDL).
PingService.wsdl", "PingService", "PingPort")
this call is completed, all the WSDL methods become available
(the names are those of the OPERATION tag in the WSDL),
and all that remains to be done is to choose the required
SOAP communication: client side
side: Offering a Web Service with high API
illustrate the server side of the high API, we have directly
reproduced an example from Microsoft's SOAP Toolkit 2.0
Beta 1, included in the download file. It shows the standard
server-side model for processing a SOAP message requiring
WSDL for execution. MS SOAP Toolkit 2.0 is based on ASPs.
It starts by invoking a SoapServer object which creates
an instance of a COM object defined in the WSML document
(this document can be generated by a Toolkit, which requests
the COM object in which the services are located, the URL
of the SOAP server and the name of the required document).
The SoapServer object decodes the parameters of the SOAP
request, and uses them to call the right methods. It retrieves
the result of the execution, places the result in a SOAP
message and sends it back to the client.
ASP scripts below correspond to the SOAP Endpoint ASP scripts
on the server side.
LANGUAGE = VBScript %><% Response.ContentType
= "text/xml" %>
set soapserver = CreateObject("MSSOAP.SoapServer")
wsdl = Server.MapPath("Sample.wsdl")
wsml = Server.MapPath("Sample.wsml")
call soapserver.init(wsdl, wsml)call soapserver.SoapInvoke(request,
SOAP Communication: server side
using a high API you can send and receive SOAP information
without having to write code. The Toolkit uses a WSDL file
as a method to reach the requested service. The advantage
is to be able to map an existing COM object by making it
Approach: Low API
This approach exposes the technical details of the SOAP
message. The Toolkit offers several interfaces for low-level
transactions. These low-level interfaces enable the client
to generate SOAP messages, send them to the server and process
side: Calling a Web Service with a low API
The different objects used to execute SOAP messages are
- SoapConnector sends and receives SOAP messages
- SoapSerializer builds the SOAP message and sends
it to the server
- SoapReader reads the response from the server
us use the same service to be called as for the High API
(XMethods Ping). First of all, the SoapConnector object
is created which manages the sending and receiving of SOAP
messages. The EndPoint property is then instantiated with
the service address. To initialize and prepare the connection,
you can call the Connect method. The SoapConnector's SoapAction
property provides the value required for the SOAPAction
field in the SOAP header.
Connector.Connect Nothing Connector.Property("SoapAction")
BeginMessage method of the SoapConnector is then ready to
send the SOAP message.
SoapSerializer object is used to manually create the message.
This creation process is very intuitive and involves creating
the payload step by step. The first step is to create the
envelope, followed by the body, then an element for which
- the name of the service which will use this element
- URI, means of coding
- tag prefix.
the name of the element and its value must be indicated.
All the Serializer properties have end properties, which
means that corresponding to Serializer.startEnvelope is
Serializer.endEnvelope. This structure corresponds to the
generation of an XML payload.
EndMessage method of the Connector indicates the end of
the SOAP message to be sent to the server.
"urn:xmethodsSoapPing", , "namesp01"
Serializer.endBody Serializer.end Envelope
server executes the requested operation and sends back the
SOAP message. The returned Response contains either the
result of the operation, or a Fault element describing the
error. The Response object can be read with the SoapReader
Reader.Load Connector.OutputStream object parses the Document
Object Model (DOM) tree and reads the OutputStream message
returned. The result can then be displayed.
Interoperability: SOAP Client (MSSOAP) SOAP Server
(SOAP::Lite hosted by XMethods)
side: Offering a Web Service with low API
different elements used to process SOAP messages are as
- SoapReader reads the incoming SOAP message request
and builds a DOM tree
- SoapSerializer builds the SOAP message containing
the result of the operation and sends it to the client
example, taken from those provided in Microsoft's SOAP Toolkit
2.0 Beta1, sends 'Hello' or 'Bye Bye' depending on the name
of the requested method. The endpoint here is therefore
an ASP which manages client requests. Each time the server
receives a SOAP request, it instantiates a COM object. Then
the server invokes the Process method of this object. Its
two parameters are the incoming and outgoing SOAP messages.
The Endpoint ASP script is as follows:
Set SpeechSrv = Server.CreateObject("TestHello.SpeechSrv")
SppechSrv.Process Request, Response
the server side, the process in the COM object involves
three steps: retrieving the information, performing the
operation, and sending the response.
following VB code for the COM object gives the key elements
required to carry out the operation:
Process function which performs the operation
Public Sub Process(ByVal Request As ASPTypeLibrary.Request,
ByVal Response As ASPTypeLibrary.Response)
Load request in Reader object
Retrieve required information
' Base name - with RPCStruc.baseName property
MethodName = Reader.RPCStruct.baseName
Value of element A - with property
A = CDbl(Reader.RPCStruct.selectSingleNode("A")Text)
If (MethodName = "Morning") Then
Answer = "Hello!"
Anwser = "Bye Bye!"
Construction of response header
Response.ContentType = "text/xml"
' Construction of response XML payload
Serializer.startElement MethodName & "Response",
Serializer.startElement "Answer", "uri:Speech"
SOAP communication: server side
difference between the low API illustrated here and the
high API is that in the former case, incoming and outgoing
messages are directly processed by the COM object. For a
high API, the SOAP Server automatically takes care of these
The advantage of this programming method is that it makes
it possible to monitor the message generator very precisely,
and allows customized error management to be developed.
The major disadvantage is that such COM objects are solely
designed to be called via SOAP. So when using this method,
it would be wise to externalize all the business logic to
another COM object and to keep only the SOAP processes in
the object presented as a Web Service, as the following
use with COM objects in low API
SOAP Toolkit 2.0 Beta 1 enables us to call or create SOAP
services using two API levels.
high API enables the client to make simple calls using the
WSDL of the service called. Interoperability is not 100
percent, however, as these clients cannot as yet use services
developed with the Apache SOAP implementation, which requires
the type of the parameters sent.
Those wishing to offer services can do so via an ASP and
a COM object. A WSML file makes the connection between the
WSDL and the service itself, which is described in a COM
object. Mapping is carried out in the ASP using methods
contained in the new libraries.
The low API enables the client to monitor the message independently
(or not) from the service described by the WSDL. Server
side, the implementation makes it possible to offer services
and monitor messages. This low API means that developers
can process messages with the methods made available. The
advantage is therefore that flows can be monitored and errors
is carving itself out a good position by offering an easily
accessed, detailed product for calling Web Services using
SOAP. The examples given by Microsoft on this new toolkit
include insertion of SOAP in Office applications such as
Excel, so Office users can now have the current Euro-Dollar
exchange rate in their Excel functions, for example. However,
few Web Services except those on Microsoft's www.gotdotnet.com
site are currently deployed on the Web with this new technology.
Nevertheless, the chances are that the advent of .Net will
see a whole plethora of Web Services blossom on the Internet.