Class soap_server

Description

soap_server allows the user to create a SOAP server that is capable of receiving messages and returning responses

NOTE: WSDL functionality is experimental

  • access: public
  • version: $Id: nusoap.php,v 1.94 2005/08/04 01:27:42 snichol Exp $
  • author: Dietrich Ayala <dietrich@ganx4.com>

Located in /nusoap.php (line 3043)

nusoap_base
   |
   --soap_server
Direct descendents
Class Description
 class nusoapservermime nusoapservermime server supporting MIME attachments defined at http://www.w3.org/TR/SOAP-attachments. It depends on the PEAR Mail_MIME library.
Variable Summary
Method Summary
 soap_server soap_server ([mixed $wsdl = false])
 void add_to_map (string $methodname, string $in, string $out)
 void configureWSDL (mixed $serviceName, [mixed $namespace = false], [mixed $endpoint = false], [string $style = 'rpc'], [string $transport = 'http://schemas.xmlsoap.org/soap/http'], [mixed $schemaTargetNamespace = false], string $serviceName,)
 void fault (string $faultcode, string $faultstring, [string $faultactor = ''], [string $faultdetail = ''])
 string getHTTPBody (string $soapmsg)
 string getHTTPContentType ()
 void invoke_method ()
 mixed parseRequest (array $headers, string $data)
 void parse_request ([string $data = ''])
 void register (string $name, [array $in = array()], [array $out = array()], [mixed $namespace = false], [mixed $soapaction = false], [mixed $style = false], [mixed $use = false], [string $documentation = ''], [string $encodingStyle = ''])
 void send_response ()
 void service (string $data)
 boolean verify_method (string $operation, array $request)
Variables
boolean $debug_flag = false (line 3184)

whether to append debug to response as XML comment

  • access: public
boolean $decode_utf8 = true (line 3109)

toggles whether the parser decodes element content w/ utf8_decode()

  • access: public
string $document = '' (line 3067)

SOAP body request portion (incomplete namespace resolution; special characters not escaped) (text)

  • access: public
mixed $externalWSDLURL = false (line 3178)

URL for WSDL (if one)

  • access: private
mixed $fault = false (line 3152)

SOAP fault for response (or false)

  • access: private
array $headers = array() (line 3049)

HTTP headers of request

  • access: private
string $methodname = '' (line 3085)

name of method requested

  • access: private
array $methodparams = array() (line 3091)

method parameters from request

  • access: private
mixed $methodreturn = false (line 3140)

method return value to place in response

  • access: private
boolean $methodreturnisliteralxml = false (line 3146)

whether $methodreturn is a string of literal XML

  • access: public
string $methodURI = '' (line 3079)

requested method namespace URI

  • access: private
array $operations = array() (line 3166)

assoc array of operations => opData; operations are added by the register()

method or by parsing an external WSDL definition

  • access: private
array $outgoing_headers = array() (line 3116)

HTTP headers of response

  • access: public
string $request = '' (line 3055)

HTTP request

  • access: private
string $requestHeaders = '' (line 3061)

SOAP headers from request (incomplete namespace resolution; special characters not escaped) (text)

  • access: public
string $requestSOAP = '' (line 3073)

SOAP payload for request (text)

  • access: public
string $response = '' (line 3122)

HTTP response

  • access: private
string $responseHeaders = '' (line 3128)

SOAP headers for response (text)

  • access: public
string $responseSOAP = '' (line 3134)

SOAP payload for response (text)

  • access: private
string $result = 'successful' (line 3158)

text indication of result (for debugging)

  • access: private
string $SOAPAction = '' (line 3097)

SOAP Action from request

  • access: private
mixed $wsdl = false (line 3172)

wsdl instance (if one)

  • access: private
string $xml_encoding = '' (line 3103)

character set encoding of incoming (request) messages

  • access: public

Inherited Variables

Inherited from nusoap_base

nusoap_base::$charencoding
nusoap_base::$debugLevel
nusoap_base::$debug_str
nusoap_base::$error_str
nusoap_base::$namespaces
nusoap_base::$revision
nusoap_base::$soap_defencoding
nusoap_base::$title
nusoap_base::$typemap
nusoap_base::$usedNamespaces
nusoap_base::$version
nusoap_base::$xmlEntities
nusoap_base::$XMLSchemaVersion
Methods
Constructor soap_server (line 3194)

constructor the optional parameter is a path to a WSDL file that you'd like to bind the server instance to.

  • access: public
soap_server soap_server ([mixed $wsdl = false])
  • mixed $wsdl: file path or URL (string), or wsdl instance (object)
add_to_map (line 3898)

add a method to the dispatch map (this has been replaced by the register method)

  • deprecated:
  • access: public
void add_to_map (string $methodname, string $in, string $out)
  • string $methodname
  • string $in: array of input values
  • string $out: array of output values
configureWSDL (line 3997)

Sets up wsdl object.

Acts as a flag to enable internal WSDL generation

void configureWSDL (mixed $serviceName, [mixed $namespace = false], [mixed $endpoint = false], [string $style = 'rpc'], [string $transport = 'http://schemas.xmlsoap.org/soap/http'], [mixed $schemaTargetNamespace = false], string $serviceName,)
  • string $serviceName,: name of the service
  • mixed $namespace: optional 'tns' service namespace or false
  • mixed $endpoint: optional URL of service endpoint or false
  • string $style: optional (rpc|document) WSDL style (also specified by operation)
  • string $transport: optional SOAP transport
  • mixed $schemaTargetNamespace: optional 'types' targetNamespace for service schema or false
fault (line 3978)

Specify a fault to be returned to the client.

This also acts as a flag to the server that a fault has occured.

  • access: public
void fault (string $faultcode, string $faultstring, [string $faultactor = ''], [string $faultdetail = ''])
  • string $faultcode
  • string $faultstring
  • string $faultactor
  • string $faultdetail
getHTTPBody (line 3860)

gets the HTTP body for the current response.

  • return: The HTTP body, which includes the SOAP payload
  • access: private
string getHTTPBody (string $soapmsg)
  • string $soapmsg: The SOAP payload

Redefined in descendants as:
getHTTPContentType (line 3872)

gets the HTTP content type for the current response.

Note: getHTTPBody must be called before this.

  • return: the HTTP content type for the current response.
  • access: private
string getHTTPContentType ()

Redefined in descendants as:
getHTTPContentTypeCharset (line 3885)

gets the HTTP content type charset for the current response.

returns false for non-text content types.

Note: getHTTPBody must be called before this.

  • return: the HTTP content type charset for the current response.
  • access: private
string getHTTPContentTypeCharset ()

Redefined in descendants as:
invoke_method (line 3492)

invokes a PHP function for the requested SOAP method

The following fields are set by this function (when successful)

methodreturn

Note that the PHP function that is called may also set the following fields to affect the response sent to the client

responseHeaders outgoing_headers

This sets the fault field on error

  • access: private
void invoke_method ()
parseRequest (line 3811)

processes SOAP message received from client

  • return: value of the message, decoded into a PHP type
  • access: private
mixed parseRequest (array $headers, string $data)
  • array $headers: The HTTP headers
  • string $data: unprocessed request data from client

Redefined in descendants as:
parse_http_headers (line 3319)

parses HTTP request headers.

The following fields are set by this function (when successful)

headers request xml_encoding SOAPAction

  • access: private
void parse_http_headers ()
parse_request (line 3445)

parses a request

The following fields are set by this function (when successful)

headers request xml_encoding SOAPAction request requestSOAP methodURI methodname methodparams requestHeaders document

This sets the fault field on error

  • access: private
void parse_request ([string $data = ''])
  • string $data: XML string
register (line 3916)

register a service function with the server

  • access: public
void register (string $name, [array $in = array()], [array $out = array()], [mixed $namespace = false], [mixed $soapaction = false], [mixed $style = false], [mixed $use = false], [string $documentation = ''], [string $encodingStyle = ''])
  • string $name: the name of the PHP function, class.method or class..method
  • array $in: assoc array of input values: key = param name, value = param type
  • array $out: assoc array of output values: key = param name, value = param type
  • mixed $namespace: the element namespace for the method or false
  • mixed $soapaction: the soapaction for the method or false
  • mixed $style: optional (rpc|document) or false Note: when 'document' is specified, parameter and return wrappers are created for you automatically
  • mixed $use: optional (encoded|literal) or false
  • string $documentation: optional Description to include in WSDL
  • string $encodingStyle: optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
send_response (line 3713)

sends an HTTP response

The following fields are set by this function (when successful)

outgoing_headers response

  • access: private
void send_response ()
serialize_return (line 3626)

serializes the return value from a PHP function into a full SOAP Envelope

The following fields are set by this function (when successful)

responseSOAP

This sets the fault field on error

  • access: private
void serialize_return ()
service (line 3257)

processes request and returns response

  • access: public
void service (string $data)
  • string $data: usually is the value of $HTTP_RAW_POST_DATA
verify_method (line 3792)

takes the value that was created by parsing the request and compares to the method's signature, if available.

  • return: Whether the operation was found
  • access: private
boolean verify_method (string $operation, array $request)
  • string $operation: The operation to be invoked
  • array $request: The array of parameter values

Inherited Methods

Inherited From nusoap_base

 nusoap_base::nusoap_base()
 nusoap_base::appendDebug()
 nusoap_base::clearDebug()
 nusoap_base::contractQname()
 nusoap_base::debug()
 nusoap_base::expandEntities()
 nusoap_base::expandQname()
 nusoap_base::formatDump()
 nusoap_base::getDebug()
 nusoap_base::getDebugAsXMLComment()
 nusoap_base::getDebugLevel()
 nusoap_base::getError()
 nusoap_base::getGlobalDebugLevel()
 nusoap_base::getLocalPart()
 nusoap_base::getmicrotime()
 nusoap_base::getNamespaceFromPrefix()
 nusoap_base::getPrefix()
 nusoap_base::getPrefixFromNamespace()
 nusoap_base::isArraySimpleOrStruct()
 nusoap_base::serializeEnvelope()
 nusoap_base::serialize_val()
 nusoap_base::setDebugLevel()
 nusoap_base::setError()
 nusoap_base::setGlobalDebugLevel()
 nusoap_base::varDump()

Documentation generated on Wed, 3 Aug 2005 21:29:38 -0400 by phpDocumentor 1.3.0RC3