Qore SoapClient Module Reference  0.2.3
 All Classes Namespaces Functions Variables Pages
SoapClient::SoapClient Class Reference

SOAP client class implementation, publically inherits qore's HTTPClient class. More...

Inherits HTTPClient.

Public Member Functions

 constructor (hash h)
 creates the object based on a WSDL which is parsed to a WSDL::WebService object which provides the basis for all communication with this object More...
 
hash getMsg (string operation, any h, any header, reference op)
 returns a hash representing the serialized SOAP request for a given WSOperation More...
 
any call (string operation, any h, *hash header)
 makes a server call with the given operation and arguments and returns the deserialized result More...
 
any call (string operation, any h, reference info)
 makes a server call with the given operation and arguments and returns the deserialized result More...
 
any call (reference info, string operation, any h, any header)
 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 More...
 
any methodGate (string op, any arg)
 uses SoapClient::call() to transparently serialize the argument and make a call to the given operation and return the deserialized results More...
 

Public Attributes

const Version = "0.2.3"
 version of the implementation of this class
 
const Headers = ("Accept": (MimeTypeSoapXml + "," + MimeTypeXml + "," + MimeTypeXmlApp), "User-Agent": ("Qore Soap Client " + SoapClient::Version))
 default HTTP headers
 
const HTTPOptions = ( "connect_timeout", "http_version", "max_redirects", "proxy", "timeout" )
 option keys passed to the HTTPClient constructor
 
string url
 target URL
 
hash headers = Headers
 HTTP headers to use.
 

Detailed Description

SOAP client class implementation, publically inherits qore's HTTPClient class.

Member Function Documentation

any SoapClient::SoapClient::call ( string  operation,
any  h,
*hash  header 
)

makes a server call with the given operation and arguments and returns the deserialized result

Parameters
operationthe operation name for the SOAP call
hthe operation parameter(s)
headeroptional soap headers (if required by the operation)
Returns
the deserialized result of the SOAP call to the SOAP server
any SoapClient::SoapClient::call ( string  operation,
any  h,
reference  info 
)

makes a server call with the given operation and arguments and returns the deserialized result

Parameters
operationthe operation name for the SOAP call
hthe operation parameter(s)
infoan optional reference to return a hash of technical information about the SOAP call (raw message info and headers)
Returns
the deserialized result of the SOAP call to the SOAP server
any SoapClient::SoapClient::call ( reference  info,
string  operation,
any  h,
any  header 
)

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

Parameters
infoan optional reference to return a hash of technical information about the SOAP call (raw message info and headers)
operationthe operation name for the SOAP call
hthe operation parameter(s)
headeroptional soap headers (if required by the operation)
Returns
the deserialized result of the SOAP call to the SOAP server
SoapClient::SoapClient::constructor ( hash  h)

creates the object based on a WSDL which is parsed to a WSDL::WebService object which provides the basis for all communication with this object

one of either the wsdl or wsdl_file keys is required in the hash given to the constructor or an exception will be thrown

Parameters
hvalid option keys:
  • wsdl: the URL of the web service or a WSDL::WebService object itself
  • wsdl_file: a path to use to load the WSDL and create the WSDL::WebService object
  • url: override the target URL given in the WSDL
  • [portType]: in case multiple portType entries are found in the WSDL, give the one to be used here
  • [port]: in case multiple port entries are found in the WSDL, give the one to be used here
  • also all options from SoapClient::HTTPOptions, which are passed to the HTTPClient constructor
hash SoapClient::SoapClient::getMsg ( string  operation,
any  h,
any  header,
reference  op 
)

returns a hash representing the serialized SOAP request for a given WSOperation

the returned hash can be passed to makeXMLString() to make the actual SOAP message

Parameters
operationthe SOAP operation to use to serialize the request; if the operation is not known to the underlying WebService class, an exception will be thrown
hthe operation parameter(s)
headerdata structure for the SOAP header, if required by the message
opa reference to return the WSOperation object found
Exceptions
SOAP-CLIENT-ERRORthe operation is not defined in the WSDL
any SoapClient::SoapClient::methodGate ( string  op,
any  arg 
)

uses SoapClient::call() to transparently serialize the argument and make a call to the given operation and return the deserialized results

Parameters
opthe operation name, which is the method name passed to methodGate()
arga list or arguments or a single argument (or NOTHING) for the operation
Returns
the deserialized result of the SOAP call to the SOAP server