Qore WSDL Module Reference  0.4
WSDL::WebService Class Reference

main class representing a parsed WSDL file More...

Inheritance diagram for WSDL::WebService:

Public Member Methods

transient list< string > wsdl_services ()
 list of services in this WSDL
 
transient hash< string, XsdElementidocmap ()
 a hash of element names to XsdElement objects for top-level document-style bindings
 
transient hash< string, hash< string, XsdElement > > emap ()
 map of elements
 
transient hash< string, WSMessagemessages ()
 hash of messages names to messages
 
transient hash< string, XsdAbstractType > tmap ()
 map of types
 
transient hash< string, hash< PortTypeInfo > > portType ()
 hash of port names to port type information hashes
 
 constructor (string str, *hash< auto > opts)
 creates the WebService object More...
 
WSDL::WSOperation getOperation (string opname)
 returns the given operation or throws an exception if it cannot be found; operations are searched in portTypes in the order they are declared
 
softlist< auto > getOperationNames ()
 returns a list of known operation names
 
WSDL::WSOperation getPortTypeOperation (string ptname, string opname)
 returns the given operation for particular porttype or throws an exception if it cannot be found
 
WSDL::WSOperation getBindingOperation (*string bname, string opname)
 returns the given operation for particular binding or throws an exception if it cannot be found
 
list< hash< OperationInfo > > listOperations ()
 returns a list of hashes giving supported operation names for each port in the WSDL More...
 
WSDL::Binding getBinding (string name)
 return a WSDL::Binding object describing the requested binding More...
 
list< hash< WSDL::ServiceInfo > > listServices ()
 returns a list of services defined in the WSDL More...
 
hash< WSDL::ServiceInfogetService (string name)
 returns a hash describing the requested service More...
 
hash< auto > getType (string name, auto v)
 return a hash value that can be used to serialize a value as a particular type
 
bool isSoap12 ()
 returns True if the WSDL describes a SOAP 1.2 service More...
 
string getWSDL ()
 returns the XML string for the WSDL More...
 
string getWSDL (string base_url)
 returns the XML string for the WSDL, adjusting the URLs for binding locations depending on the caller More...
 
 getReport (StringOutputStream stream, *string wsdl_name)
 prepare a WebService report enumerating the services and operations of the WSDL, outputs to the output stream given as the first argument More...
 
string getReport (*string wsdl_name)
 prepare a WebService report enumerating the services and operations of the WSDL More...
 

Public Attributes

string wsdl
 the WSDL string
 
*hash< auto > opts
 options used in the constructor
 
bool has_try_import = False
 flag if the object has a "try_import" closure or call reference
 
transient Namespaces nsc
 namespace container
 
transient *code try_import
 optional closure/call reference to try to resolve import declarations
 
transient *string def_path
 default path for retrieving XSD references More...
 

Private:Internal Member Methods

 doInit (string str, *hash< auto > opts)
 supports the constructor and deserialization More...
 
 deserializeMembers (hash< auto > members)
 can be used to create a WebService object from a hash created with serialize() More...
 

Detailed Description

main class representing a parsed WSDL file

This is the main class for handling SOAP communication and is based on a WSDL file

Member Function Documentation

◆ constructor()

WSDL::WebService::constructor ( string  str,
*hash< auto >  opts 
)

creates the WebService object

Parameters
strthe XML string representing the WSDL
optsan optional hash of options with the following possible keys:
  • "compat_allow_any_header": allow any SOAP header to be sent without checking the WSDL
  • "compat_empty_string_is_nothing": deserialize empty strings to nothing instead of an empty string
  • "def_path": the default path to use when retrieving referenced XSDs
  • "try_import": a call reference or closure to be passed a string name for XSD imports without any scheme to retrieve the data, must take a string argument (the resource name) and return a string (the resource data)
  • "http_client": a HTTPClient object for retrieving data from import commands
  • "http_headers": a hash of optional HTTP header info to use when retrieving data from import commands
Since
0.3.7 added the "compat_empty_string_is_nothing" and "compat_allow_any_header" options for backwards compatibility

◆ deserializeMembers()

WSDL::WebService::deserializeMembers ( hash< auto >  members)
private:internal

can be used to create a WebService object from a hash created with serialize()

Returns
a WebService object from the argument hash created with serialize()

◆ doInit()

WSDL::WebService::doInit ( string  str,
*hash< auto >  opts 
)
private:internal

supports the constructor and deserialization

Since
WSDL 0.4

◆ getBinding()

WSDL::Binding WSDL::WebService::getBinding ( string  name)

return a WSDL::Binding object describing the requested binding

Parameters
namethe name of the binding
Returns
a WSDL::Binding object
Exceptions
WSDL-BINDING-ERRORunknown binding

◆ getReport() [1/2]

WSDL::WebService::getReport ( StringOutputStream  stream,
*string  wsdl_name 
)

prepare a WebService report enumerating the services and operations of the WSDL, outputs to the output stream given as the first argument

Parameters
streamthe output stream for the report data
wsdl_namename of the WSDL, typically a file name
Returns
human readable text report

◆ getReport() [2/2]

string WSDL::WebService::getReport ( *string  wsdl_name)

prepare a WebService report enumerating the services and operations of the WSDL

Parameters
wsdl_namename of the WSDL, typically a file name
Returns
human readable text report

◆ getService()

hash<WSDL::ServiceInfo> WSDL::WebService::getService ( string  name)

returns a hash describing the requested service

Parameters
namethe name of the service
Returns
a hash describing the service with the following keys:
  • "name": the name of the service
  • "port": a hash of port information; where each hash<auto> is keyed by port name and the values have the following keys:
    • "address": the location of the port
    • "binding": the binding of the port
Exceptions
WSDL-SERVICE-ERRORthe service is not known

◆ getWSDL() [1/2]

string WSDL::WebService::getWSDL ( )

returns the XML string for the WSDL

Returns
the XML string for the WSDL

◆ getWSDL() [2/2]

string WSDL::WebService::getWSDL ( string  base_url)

returns the XML string for the WSDL, adjusting the URLs for binding locations depending on the caller

Parameters
base_urlthe url to be prepended before the service name; it must include all the handler prefixes (like /SOAP) to produce valid URL
Returns
the XML string for the WSDL

◆ isSoap12()

bool WSDL::WebService::isSoap12 ( )

returns True if the WSDL describes a SOAP 1.2 service

Returns
True if the WSDL describes a SOAP 1.2 service

◆ listOperations()

list<hash<OperationInfo> > WSDL::WebService::listOperations ( )

returns a list of hashes giving supported operation names for each port in the WSDL

Returns
a list of hashes giving supported operation names for each port in the WSDL; each hash<auto> has the following keys:
  • "port": the name of the port defining the operation
  • "operation": the WSDL::WSOperation object for the operation

◆ listServices()

list<hash<WSDL::ServiceInfo> > WSDL::WebService::listServices ( )

returns a list of services defined in the WSDL

Returns
a list of hashes of services defined in the WSDL; each hash<auto> has the following keys:
  • "name": the name of the service
  • "port": a hash of port information; the keys are port names and the values have the following keys:
    • "address": the location of the port
    • "binding": the binding of the port

Member Data Documentation

◆ def_path

transient *string WSDL::WebService::def_path

default path for retrieving XSD references

Note
there is no need to serialize def_path as it will be set with the saved options