Class nusoap_server

Description

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

Located in /nusoap.php (line 3424)

nusoap_base
   |
   --nusoap_server
Direct descendents
Class Description
 class soap_server Backward compatibility
 class nusoap_server_mime nusoap_server_mime 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
 nusoap_server nusoap_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 3571)

whether to append debug to response as XML comment

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

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

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

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

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

URL for WSDL (if one)

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

SOAP fault for response (or false)

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

HTTP headers of request

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

name of method requested

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

method parameters from request

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

method return value to place in response

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

whether $methodreturn is a string of literal XML

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

requested method namespace URI

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

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 3503)

HTTP headers of response

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

HTTP request

  • access: private
mixed $requestHeader = NULL (line 3448)

SOAP Headers from request (parsed)

  • access: public
string $requestHeaders = '' (line 3442)

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

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

SOAP payload for request (text)

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

HTTP response

  • access: private
mixed $responseHeaders = '' (line 3515)

SOAP headers for response (text or array of soapval or associative array)

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

SOAP payload for response (text)

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

text indication of result (for debugging)

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

SOAP Action from request

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

wsdl instance (if one)

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

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 nusoap_server (line 3581)

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

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

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 4402)

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 4383)

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 4258)

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 4270)

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 4283)

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 3879)

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 4207)

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 3706)

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 3832)

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 4314)

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 4109)

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 4017)

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 3644)

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 4188)

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()
 nusoap_base::__toString()

Documentation generated on Tue, 06 Nov 2007 10:36:47 -0500 by phpDocumentor 1.3.0RC3