- Understanding SOAP FAQs
- How do I invoke a method on a server when I'm using SOAP?
- Do M-POST calls have to occur before POST calls?
- When I'm using XML in SOAP, do I have to use namespaces?
- What happens when a method call has been requested?
- What are the values in a SOAP payload?
- What could cause the performance of a SOAP call to degrade or suffer?
- What kind of security does SOAP implement?
- When using SOAP, how do I implement a simple API for XML?
- How will SOAP impact .Net application development?
- How is ASP+ used when creating web services?
- How do I validate SOAP-based XML using a schema?
- When using SOAP, what is the most efficient way to access services from a client over the Internet?
How do I validate SOAP-based XML using a schema?
For simple remote method access, you may find it's enough to request a string or an integer and leave it at that. Many of the demonstration language bindings take this approach. But if you're interested in more complex interactions, you'll soon find you want to validate the SOAP-based XML using a schema. It would be even better if the schema conveyed some information regarding the intent of the remote method call. That is, if the remote method adds two integers and returns the result of that addition, you can make use of that information when checking the result or placing reasonable constraints on the input arguments.
This latter intent is the purpose of the Service Description Language, or SDL. SDL actually defines an XML grammar your Web Services use to express their capabilities, allowing them to expose the services they offer so you can better match the service you need.
The following Listing shows you the corresponding SDL that the ASP+ server would use to export the two strings returnable through the HelloWorld class.
Listing SDL Description of the HelloWorld ASP+ Class
See code:
As you can see from this Listing, the HelloWorld class's description is contained in an XML document bound by the serviceDescription tag. The serviceDescription tag contains several other tags:
-
soapDescribes the SOAP packet itself
-
httppostThe relevant HTTP information for the client's request
-
httpgetThe relevant HTTP information for the server's response
-
schemaXML schemas associated with the SOAP data
Essentially, you are scripting the layout of the SOAP packets and telling external clients that you export certain methods composed of certain input and output argument data types.
Source: This FAQ is excerpted from Understanding SOAP by Kennard Scribner and Mark C. Stiver (2000, Sams, ISBN 0672319225). Refer to this book for more detailed information on SOAP.