Qore xml Module 1.8.1
Loading...
Searching...
No Matches
SoapClient Module

Introduction to the SoapClient Module

The SoapClient module implements a SOAP client for Qore using WSDL, XSD, and 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.

This module provides the following classes:

  • SoapClient
  • SoapConnection

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<auto> msg = getMessage();
auto result = sc.call("SubmitDocument", msg);
main SoapClient namespace
Definition: SoapClient.qm.dox.h:150

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 "service" to use (if more than 1 service is defined in the WSDL then this key is mandatory)
    • "port": in case multiple port entries are found in the WSDL, give the one to be used here
    • "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 v1.0.1

  • allow connection options designating files to be selected as files (issue 4725)

SoapClient v1.0

  • added information about data provider capabilities to connection info (issue 4576)

SoapClient v0.5

  • implemented support for a data provider scheme cache and rich option information for connections (issue 4025)

SoapClient v0.4

  • removed the obsolete SoapConnection::getConstructorInfo() method as connection serialization is a much more elegant and maintainable solution (issue 3696)

SoapClient v0.3

  • added the SoapConnection::getConstructorInfo() method to allow connections to be created dynamically, potentially in another process from a network call (issue 2628)
  • fixed type error in exception handling in SOAP calls (issue 3336)

SoapClient v0.2.5

  • added support for logging content of SOAP messages
  • added the SoapConnection class

SoapClient v0.2.4.1

  • added the SoapClient::SoapClient::callOperation() method (issue 1226)
  • updated SOAP response processing to throw an exception when the server responds with an error code (issue 1228)
  • fixed a typo in a debug logging statement (issue 1358)
  • fixed and documented the "info" output hash format (issue 1359)
  • fixed a bug in the SoapClient::constructor() where a WebService object was not supported (issue 1424)

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