Class Zend_Soap_Server

Description

Zend_Soap_Server

  • version: $Id: Server.php 4660 2007-05-02 14:10:37Z matthew $
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  • uses: Zend_Server_Interface
  • license: New BSD License

Located in /Soap/Server.php (line 37)


	
			
Variable Summary
 string $_actor
 string $_class
 array $_classArgs
 array $_classmap
 string $_encoding
 array|int $_functions
 string $_request
 string $_response
 string $_uri
Method Summary
 void __construct ([string $wsdl = null], [ $options = null])
 Zend_Soap_Server addFunction (array|string $function, [string $namespace = ''])
 boolean deregisterFaultException (string $class)
 SoapFault fault ([string|Exception $fault = null], [int $code = 404])
 string getActor ()
 mixed getClassmap ()
 string getEncoding ()
 array getFunctions ()
 string getLastRequest ()
 string getLastResponse ()
 array getOptions ()
 boolean getReturnResponse ()
 string getUri ()
 string getWsdl ()
 void|string handle ([DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request = null])
 void handlePhpErrors (int $errno, string $errstr, [string $errfile = null], [int $errline = null], [ $errcontext = null])
 void loadFunctions ( $definition, array $array)
 Zend_Soap_Server registerFaultException (string|array $class)
 Zend_Soap_Server setActor (string $actor)
 Zend_Soap_Server setClass (mixed $class, [mixed $arg1 = null], [mixed $arg2 = null])
 Zend_Soap_Server setEncoding (string $encoding)
 Zend_Soap_Server setRequest (DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request)
 Zend_Soap_Server setUri (string $uri)
 Zend_Soap_Server setWsdl (string $wsdl)
 true validateUrn (string $urn)
 SoapServer _getSoap ()
Variables
string $_actor (line 43)

Actor URI

  • var: URI
  • access: protected
string $_class (line 49)

Class registered with this server

  • access: protected
array $_classArgs = array() (line 55)

Arguments to pass to $_class constructor

  • access: protected
array $_classmap (line 61)

Array of SOAP type => PHP class pairings for handling return/incoming values

  • access: protected
string $_encoding (line 67)

Encoding

  • access: protected
array $_faultExceptions = array() (line 73)

Registered fault exceptions

  • access: protected
array|int $_functions = array() (line 80)

Functions registered with this server; may be either an array or the SOAP_FUNCTIONS_ALL

constant

  • access: protected
int $_persistence (line 86)

Persistence mode; should be one of the SOAP persistence constants

  • access: protected
string $_request (line 92)

Request XML

  • access: protected
string $_response (line 98)

Response XML

  • access: protected
boolean $_returnResponse = false (line 105)

Flag: whether or not handle() should return a response instead of automatically emitting it.

  • access: protected
int $_soapVersion = SOAP_1_2 (line 111)

SOAP version to use; SOAP_1_2 by default, to allow processing of headers

  • access: protected
string $_uri (line 117)

URI namespace for SOAP server

  • var: URI
  • access: protected
Methods
Constructor __construct (line 133)

Constructor

Sets display_errors INI setting to off (prevent client errors due to bad XML in response). Registers handlePhpErrors() as error handler for E_USER_ERROR.

If $wsdl is provided, it is passed on to setWsdl(); if any options are specified, they are passed on to setOptions().

  • access: public
void __construct ([string $wsdl = null], [ $options = null])
  • string $wsdl
  • array $options
addFunction (line 404)

Attach a function as a server method

  • throws: Zend_Soap_Server_Exception on invalid functions
  • access: public
Zend_Soap_Server addFunction (array|string $function, [string $namespace = ''])
  • array|string $function: Function name, array of function names to attach, or SOAP_FUNCTIONS_ALL to attach all functions
  • string $namespace: Ignored
deregisterFaultException (line 699)

Deregister a fault exception from the fault exception stack

  • access: public
boolean deregisterFaultException (string $class)
  • string $class
fault (line 733)

Generate a server fault

Note that the arguments are reverse to those of SoapFault.

If an exception is passed as the first argument, its message and code will be used to create the fault object if it has been registered via {@Link registerFaultException()}.

  • access: public
SoapFault fault ([string|Exception $fault = null], [int $code = 404])
  • string|Exception $fault
  • int $code: Defaults to 404
getActor (line 312)

Retrieve actor

  • access: public
string getActor ()
getClassmap (line 367)

Retrieve classmap

  • access: public
mixed getClassmap ()
getEncoding (line 243)

Get encoding

  • access: public
string getEncoding ()
getFaultExceptions (line 715)

Return fault exceptions list

  • access: public
array getFaultExceptions ()
getFunctions (line 480)

Return a server definition array

Returns a list of all functions registered with addFunction(), merged with all public methods of the class set with setClass() (if any).

  • access: public
array getFunctions ()
getLastRequest (line 560)

Retrieve request XML

  • access: public
string getLastRequest ()
getLastResponse (line 597)

Get response XML

  • access: public
string getLastResponse ()
getOptions (line 195)

Return array of options suitable for using with SoapServer constructor

  • access: public
array getOptions ()
getReturnResponse (line 587)

Retrieve return response flag

  • access: public
boolean getReturnResponse ()
getSoapVersion (line 270)

Get SOAP version

  • access: public
int getSoapVersion ()
getUri (line 338)

Retrieve URI

  • access: public
string getUri ()
getWsdl (line 390)

Retrieve wsdl

  • access: public
string getWsdl ()
handle (line 647)

Handle a request

Instantiates SoapServer object with options set in object, and dispatches its handle() method.

$request may be any request type handled by setRequest().

If no request is passed, pulls request using php:://input (for cross-platform compatability purposes).

  • access: public
void|string handle ([DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request = null])
  • DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request: Optional request
handlePhpErrors (line 762)

Throw PHP errors as SoapFaults

  • throws: SoapFault
  • access: public
void handlePhpErrors (int $errno, string $errstr, [string $errfile = null], [int $errline = null], [ $errcontext = null])
  • int $errno
  • string $errstr
  • string $errfile
  • int $errline
  • array $errcontext
loadFunctions (line 497)

Unimplemented: Load server definition

  • throws: Zend_Soap_Server_Exception Unimplemented
  • access: public
void loadFunctions ( $definition, array $array)
  • array $array
  • $definition
registerFaultException (line 687)

Register a valid fault exception

  • access: public
Zend_Soap_Server registerFaultException (string|array $class)
  • string|array $class: Exception class or array of exception classes
setActor (line 300)

Set actor

Actor is the actor URI for the server.

  • access: public
Zend_Soap_Server setActor (string $actor)
  • string $actor
setClass (line 446)

Attach a class to a server

Accepts a class name to use when handling requests. Any additional arguments will be passed to that class' constructor when instantiated.

  • throws: Zend_Soap_Server_Exception if called more than once, or if class does not exist
  • access: public
Zend_Soap_Server setClass (mixed $class, [mixed $arg1 = null], [mixed $arg2 = null])
  • mixed $class: Class name or object instance to examine and attach to the server.
  • mixed $arg1: Optional argument to pass to class constructor
  • mixed $arg2: Optional second argument to pass to class constructor dispatch.
setClassmap (line 350)

Set classmap

  • throws: Zend_Soap_Server_Exception for any invalid class in the class map
  • access: public
Zend_Soap_Server setClassmap ( $classmap)
  • array $classmap
setEncoding (line 228)

Set encoding

  • throws: Zend_Soap_Server_Exception with invalid encoding argument
  • access: public
Zend_Soap_Server setEncoding (string $encoding)
  • string $encoding
setOptions (line 155)

Set Options

Allows setting options as an associative array of option => value pairs.

  • access: public
Zend_Soap_Server setOptions ( $options)
  • array $options
setPersistence (line 508)

Set server persistence

  • access: public
Zend_Soap_Server setPersistence (int $mode)
  • int $mode
setRequest (line 531)

Set request

$request may be any of:

  • DOMDocument; if so, then cast to XML
  • DOMNode; if so, then grab owner document and cast to XML
  • SimpleXMLElement; if so, then cast to XML
  • stdClass; if so, calls __toString() and verifies XML
  • string; if so, verifies XML

  • access: public
Zend_Soap_Server setRequest (DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request)
  • DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request
setReturnResponse (line 576)

Set return response flag

If true, handle() will return the response instead of automatically sending it back to the requesting client.

The response is always available via getResponse().

  • access: public
Zend_Soap_Server setReturnResponse (boolean $flag)
  • boolean $flag
setSoapVersion (line 255)

Set SOAP version

  • throws: Zend_Soap_Server_Exception with invalid soap version argument
  • access: public
Zend_Soap_Server setSoapVersion (int $version)
  • int $version: One of the SOAP_1_1 or SOAP_1_2 constants
setUri (line 326)

Set URI

URI in SoapServer is actually the target namespace, not a URI; $uri must begin with 'urn:'.

  • throws: Zend_Soap_Server_Exception with invalid uri argument
  • access: public
Zend_Soap_Server setUri (string $uri)
  • string $uri
setWsdl (line 378)

Set wsdl

  • access: public
Zend_Soap_Server setWsdl (string $wsdl)
  • string $wsdl
validateUrn (line 282)

Check for valid URN

  • throws: Zend_Soap_Server_Exception on invalid URN
  • access: public
true validateUrn (string $urn)
  • string $urn
_getSoap (line 611)

Get SoapServer object

Uses $_wsdl and return value of getOptions() to instantiate SoapServer object, and then registers any functions or class with it, as well as peristence.

  • access: protected
SoapServer _getSoap ()

Documentation generated on Sun, 27 May 2007 23:29:39 -0700 by phpDocumentor 1.3.2