SoapClient Module

# Introduction to the SoapClient Module

The SoapClient module implements a minimal SOAP client using WSDL, XSD, SOAP support implemented in the WSDL module.

Create outgoing request messages by setting up a Qore data structure corresponding to the SOAP message. Exceptions will be thrown if either the outgoing or the response message do not corespond to the WSDL. The exceptions should be fairly verbose to allow you to quickly correct any mistakes.

Currently the WSDL implementation is fairly basic so any messages using unimplemented features of SOAP or XSD will fail.

This module requires the following modules which are also reexported to the program context:

- xml binary module
- WSDL user module
- Mime user module

# Example

Here is an example of how to use this module:

%requires SoapClient
SoapClient sc = new SoapClient(("wsdl" : "http://soap.server.org:8080/my-service?wsdl"));
hash msg = getMessage();
any result = sc.call("SubmitDocument", msg);

The SoapClient::constructor() takes named arguments in the form of a hash; valid arguments are:

- required keys: one of:
  - `"wsdl"` or `"wsdl_file"`: a string defining the WSDL or the URL of the WSDL
- optional keys:
  - `"service"`: the name of the "portType" to use (if more than 1 portType is defined in the WSDL then this key is mandatory
  - `"url"`: to override the URL defined in the WSDL
  - `"headers"`: to override any HTTP headers sent in outgoing messages
  - `"event_queue"`: to set an I/O event queue on the HTTPClient
  - `"log"`: a closure or call reference taking a single string argument for informational logging
  - `"dbglog"`: a closure or call reference taking a single string argument for verbose technical debugging logging

Also the following keys can be set to set HTTP options:

- `"connect_timeout"`
- `"http_version"`
- `"max_redirects"`
- `"proxy"`
- `"timeout"`

# SoapClient Release Notes

## SoapClient v0.2.4

- handle SOAP fault messages returned with 500-series error codes as Fault messages
- added optional logging closures, added SOAP headers to info hash when available
- fixed URI request path, fixed agent string
- added the following methods:
  - SoapClient::SoapClient::addDefaultHeaders()
  - SoapClient::SoapClient::getDefaultHeaders()
  - SoapClient::SoapClient::getSendEncoding()
  - SoapClient::SoapClient::getWebService()
  - SoapClient::SoapClient::setContentEncoding()
  - SoapClient::SoapClient::setSendEncoding()

## SoapClient v0.2.3

- updated to a user module