Exploring the SoapEnvelope Class in WSE2.0
(Page 1 of 5 )
This article, the first of two parts, will explore the SoapEnvelope class in WSE2.0 by examining some of its properties and methods. The namespace to which this class belongs has a large number of classes and each of them have a large number of properties and methods; that includes the inherited ones. We will only highlight a few of them here.
WSE2.0 provides the class libraries that add the power to the .NET Class libraries in extending the web services capabilities to the existing web services architecture. Soap messaging in WSE2.0 is a key to many enhanced capabilities that provides support for communication using protocols other than HTTP. This amounts to not needing even a web server when the TCP protocol is used. The request/response model of HTTP is really not needed when sending messages, especially when no messages are expected to be returned. However, messaging by HTTP is also supported.
The SOAP is well known as an extremely lightweight protocol requiring fewer resources from the sender or recipient of a communication. Since it is XML based, any system capable of parsing XML should be capable of communicating by using this protocol. The basic unit of communication in SOAP is a SOAP Message. WSE2.0 provides a large number of classes in the Microsoft.Web.Services2 name space that makes the communication possible with flexible lightweight web services. A partial list of related classes in this name space is the following:
Soap
Soap.AttributeName
Soap.ElementNames
SoapContext
SoapEnvelope
SoapFault
SoapFormatException
SoapInputFilter
SoapInputFilterCollection
SoapOutputFilter
SoapOutputFilterCollection
SoapWebRequest
SoapWebResponse
Soap Message
A SOAP message consists of a Header, a Body and any other independent elements housed in what is called a SOAP Envelope. A SOAP message is an XML document that imposes the existence of a single root element. The Soap envelope is the top element, or the root element of the Soap message. Following the Soap envelope root element is the Soap Header which is optional; the Soap Body, which is required, follows next. This is the minimum requirement for the SOAP Message. An XML document such as the one shown in the following paragraph would represent an empty Soap Message.
<Soap_env:envelope>
<Soap_env:Header/>
<Soap_env:Body/>
</Soap_env:envelope>
Soap Envelope
This article looks at the properties and methods exposed by the SoapEnvelope class, with special reference to WSE2.0, that can be used in building web services. The public events are all inherited from XMLDocument and will not be discussed here. Some of the properties and methods pertinent to WSE2.0 will be explored by building web services and testing them.
The SoapEnvelope class comprises:

Next: SoapEnvelope Methods >>
More Windows Scripting Articles
More By Jayaram Krishnaswamy