![]() |
Qore xml Module 2.1.0
|
SOAP client class implementation, publically inherits qore's HTTPClient class. More...
#include <SoapClient.qm.dox.h>
Inherits HTTPClient.
Public Member Methods | |
| hash< auto > | getMsg (*string soapaction, *int xml_opts, *hash< auto > http_header, reference< auto > op, *hash< auto > soap_header, string operation, auto args) |
| returns a hash representing the serialized SOAP request for a given WSOperation | |
| auto | callOperation (*reference info, *hash< auto > opts, string operation, auto args) |
| makes a server call with the given operation, arguments, options, and optional info hash reference and returns the result | |
| auto | call (*string binding, *hash< auto > http_header, *hash< auto > soap_header, string operation, auto args) |
| makes a server call with the given operation and arguments and returns the deserialized result | |
| auto | call (*string binding, *reference info, string operation, auto args) |
| makes a server call with the given operation and arguments and returns the deserialized result | |
| auto | call (*hash< auto > http_header, *hash< auto > soap_header, auto args, reference info, string operation) |
| makes a server call with the given operation and arguments and returns the deserialized result with an output argument giving technical information about the call | |
| auto | methodGate (string op) |
| uses SoapClient::call() to transparently serialize the argument and make a call to the given operation and return the deserialized results | |
| hash< auto > | getType (string type, auto v) |
| returns a hash that can be used to ensure serialization with the XSD type given as the type argument | |
| WSDL::WebService | getWebService () |
| returns the WSDL::WebService object associated with this object | |
| hash< auto > | getInfo () |
| returns a hash of information about the current WSDL | |
| void | setSendEncoding (string enc) |
| change the data content encoding (compression) option for the object; see EncodingSupport for valid options | |
| void | setContentEncoding (string enc) |
| sets the request and desired response encoding for the object; see EncodingSupport for valid options | |
| void | addDefaultHeaders (hash< auto > h) |
| adds default headers to each request; these headers will be sent in all requests but can be overridden in requests as well | |
| hash< auto > | getDefaultHeaders () |
| returns the hash of default headers to sent in all requests | |
| *string | getSendEncoding () |
| returns the current data content encoding (compression) object or nothing if no encoding option is set; see EncodingSupport for valid options | |
| void | log (string msg) |
| sends a log message to the log closure or call reference, if any | |
| void | dbglog (string msg) |
| sends a log message to the debug log closure or call reference, if any | |
Public Attributes | |
| const | Version = ... |
| version of the implementation of this class | |
| const | Headers = ... |
| default HTTP headers | |
| const | HTTPOptions = ... |
| option keys passed to the HTTPClient constructor | |
SOAP client class implementation, publically inherits qore's HTTPClient class.
| void SoapClient::SoapClient::addDefaultHeaders | ( | hash< auto > | h | ) |
adds default headers to each request; these headers will be sent in all requests but can be overridden in requests as well
| h | a hash of headers to add to the default headers to send on each request |
| auto SoapClient::SoapClient::call | ( | *hash< auto > | http_header, |
| *hash< auto > | soap_header, | ||
| auto | args, | ||
| reference | info, | ||
| string | operation | ||
| ) |
makes a server call with the given operation and arguments and returns the deserialized result with an output argument giving technical information about the call
| info | an optional reference to return a hash of technical information about the SOAP call (raw message info and headers); the following keys are present in this hash:
|
| operation | the operation name for the SOAP call |
| args | the arguments to the SOAP operation |
| soap_header | optional soap headers (if required by the operation) |
| http_header | a hash giving HTTP header information to include in the message (does not override automatically-generated SOAP message headers) |
| WSDL-OPERATION-ERROR | the operation is not defined in the WSDL |
| WSDL-BINDING-ERROR | the binding is not assigned to a SOAP operation in the WSDL |
| HTTP-CLIENT-RECEIVE-ERROR | this exception is thrown when the SOAP server returns an HTTP error code; if a SOAP fault is returned, then it is deserialized and returned in the arg key of the exception hash |
| auto SoapClient::SoapClient::call | ( | *string | binding, |
| *hash< auto > | http_header, | ||
| *hash< auto > | soap_header, | ||
| string | operation, | ||
| auto | args | ||
| ) |
makes a server call with the given operation and arguments and returns the deserialized result
| operation | the operation name for the SOAP call |
| args | the arguments to the SOAP operation |
| soap_header | optional soap headers (if required by the operation) |
| http_header | a hash giving HTTP header information to include in the message (does not override automatically-generated SOAP message headers) |
| binding | the SOAP binding name, if not provided, the first binding assigned to the operation will be used |
| WSDL-OPERATION-ERROR | the operation is not defined in the WSDL |
| WSDL-BINDING-ERROR | the binding is not assigned to a SOAP operation in the WSDL |
| HTTP-CLIENT-RECEIVE-ERROR | this exception is thrown when the SOAP server returns an HTTP error code; if a SOAP fault is returned, then it is deserialized and returned in the arg key of the exception hash |
| auto SoapClient::SoapClient::call | ( | *string | binding, |
| *reference | info, | ||
| string | operation, | ||
| auto | args | ||
| ) |
makes a server call with the given operation and arguments and returns the deserialized result
| operation | the operation name for the SOAP call |
| args | the arguments to the SOAP operation |
| info | an optional reference to return a hash of technical information about the SOAP call (raw message info and headers); the following keys are present in this hash:
|
| binding | the SOAP binding name, if not provided, the first binding assigned to the operation will be used |
| WSDL-OPERATION-ERROR | the operation is not defined in the WSDL |
| WSDL-BINDING-ERROR | the binding is not assigned to a SOAP operation in the WSDL |
| HTTP-CLIENT-RECEIVE-ERROR | this exception is thrown when the SOAP server returns an HTTP error code; if a SOAP fault is returned, then it is deserialized and returned in the arg key of the exception hash |
| auto SoapClient::SoapClient::callOperation | ( | *reference | info, |
| *hash< auto > | opts, | ||
| string | operation, | ||
| auto | args | ||
| ) |
makes a server call with the given operation, arguments, options, and optional info hash reference and returns the result
| operation | the SOAP operation to use to serialize the request; if the operation is not known to the underlying WebService class, an exception will be thrown |
| args | the arguments to the SOAP operation |
| opts | an optional hash of options for the call as follows:
|
| info | an optional reference to return a hash of technical information about the SOAP call (raw message info and headers); the following keys are present in this hash:
|
hdr: a hash of message headersbody: the serialized message body| WSDL-OPERATION-ERROR | the operation is not defined in the WSDL |
| WSDL-BINDING-ERROR | the binding is not assigned to a SOAP operation in the WSDL |
| HTTP-CLIENT-RECEIVE-ERROR | this exception is thrown when the SOAP server returns an HTTP error code; if a SOAP fault is returned, then it is deserialized and returned in the arg key of the exception hash |
| hash< auto > SoapClient::SoapClient::getDefaultHeaders | ( | ) |
returns the hash of default headers to sent in all requests
| hash< auto > SoapClient::SoapClient::getInfo | ( | ) |
returns a hash of information about the current WSDL
"service": the name of the SOAP service used"port": the name of the SOAP port used"binding": the name of the binding used"url": the target URL | hash< auto > SoapClient::SoapClient::getMsg | ( | *string | soapaction, |
| *int | xml_opts, | ||
| *hash< auto > | http_header, | ||
| reference< auto > | op, | ||
| *hash< auto > | soap_header, | ||
| string | operation, | ||
| auto | args | ||
| ) |
returns a hash representing the serialized SOAP request for a given WSOperation
| operation | the SOAP operation to use to serialize the request; if the operation is not known to the underlying WebService class and port/binding, an exception will be thrown |
| args | the arguments to the SOAP operation |
| soap_header | data structure for the SOAP header, if required by the message |
| op | a reference to return the WSOperation object found |
| http_header | a hash giving HTTP header information to include in the message (does not override automatically-generated SOAP message headers) |
| xml_opts | an integer XML generation option code; see XML Generation Constants for possible values; combine multiple codes with binary or (|) |
| soapaction | an optional string that will override the SOAPAction for the request; en empty string here will prevent the SOAPAction from being sent |
hdr: a hash of message headersbody: the serialized message bodypath: the path part of URLmethod: the HTTP request method| WSDL-OPERATION-ERROR | the operation is not defined in the WSDL |
| WSDL-BINDING-ERROR | the binding is not assigned to a SOAP operation in the WSDL |
| *string SoapClient::SoapClient::getSendEncoding | ( | ) |
returns the current data content encoding (compression) object or nothing if no encoding option is set; see EncodingSupport for valid options
| auto SoapClient::SoapClient::methodGate | ( | string | op | ) |
uses SoapClient::call() to transparently serialize the argument and make a call to the given operation and return the deserialized results
| op | the operation name, which is the method name passed to methodGate() |
| ... | zero or more arguments for the operation |
| WSDL-OPERATION-ERROR | the operation is not defined in the WSDL |
| HTTP-CLIENT-RECEIVE-ERROR | this exception is thrown when the SOAP server returns an HTTP error code; if a SOAP fault is returned, then it is deserialized and returned in the arg key of the exception hash |
| void SoapClient::SoapClient::setContentEncoding | ( | string | enc | ) |
sets the request and desired response encoding for the object; see EncodingSupport for valid options
| enc | the data content encoding (compression) option for requests and the desired response content encoding for the object; see EncodingSupport for valid options; if the value "auto" is passed then "gzip" encoding is used for outgoing requests and requested for responses |
| SOAPCLIENT-ERROR | invalid or unsupported data content encoding / compression option |
| void SoapClient::SoapClient::setSendEncoding | ( | string | enc | ) |
change the data content encoding (compression) option for the object; see EncodingSupport for valid options
The default is to send requests unencoded/uncompressed.
| enc | the data content encoding (compression) option for the object; see EncodingSupport for valid options; if the value "auto" is passed then "gzip" encoding is used |
| SOAPCLIENT-ERROR | invalid or unsupported data content encoding / compression option |