|
|
|
|
|
|
| |

|
|
What Is SOAP? -
February 26, 2001
|
Page 1 2
3 4 5
|
|
Visual Basic Example
These example messages help to illustrate
how SOAP really works, but if you're going to be working with SOAP, you'll
probably be using a toolkit of some kind. There are several out
there now, but for the example below I decided to use the Microsoft
SOAP Toolkit 2.0, which is now in its first beta cycle. The
example code below was written in Visual Basic, and it shows how to access
the TimeServer endpoint
using the Toolkit. The source code for this example can be
downloaded. There is also an example client using PocketSOAP
from VBScript.
The Microsoft SOAP Toolkit has several
different layers to its object model. There is a high-level API,
which uses proxies and stubs based on WSDL
documents. WSDL is a format for defining what a "Web
Service" can do, similar to IDL for COM or CORBA, or schemas for
XML. There is also a low-level API which allows you to build
the messages "by hand", and a separate framework designed more
for document transfers than RPC. The example below shows how to use
the high-level client API, but the example source code uses the low-level
API as well.
|
| Sample Source
Code - High Level API |
Private Sub cmdGetTime_Click()
' This routine shows how easy it is to use the Microsoft SOAP Toolkit
' given a valid WSDL file
Dim c As New MSSOAPLib.SoapClient
c.mssoapinit "http://www.topxml.com/soapworkshop/services/time/time.xml"
Dim sTime As String
' Invoke the method GetServerTime that the WSDL file describes
sTime = c.GetServerTime()
txtTime = sTime
End Sub
|
|
|
|
Transports and RPC
|
Wrap-Up
|
|
|
|
|
|
|
|
|
|