Document/Literal style services

There are many different styles of SOAP messages, the two most common today are rpc/encoded and document/literal (These catchy names are from the WSDL descriptions of these styles). By default PocketSOAP generates rpc/encoded style messages, this matches what the majority (at the time of press) of Web Services use, however there is a trend towards moving to document/literal services, PocketSOAP also supports this style as well.

There's no formal mapping for document/literal style SOAP between the SOAP messages and programming languages, all it says is that the SOAP message will conform to a particular XML Schema, many toolkits provide tools that will generate code for you that maps from the SOAP message to your programming lanuage types based on the XML Schema definition. PocketSOAP supports this as well, via the WSDL Wizard.

However, ASP.NET is the primary toolkit that uses document/literal today, and it uses a mapping that is very similar to the rpc/encoded mapping (but different enough that if you send an rpc/encoded message, it will ignore the parameters you send and use defaults instead), Its possible to use PocketSOAP to generate requests for many document/literal style ASP.NET services without having to use the WSDL wizard, simply specify the methodNamespace URI when creating the parameters as well, e.g.

dim e
set e = CreateObject("PocketSOAP.Envelope.2")
e.EncodingStyle = "" 
e.SetMethod "add", ""
e.Parameters.Create "a", 100, e.URI
e.Parameters.Create "b", 100, e.URI

' ... rest of normal transport code goes here

For more complex schema definitions, or for document/literal services not using ASP.NET, you can use the WSDL wizard to generate you custom types and serializers for use with PocketSOAP from the WSDL / Schema definitions.


Copyright © Simon Fell, 2000-2004. All rights reserved.