Qore xml Module  1.6.0
WSDL::WSOperation Class Reference

web service operation class More...

Inheritance diagram for WSDL::WSOperation:
WSDL::XsdNamedData WSDL::XsdData WSDL::XsdBase

Public Member Methods

 constructor (hash< auto > p, Namespaces nsc, *hash< auto > messages)
 creates the WSOperation object from the arguments supplied More...
 
*hash< string, WSMessagegetFaultMessages ()
 returns a hash of fault messages keyed by fault name
 
bool hasFault (string fault)
 returns True if the given string is a valid fault message for the operation
 
 setDocStyleBinding (reference idocmap)
 this method is called if this operation supports at least one binding with document style
 
 markRpcStyleBinding ()
 this method is called if this operation supports at least one binding with RPC style
 
list< auto > getTopLevelRequestNames ()
 returns all top-level request names for this operation
 
OperationalBinding getBinding (*string bname)
 returns a hash representing the given binding More...
 
 addBinding (WSDL::OperationalBinding b)
 adds the given binding More...
 
hash< auto > serializeFault (*string fault, string faultmsg, auto h, *hash< auto > header, *string enc, *hash< auto > nsh, *int xml_opts, *string req_soapaction, *string bname)
 serializes a fault response to an XML string or HTTP payload for the operation. More...
 
hash< auto > serializeRequest (auto h, *hash< auto > header, *string enc, *hash< auto > nsh, *int xml_opts, *string req_soapaction, *string bname, *hash< auto > http_headers)
 serializes a request to an XML string or HTTP payload for the operation. More...
 
hash< auto > serializeResponse (auto h, *hash< auto > header, *string enc, *hash< auto > nsh, *bool soap12, *int xml_opts, *string bname, *hash< auto > http_headers)
 serializes a SOAP response to an XML string for the operation More...
 
auto deserializeRequest (hash< auto > o, *string bname)
 parses a hash representing a parsed XML request (parsed with parse_xml(XPF_PRESERVE_ORDER)) for the operation and returns the corresponding Qore data structure More...
 
auto deserializeResponse (hash< auto > o, *string bname)
 parses a hash representing a parsed XML response (parsed with parse_xml(XPF_PRESERVE_ORDER)) for the operation and returns the corresponding Qore data structure More...
 
*hash< auto > deserializeRequestPath (string path, *string bname)
 
bool isSoap12 ()
 returns True if the operation is a SOAP 1.2 operation More...
 
string getTargetNS ()
 returns the target namespace for the operation More...
 

Public Attributes

*WSMessage input
 request message
 
*WSMessage output
 response message
 
*string input_name
 request message name
 
*string output_name
 response message name
 
Namespaces nsc
 namespace container
 
*string soapAction
 the SOAPAction header value to send with this operation
 
hash< string, bool > reqh
 a hash of top-level request names for this operation (depends on bindings)
 
hash< string, OperationalBindingbindings
 params per associated binding; key = binding name; value = OperationalBinding object
 
- Public Attributes inherited from WSDL::XsdNamedData
*string ns
 input namespace prefix (if any given)
 
 descriptive_name
 descriptive name flag
 

Static Private Member Methods

static hash< auto > processNSValue (hash< auto > h)
 processes a hash of raw deserialized XML data and removes any namespace prefix from keys (saved to a "ns" key in the hash vale assigned to the key) and returns the processed version of the hash
 

Private Attributes

hash< string, WSMessagefaults
 fault messages keyed by fault name
 

Detailed Description

web service operation class

Member Function Documentation

◆ addBinding()

WSDL::WSOperation::addBinding ( WSDL::OperationalBinding  b)

adds the given binding

Parameters
bnamebinding name, must be unique in operation
opparamsa hash with the following keys:
  • "httpMethod"
  • "soapTransport"
Exceptions
WSDL-BINDING-ERRORwhen binding already registered

◆ constructor()

WSDL::WSOperation::constructor ( hash< auto >  p,
Namespaces  nsc,
*hash< auto >  messages 
)

creates the WSOperation object from the arguments supplied

Parameters
pthe raw hash from deserialized XML data for the operation
nscthe namespace container
messagesa hash of messages defined in the WSDL; keys are message names; values are WSMessage objects

◆ deserializeRequest()

auto WSDL::WSOperation::deserializeRequest ( hash< auto >  o,
*string  bname 
)

parses a hash representing a parsed XML request (parsed with parse_xml(XPF_PRESERVE_ORDER)) for the operation and returns the corresponding Qore data structure

Parameters
othe parsed SOAP or HTTP request with WSDLLib::parseSOAPMessage() for the operation
bnameSOAP binding name, leave empty to use the first assigned binding
Returns
the Qore data structure corresponding to the request data. When SOAP header is deserialized according binding/input WSDL then all data are passed under subhash vales prefixed by message name In case of HTTP binding the content type is matched against WSDL binding when wildcards are supported and current content type value is applied to "^attributes^"."^content-type^".

◆ deserializeRequestPath()

*hash<auto> WSDL::WSOperation::deserializeRequestPath ( string  path,
*string  bname 
)

Operation is resolved from method and path so let's look if data are passed in URL. When URL replacement is defined for operation then exception is raised.

Returns
NOTHING if data are not encoded in URL for operation

◆ deserializeResponse()

auto WSDL::WSOperation::deserializeResponse ( hash< auto >  o,
*string  bname 
)

parses a hash representing a parsed XML response (parsed with parse_xml(XPF_PRESERVE_ORDER)) for the operation and returns the corresponding Qore data structure

Parameters
othe parsed SOAP or HTTP request with WSDLLib::parseSOAPMessage() for the operation
bnameSOAP binding name, leave empty to use the first assigned binding
Returns
the Qore data structure corresponding to the response data. When SOAP header is deserialized according binding/output WSDL then all data are passed under subhash vales prefixed by message name In case of HTTP binding the content type is matched against WSDL binding when wildcards are supported and current content type value is applied to "^attributes^"."^content-type^".

◆ getBinding()

OperationalBinding WSDL::WSOperation::getBinding ( *string  bname)

returns a hash representing the given binding

Parameters
bnamethe name of the binding, if not provided then uses the first assigned binding
Returns
a binding param hash describing the binding with the following keys:
  • "httpMethod"
  • "soapTransport"
Exceptions
WSDL-BINDING-ERRORunknown binding

◆ getTargetNS()

string WSDL::WSOperation::getTargetNS ( )

returns the target namespace for the operation

Returns
the target namespace for the operation

◆ isSoap12()

bool WSDL::WSOperation::isSoap12 ( )

returns True if the operation is a SOAP 1.2 operation

Returns
True if the operation is a SOAP 1.2 operation

◆ serializeFault()

hash<auto> WSDL::WSOperation::serializeFault ( *string  fault,
string  faultmsg,
auto  h,
*hash< auto >  header,
*string  enc,
*hash< auto >  nsh,
*int  xml_opts,
*string  req_soapaction,
*string  bname 
)
inline

serializes a fault response to an XML string or HTTP payload for the operation.

Parameters
faultan optional fault message for the operation (
See also
getFaultMessages())
Parameters
hthe fault data to serialize
headeroptional soap header info to serialize if required (ex: authorization info). In the first step headers are matched to binding/input/header WSDL definition, remaining headers are passed as-is
encthe optional encoding to use; if this argument is not present, then the default encoding will be used
nshan optional namespace hash for the output message
xml_optsoptional XML generation options
req_soapactionif present will override any SOAPAction value for the request, ignored for HTTP binding
bnameSOAP binding name or empty to get the first assigned binding
Returns
a hash with keys:
  • body: XML string in the SOAP response format or body part of HTTP message (string or binary). Target content type is evaluated from WSDL or in case of ambiguity using "^attributes^"."^content-type^". The provided content type must match allowed types in the WSDL. Also "application/x-www-form-urlencoded" or any general type are supported.
  • hdr: hash of HTTP headers
  • path: the path part of URL. Used when urlEncoded is defined
  • method: the HTTP request method

◆ serializeRequest()

hash<auto> WSDL::WSOperation::serializeRequest ( auto  h,
*hash< auto >  header,
*string  enc,
*hash< auto >  nsh,
*int  xml_opts,
*string  req_soapaction,
*string  bname,
*hash< auto >  http_headers 
)

serializes a request to an XML string or HTTP payload for the operation.

Parameters
hthe request to serialize
headeroptional soap header info to serialize if required (ex: authorization info). In the first step headers are matched to binding/input/header WSDL definition, remaining headers are passed as-is
encthe optional encoding to use; if this argument is not present, then the default encoding will be used
nshan optional namespace hash for the output message
xml_optsoptional XML generation options
req_soapactionif present will override any SOAPAction value for the request, ignored for HTTP binding
bnameSOAP binding name or empty to get the first assigned binding
Returns
a hash with keys:
  • body: XML string in the SOAP request format or body part of HTTP message (string or binary). Target content type is evaluated from WSDL or in case of ambiguity using "^attributes^"."^content-type^". The provided content type must match allowed types in WSDL; also "application/x-www-form-urlencoded" or any general type are supported.
  • hdr: hash of HTTP headers
  • path: the path part of URL. Used when urlEncoded is defined
  • method: the HTTP request method
Exceptions
SOAP-SERIALIZATION-ERRORno input message description

◆ serializeResponse()

hash<auto> WSDL::WSOperation::serializeResponse ( auto  h,
*hash< auto >  header,
*string  enc,
*hash< auto >  nsh,
*bool  soap12,
*int  xml_opts,
*string  bname,
*hash< auto >  http_headers 
)

serializes a SOAP response to an XML string for the operation

Parameters
hthe response to serialize
headerSOAP header hash. In the first step headers are matched to binding/input/header WSDL definition, remaining headers are passed as-is
encthe optional encoding to use; if this argument is not present, then the default encoding will be used
nshnamespace hash
soap12set to True if the response should use SOAP 1.2 encoding
xml_optsoptional XML generation options
bnameSOAP binding name, leave empty to get the first assigned binding
http_headersHTTP headers to serialize in the response
Returns
a hash with keys:
  • body: XML string in the SOAP request format or body part of HTTP message (string or binary). Target content type is evaluated from WSDL or in case of ambiguity using "^attributes^"."^content-type^". The provided content type must match allowed types in WSDL; also "application/x-www-form-urlencoded" or any general type are supported.
  • hdr: hash of HTTP headers
Exceptions
SOAP-SERIALIZATION-ERRORno output message description

The documentation for this class was generated from the following file: