Zend_Soap_Server

category Zend
package Zend_Soap
subpackage Server
uses
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
version $Id$

 Methods

Constructor

__construct(string $wsdl = null, array $options = null) : void

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

$wsdl

string

$options

array

Attach a function as a server method

addFunction(array|string $function, string $namespace = '') : \Zend_Soap_Server

Namespacing is primarily for xmlrpc, but may be used with other implementations to prevent naming collisions.

inherited_from \Zend_Server_Interface::addFunction()

Parameters

$function

arraystring

Function name, array of function names to attach, or SOAP_FUNCTIONS_ALL to attach all functions

$namespace

string

Ignored

Exceptions

\Zend_Soap_Server_Exception on invalid functions

Returns

\Zend_Soap_Server

Deregister a fault exception from the fault exception stack

deregisterFaultException(string $class) : boolean

Parameters

$class

string

Returns

boolean

Generate a server fault

fault(string|\Exception $fault = null, string $code = "Receiver") : \SoapFault

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

link http://www.w3.org/TR/soap12-part1/#faultcodes
inherited_from \Zend_Server_Interface::fault()

Parameters

$fault

string\Exception

$code

string

SOAP Fault Codes

Returns

\SoapFault

Retrieve actor

getActor() : string

Returns

string

Retrieve classmap

getClassmap() : mixed

Returns

mixed

Get encoding

getEncoding() : string

Returns

string

Return fault exceptions list

getFaultExceptions() : array

Returns

array

Return a server definition array

getFunctions() : 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
inherited_from \Zend_Server_Interface::getFunctions()

Returns

array

Retrieve request XML

getLastRequest() : string

Returns

string

Get response XML

getLastResponse() : string

Returns

string

Return array of options suitable for using with SoapServer constructor

getOptions() : array

Returns

array

Get server persistence

getPersistence() : \Zend_Soap_Server

Returns

\Zend_Soap_Server

Retrieve return response flag

getReturnResponse() : boolean

Returns

boolean

Return current SOAP Features options

getSoapFeatures() : integer

Returns

integer

Get SOAP version

getSoapVersion() : integer

Returns

integer

Retrieve URI

getUri() : string

Returns

string

Retrieve wsdl

getWsdl() : string

Returns

string

Get current SOAP Wsdl Caching option

getWsdlCache() 

Gt WS-I compliant

getWsiCompliant() : boolean

Returns

boolean

Handle a request

handle(\DOMDocument|\DOMNode|\SimpleXMLElement|\stdClass|string $request = null) : void | string

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

inherited_from \Zend_Server_Interface::handle()

Parameters

$request

\DOMDocument\DOMNode\SimpleXMLElement\stdClassstring

Optional request

Returns

voidstring

Throw PHP errors as SoapFaults

handlePhpErrors(integer $errno, string $errstr, string $errfile = null, integer $errline = null, array $errcontext = null) : void

Parameters

$errno

integer

$errstr

string

$errfile

string

$errline

integer

$errcontext

array

Exceptions

\SoapFault

Unimplemented: Load server definition

loadFunctions($definition) : void

Used for persistence; loads a construct as returned by \getFunctions().

inherited_from \Zend_Server_Interface::loadFunctions()

Parameters

$definition

Exceptions

\Zend_Soap_Server_Exception Unimplemented

Register a valid fault exception

registerFaultException(string|array $class) : \Zend_Soap_Server

Parameters

$class

stringarray

Exception class or array of exception classes

Returns

\Zend_Soap_Server

Set actor

setActor(string $actor) : \Zend_Soap_Server

Actor is the actor URI for the server.

Parameters

$actor

string

Returns

\Zend_Soap_Server

Attach a class to a server

setClass(string $class, string $namespace = '', $argv = null) : \Zend_Soap_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.

inherited_from \Zend_Server_Interface::setClass()

Parameters

$class

string

Class Name which executes SOAP Requests at endpoint.

$namespace

$argv

Exceptions

\Zend_Soap_Server_Exception if called more than once, or if class does not exist

Returns

\Zend_Soap_Server

Set classmap

setClassmap(array $classmap) : \Zend_Soap_Server

Parameters

$classmap

array

Exceptions

\Zend_Soap_Server_Exception for any invalid class in the class map

Returns

\Zend_Soap_Server

Set encoding

setEncoding(string $encoding) : \Zend_Soap_Server

Parameters

$encoding

string

Exceptions

\Zend_Soap_Server_Exception with invalid encoding argument

Returns

\Zend_Soap_Server

Attach an object to a server

setObject(object $object) : \Zend_Soap_Server

Accepts an instanciated object to use when handling requests.

Parameters

$object

object

Returns

\Zend_Soap_Server

Set Options

setOptions(array|\Zend_Config $options) : \Zend_Soap_Server

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

Parameters

$options

array\Zend_Config

Returns

\Zend_Soap_Server

Set server persistence

setPersistence(integer $mode) : \Zend_Soap_Server
inherited_from \Zend_Server_Interface::setPersistence()

Parameters

$mode

integer

Returns

\Zend_Soap_Server

Set return response flag

setReturnResponse(boolean $flag) : \Zend_Soap_Server

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

$flag

boolean

Returns

\Zend_Soap_Server

Set the SOAP Feature options.

setSoapFeatures(string|integer $feature) : \Zend_Soap_Server

Parameters

$feature

stringinteger

Returns

\Zend_Soap_Server

Set SOAP version

setSoapVersion(integer $version) : \Zend_Soap_Server

Parameters

$version

integer

One of the SOAP_1_1 or SOAP_1_2 constants

Exceptions

\Zend_Soap_Server_Exception with invalid soap version argument

Returns

\Zend_Soap_Server

Set URI

setUri(string $uri) : \Zend_Soap_Server

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

Parameters

$uri

string

Exceptions

\Zend_Soap_Server_Exception with invalid uri argument

Returns

\Zend_Soap_Server

Set wsdl

setWsdl(string $wsdl) : \Zend_Soap_Server

Parameters

$wsdl

string

URI or path to a WSDL

Returns

\Zend_Soap_Server

Set the SOAP Wsdl Caching Options

setWsdlCache($options) : \Zend_Soap_Server

Parameters

$options

Returns

\Zend_Soap_Server

Set WS-I compliant

setWsiCompliant(boolean $value) : \Zend_Soap_Server

Parameters

$value

boolean

Returns

\Zend_Soap_Server

Check for valid URN

validateUrn(string $urn) : true

Parameters

$urn

string

Exceptions

\Zend_Soap_Server_Exception on invalid URN

Returns

true

Get SoapServer object

_getSoap() : \SoapServer

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

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

_initializeSoapErrorContext() : boolean

Returns

booleandisplay_errors original value

Set request

_setRequest(\DOMDocument|\DOMNode|\SimpleXMLElement|\stdClass|string $request) : \Zend_Soap_Server

$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

$request

\DOMDocument\DOMNode\SimpleXMLElement\stdClassstring

Returns

\Zend_Soap_Server

 Properties

 

Actor URI

$_actor : string

Default

 

Class registered with this server

$_class : string

Default

 

Arguments to pass to {@link $_class} constructor

$_classArgs : array

Default

array()
 

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

$_classmap : array

Default

 

Encoding

$_encoding : string

Default

 

Registered fault exceptions

$_faultExceptions : array

Default

array()
 

SOAP Server Features

$_features : integer

Default

 

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

$_functions : array | integer

Default

array()
 

Object registered with this server

$_object 

Default

 

Persistence mode; should be one of the SOAP persistence constants

$_persistence : integer

Default

 

Request XML

$_request : string

Default

 

Response XML

$_response : string

Default

 

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

$_returnResponse : boolean

Default

false
 

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

$_soapVersion : integer

Default

SOAP_1_2
 

URI namespace for SOAP server

$_uri : string

Default

 

URI or path to WSDL

$_wsdl : string

Default

 

WSDL Caching Options of SOAP Server

$_wsdlCache : mixed

Default

 

WS-I compliant

$_wsiCompliant : boolean

Default