SOAP tutorial
Northwind query via SOAP Building a document style oriented Web services

## Preliminaries

The SOAP messages are XML documents which may follow encoding rules or an XML Schema. The ones that follow encoding rules are known as RPC encoded, so the XML Schema following messages are known as Document/literal encoded. Most of SOAP toolkits can work with both kind of messages, but for some purposes RPC encoded messages are not suitable.

The MS Office Infopath supports only document/literal encoded SOAP messages. So to inter operate with it, Web services have to be set to define document/literal SOAP messages and generate appropriate WSDL file.

The Virtuoso can expose a services that using document/literal encoding by two ways:

- explicit declarations in stored procedure's definition
- default SOAP encoding as an option of the SOAP enabled virtual directory

The first approach imply that procedure can be used only in the designated encoding style. So the second is more flexabile as it can switch very easy between encodings without procedure's re-definition.

To allow a stored procedure to be exposed in a virtual directory that default SOAP encoding as a document/literal it should not use explicit declarations. This is because explicit declarations are not compatible in all cases. Instead of explicit declarations a user defined types must be used to describe the structures and array modifier have to be used to describe array parameters.

## Example

The example script defines a service that do a query on Northwind Demo Database and return an array of structures containing sales volume per product category.

To run example, set the initial state and then click on the Run link or point your browser to http://[host]:[port]/NorthwindSvc/services.vsmx to go to vsmx test pages.

Note: the dateinput must follow ISO8601 format (for example: YYYY-MM-DD'T'HH:MM:SS)