## nusoap_server

Description

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

- access: public
- version: $Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $
- author: Dietrich Ayala <dietrich@ganx4.com>
- author: Scott Nichol <snichol@users.sourceforge.net>

Located in /nusoap.php (line 3473)

    nusoap_base
       |
       --nusoap_server

Direct descendents

Class | Description
--- | ---
soap_server | Backward compatibility
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
boolean $debug_flag
boolean $decode_utf8
string $document
mixed $externalWSDLURL
mixed $fault
array $headers
string $methodname
array $methodparams
mixed $methodreturn
boolean $methodreturnisliteralxml
string $methodURI
array $operations
array $outgoing_headers
string $request
mixed $requestHeader
string $requestHeaders
string $requestSOAP
string $response
mixed $responseHeaders
string $responseSOAP
string $result
string $SOAPAction
mixed $wsdl
string $xml_encoding
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 ()
string getHTTPContentTypeCharset ()
void invoke_method ()
mixed parseRequest (array $headers, string $data)
void parse_http_headers ()
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 serialize_return ()
void service (string $data)
boolean verify_method (string $operation, array $request)
Variables
boolean $debug_flag = false (line 3620)

whether to append debug to response as XML comment

- access: public

boolean $decode_utf8 = true (line 3545)

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

- access: public

string $document = '' (line 3503)

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

- access: public

mixed $externalWSDLURL = false (line 3614)

URL for WSDL (if one)

- access: private

mixed $fault = false (line 3588)

SOAP fault for response (or false)

- access: private

array $headers = array() (line 3479)

HTTP headers of request

- access: private

string $methodname = '' (line 3521)

name of method requested

- access: private

array $methodparams = array() (line 3527)

method parameters from request

- access: private

mixed $methodreturn = false (line 3576)

method return value to place in response

- access: private

boolean $methodreturnisliteralxml = false (line 3582)

whether $methodreturn is a string of literal XML

- access: public

string $methodURI = '' (line 3515)

requested method namespace URI

- access: private

array $operations = array() (line 3602)

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

HTTP headers of response

- access: public

string $request = '' (line 3485)

HTTP request

- access: private

mixed $requestHeader = NULL (line 3497)

SOAP Headers from request (parsed)

- access: public

string $requestHeaders = '' (line 3491)

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

- access: public

string $requestSOAP = '' (line 3509)

SOAP payload for request (text)

- access: public

string $response = '' (line 3558)

HTTP response

- access: private

mixed $responseHeaders = '' (line 3564)

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

- access: public

string $responseSOAP = '' (line 3570)

SOAP payload for response (text)

- access: private

string $result = 'successful' (line 3594)

text indication of result (for debugging)

- access: private

string $SOAPAction = '' (line 3533)

SOAP Action from request

- access: private

mixed $wsdl = false (line 3608)

wsdl instance (if one)

- access: private

string $xml_encoding = '' (line 3539)

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

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

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

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

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

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:

- nusoap_server_mime::getHTTPBody() : gets the HTTP body for the current response.

getHTTPContentType (line 4373)

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:

- nusoap_server_mime::getHTTPContentType() : gets the HTTP content type for the current response.

getHTTPContentTypeCharset (line 4386)

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:

- nusoap_server_mime::getHTTPContentTypeCharset() : gets the HTTP content type charset for the current response.

invoke_method (line 3950)

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

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:

- nusoap_server_mime::parseRequest() : processes SOAP message received from client

parse_http_headers (line 3777)

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

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

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

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

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

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

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 Mon, 26 Apr 2010 16:17:04 -0400 by phpDocumentor 1.3.0RC3