Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_Soap_Server Class Reference

Public Member Functions

 __construct ($wsdl=null, array $options=null)
 Constructor.
 
 setOptions ($options)
 Set Options.
 
 getOptions ()
 Return array of options suitable for using with SoapServer constructor.
 
 setWsiCompliant ($value)
 Set WS-I compliant.
 
 getWsiCompliant ()
 Gt WS-I compliant.
 
 setEncoding ($encoding)
 Set encoding.
 
 getEncoding ()
 Get encoding.
 
 setSoapVersion ($version)
 Set SOAP version.
 
 getSoapVersion ()
 Get SOAP version.
 
 validateUrn ($urn)
 Check for valid URN.
 
 setActor ($actor)
 Set actor.
 
 getActor ()
 Retrieve actor.
 
 setUri ($uri)
 Set URI.
 
 getUri ()
 Retrieve URI.
 
 setClassmap ($classmap)
 Set classmap.
 
 getClassmap ()
 Retrieve classmap.
 
 setWsdl ($wsdl)
 Set wsdl.
 
 getWsdl ()
 Retrieve wsdl.
 
 setSoapFeatures ($feature)
 Set the SOAP Feature options.
 
 getSoapFeatures ()
 Return current SOAP Features options.
 
 setWsdlCache ($options)
 Set the SOAP Wsdl Caching Options.
 
 getWsdlCache ()
 Get current SOAP Wsdl Caching option.
 
 addFunction ($function, $namespace= '')
 Attach a function as a server method.
 
 setClass ($class, $namespace= '', $argv=null)
 Attach a class to a server.
 
 setObject ($object)
 Attach an object to a server.
 
 getFunctions ()
 Return a server definition array.
 
 loadFunctions ($definition)
 Unimplemented: Load server definition.
 
 setPersistence ($mode)
 Set server persistence.
 
 getPersistence ()
 Get server persistence.
 
 getLastRequest ()
 Retrieve request XML.
 
 setReturnResponse ($flag)
 Set return response flag.
 
 getReturnResponse ()
 Retrieve return response flag.
 
 getLastResponse ()
 Get response XML.
 
 handle ($request=null)
 Handle a request.
 
 registerFaultException ($class)
 Register a valid fault exception.
 
 deregisterFaultException ($class)
 Deregister a fault exception from the fault exception stack.
 
 getFaultExceptions ()
 Return fault exceptions list.
 
 fault ($fault=null, $code="Receiver")
 Generate a server fault.
 
 handlePhpErrors ($errno, $errstr, $errfile=null, $errline=null, array $errcontext=null)
 Throw PHP errors as SoapFaults.
 

Protected Member Functions

 _setRequest ($request)
 Set request.
 
 _getSoap ()
 Get SoapServer object.
 
 _initializeSoapErrorContext ()
 Method initalizes the error context that the SOAPServer enviroment will run in.
 

Protected Attributes

 $_actor
 
 $_class
 
 $_classArgs = array()
 
 $_object
 Object registered with this server.
 
 $_classmap
 
 $_encoding
 
 $_features
 
 $_wsdlCache
 
 $_wsiCompliant
 
 $_faultExceptions = array()
 
 $_functions = array()
 
 $_persistence
 
 $_request
 
 $_response
 
 $_returnResponse = false
 
 $_soapVersion = SOAP_1_2
 
 $_wsdl
 
 $_uri
 

Constructor & Destructor Documentation

__construct (   $wsdl = null,
array  $options = null 
)

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().

Parameters
string$wsdl
array$options
Returns
void

Member Function Documentation

_getSoap ( )
protected

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.

Returns
SoapServer
_initializeSoapErrorContext ( )
protected

Method initalizes the error context that the SOAPServer enviroment will run in.

Returns
boolean display_errors original value
_setRequest (   $request)
protected

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
Parameters
DOMDocument | DOMNode | SimpleXMLElement | stdClass | string$request
Returns
Zend_Soap_Server
addFunction (   $function,
  $namespace = '' 
)

Attach a function as a server method.

Parameters
array | string$functionFunction name, array of function names to attach, or SOAP_FUNCTIONS_ALL to attach all functions
string$namespaceIgnored
Returns
Zend_Soap_Server
Exceptions
Zend_Soap_Server_Exceptionon invalid functions

Implements Zend_Server_Interface.

deregisterFaultException (   $class)

Deregister a fault exception from the fault exception stack.

Parameters
string$class
Returns
boolean
fault (   $fault = null,
  $code = "Receiver" 
)

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 { registerFaultException()}.

string|Exception $fault string $code SOAP Fault Codes SoapFault

Implements Zend_Server_Interface.

getActor ( )

Retrieve actor.

Returns
string
getClassmap ( )

Retrieve classmap.

Returns
mixed
getEncoding ( )

Get encoding.

Returns
string
getFaultExceptions ( )

Return fault exceptions list.

Returns
array
getFunctions ( )

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

public

Returns
array

Implements Zend_Server_Interface.

getLastRequest ( )

Retrieve request XML.

Returns
string
getLastResponse ( )

Get response XML.

Returns
string
getOptions ( )

Return array of options suitable for using with SoapServer constructor.

Returns
array
getPersistence ( )

Get server persistence.

Returns
Zend_Soap_Server
getReturnResponse ( )

Retrieve return response flag.

Returns
boolean
getSoapFeatures ( )

Return current SOAP Features options.

Returns
int
getSoapVersion ( )

Get SOAP version.

Returns
int
getUri ( )

Retrieve URI.

Returns
string
getWsdl ( )

Retrieve wsdl.

Returns
string
getWsdlCache ( )

Get current SOAP Wsdl Caching option.

getWsiCompliant ( )

Gt WS-I compliant.

Returns
boolean
handle (   $request = null)

Handle a request.

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

$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

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

Parameters
DOMDocument | DOMNode | SimpleXMLElement | stdClass | string$requestOptional request
Returns
void|string
See Also
Zend_Soap_Server_Exception

Implements Zend_Server_Interface.

handlePhpErrors (   $errno,
  $errstr,
  $errfile = null,
  $errline = null,
array  $errcontext = null 
)

Throw PHP errors as SoapFaults.

Parameters
int$errno
string$errstr
string$errfile
int$errline
array$errcontext
Returns
void
Exceptions
SoapFault
loadFunctions (   $definition)

Unimplemented: Load server definition.

Parameters
array$array
Returns
void
Exceptions
Zend_Soap_Server_ExceptionUnimplemented

Implements Zend_Server_Interface.

registerFaultException (   $class)

Register a valid fault exception.

Parameters
string | array$classException class or array of exception classes
Returns
Zend_Soap_Server
setActor (   $actor)

Set actor.

Actor is the actor URI for the server.

Parameters
string$actor
Returns
Zend_Soap_Server
setClass (   $class,
  $namespace = '',
  $argv = null 
)

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.

See setObject() to set preconfigured object instances as request handlers.

Parameters
string$classClass Name which executes SOAP Requests at endpoint.
Returns
Zend_Soap_Server
Exceptions
Zend_Soap_Server_Exceptionif called more than once, or if class does not exist

Implements Zend_Server_Interface.

setClassmap (   $classmap)

Set classmap.

Parameters
array$classmap
Returns
Zend_Soap_Server
Exceptions
Zend_Soap_Server_Exceptionfor any invalid class in the class map
See Also
Zend_Soap_Server_Exception
Zend_Soap_Server_Exception
setEncoding (   $encoding)

Set encoding.

Parameters
string$encoding
Returns
Zend_Soap_Server
Exceptions
Zend_Soap_Server_Exceptionwith invalid encoding argument
setObject (   $object)

Attach an object to a server.

Accepts an instanciated object to use when handling requests.

Parameters
object$object
Returns
Zend_Soap_Server
setOptions (   $options)

Set Options.

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

Parameters
array | Zend_Config$options
Returns
Zend_Soap_Server
setPersistence (   $mode)

Set server persistence.

Parameters
int$mode
Returns
Zend_Soap_Server

Implements Zend_Server_Interface.

setReturnResponse (   $flag)

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().

Parameters
boolean$flag
Returns
Zend_Soap_Server
setSoapFeatures (   $feature)

Set the SOAP Feature options.

Parameters
string | int$feature
Returns
Zend_Soap_Server
setSoapVersion (   $version)

Set SOAP version.

Parameters
int$versionOne of the SOAP_1_1 or SOAP_1_2 constants
Returns
Zend_Soap_Server
Exceptions
Zend_Soap_Server_Exceptionwith invalid soap version argument
setUri (   $uri)

Set URI.

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

Parameters
string$uri
Returns
Zend_Soap_Server
Exceptions
Zend_Soap_Server_Exceptionwith invalid uri argument
setWsdl (   $wsdl)

Set wsdl.

Parameters
string$wsdlURI or path to a WSDL
Returns
Zend_Soap_Server
setWsdlCache (   $options)

Set the SOAP Wsdl Caching Options.

Parameters
string | int | boolean$caching
Returns
Zend_Soap_Server
setWsiCompliant (   $value)

Set WS-I compliant.

Parameters
boolean$value
Returns
Zend_Soap_Server
validateUrn (   $urn)

Check for valid URN.

Parameters
string$urn
Returns
true
Exceptions
Zend_Soap_Server_Exceptionon invalid URN

Member Data Documentation

$_actor
protected
$_class
protected
$_classArgs = array()
protected
$_classmap
protected
$_encoding
protected
$_faultExceptions = array()
protected
$_features
protected
$_functions = array()
protected
$_object
protected

Object registered with this server.

$_persistence
protected
$_request
protected
$_response
protected
$_returnResponse = false
protected
$_soapVersion = SOAP_1_2
protected
$_uri
protected
$_wsdl
protected
$_wsdlCache
protected
$_wsiCompliant
protected