package Default

 Methods

Constructor

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

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

Exceptions

\Zend\Soap\Exception\ExtensionNotLoadedException

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\Server::addFunction()
fluent This method is part of a fluent interface and will return the same instance

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\Exception\InvalidArgumentException 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\Server::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 caught exception during business code execution

getException() : null | \Exception

Returns

null\Exceptioncaught exception

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

inherited_from \Zend\Server\Server::getFunctions()

Returns

array

Retrieve request XML

getLastRequest() : string

Returns

string

Return array of options suitable for using with SoapServer constructor

getOptions() : array

Returns

array

Get server persistence

getPersistence() : integer

Returns

integer

Get response XML

getResponse() : string
inherited_from \Zend\Server\Server::getResponse()

Returns

string

Retrieve return response flag

getReturnResponse() : boolean
inherited_from \Zend\Server\Server::getReturnResponse()

Returns

boolean

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

Returns

\SoapServer

Return current SOAP Features options

getSoapFeatures() : integer

Returns

integer

Get SOAP version

getSoapVersion() : integer

Returns

integer

Retrieve typemap

getTypemap() : array

Returns

array

Retrieve URI

getUri() : string

Returns

string

Retrieve wsdl

getWSDL() : string

Returns

string

Get current SOAP WSDL Caching option

getWSDLCache() 

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

inherited_from \Zend\Server\Server::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

Parameters

$errno

integer

$errstr

string

$errfile

string

$errline

integer

$errcontext

array

Exceptions

\SoapFault

Checks if provided fault name is registered as valid in this server.

isRegisteredAsFaultException(string $fault) : boolean

Parameters

$fault

string

Name of a fault class

Returns

boolean

Unimplemented: Load server definition

loadFunctions(array $definition) 

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

inherited_from \Zend\Server\Server::loadFunctions()

Parameters

$definition

array

Exceptions

\Zend\Soap\Exception\RuntimeException Unimplemented

Validate and register fault exception

registerFaultException(string|array $class) : \Zend\Soap\Server
fluent This method is part of a fluent interface and will return the same instance

Parameters

$class

stringarray

Exception class or array of exception classes

Exceptions

\Zend\Soap\Exception\InvalidArgumentException

Returns

\Zend\Soap\Server

Set actor

setActor(string $actor) : \Zend\Soap\Server

Actor is the actor URI for the server.

fluent This method is part of a fluent interface and will return the same instance

Parameters

$actor

string

Returns

\Zend\Soap\Server

Attach a class to a server

setClass(string|object $class, string $namespace = '', null|array $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 pre-configured object instances as request handlers.

inherited_from \Zend\Server\Server::setClass()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$class

stringobject

Class name or object instance which executes SOAP Requests at endpoint.

$namespace

string

$argv

nullarray

Exceptions

\Zend\Soap\Exception\InvalidArgumentException if called more than once, or if class does not exist

Returns

\Zend\Soap\Server

Set classmap

setClassmap(array $classmap) : \Zend\Soap\Server
fluent This method is part of a fluent interface and will return the same instance

Parameters

$classmap

array

Exceptions

\Zend\Soap\Exception\InvalidArgumentException for any invalid class in the class map

Returns

\Zend\Soap\Server

Set the debug mode.

setDebugMode(boolean $debug) : \Zend\Soap\Server

In debug mode, all exceptions are send to the client.

fluent This method is part of a fluent interface and will return the same instance

Parameters

$debug

boolean

Returns

\Zend\Soap\Server

Set encoding

setEncoding(string $encoding) : \Zend\Soap\Server
fluent This method is part of a fluent interface and will return the same instance

Parameters

$encoding

string

Exceptions

\Zend\Soap\Exception\InvalidArgumentException with invalid encoding argument

Returns

\Zend\Soap\Server

Attach an object to a server

setObject(object $object) : \Zend\Soap\Server

Accepts an instantiated object to use when handling requests.

fluent This method is part of a fluent interface and will return the same instance

Parameters

$object

object

Exceptions

\Zend\Soap\Exception\InvalidArgumentException

Returns

\Zend\Soap\Server

Set Options

setOptions(array|\Traversable $options) : \Zend\Soap\Server

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

fluent This method is part of a fluent interface and will return the same instance

Parameters

$options

array\Traversable

Returns

\Zend\Soap\Server

Set server persistence

setPersistence(integer $mode) : \Zend\Soap\Server
inherited_from \Zend\Server\Server::setPersistence()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$mode

integer

SOAP_PERSISTENCE_SESSION or SOAP_PERSISTENCE_REQUEST constants

Exceptions

\Zend\Soap\Exception\InvalidArgumentException

Returns

\Zend\Soap\Server

Set return response flag

setReturnResponse(boolean $flag = true) : \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().

inherited_from \Zend\Server\Server::setReturnResponse()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$flag

boolean

Returns

\Zend\Soap\Server

Set the SOAP Feature options.

setSoapFeatures(string|integer $feature) : \Zend\Soap\Server
fluent This method is part of a fluent interface and will return the same instance

Parameters

$feature

stringinteger

Returns

\Zend\Soap\Server

Set SOAP version

setSoapVersion(integer $version) : \Zend\Soap\Server
fluent This method is part of a fluent interface and will return the same instance

Parameters

$version

integer

One of the SOAP_1_1 or SOAP_1_2 constants

Exceptions

\Zend\Soap\Exception\InvalidArgumentException with invalid soap version argument

Returns

\Zend\Soap\Server

Set typemap with xml to php type mappings with appropriate validation.

setTypemap(array $typeMap) : \Zend\Soap\Server
fluent This method is part of a fluent interface and will return the same instance

Parameters

$typeMap

array

Exceptions

\Zend\Soap\Exception\InvalidArgumentException

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:'.

fluent This method is part of a fluent interface and will return the same instance

Parameters

$uri

string

Returns

\Zend\Soap\Server

Set wsdl

setWSDL(string $wsdl) : \Zend\Soap\Server
fluent This method is part of a fluent interface and will return the same instance

Parameters

$wsdl

string

URI or path to a WSDL

Returns

\Zend\Soap\Server

Set the SOAP WSDL Caching Options

setWSDLCache(string|integer|boolean $options) : \Zend\Soap\Server
fluent This method is part of a fluent interface and will return the same instance

Parameters

$options

stringintegerboolean

Returns

\Zend\Soap\Server

Check for valid URN

validateUrn(string $urn) : true

Parameters

$urn

string

Exceptions

\Zend\Soap\Exception\InvalidArgumentException on invalid URN

Returns

true

Method initializes the error context that the SOAPServer environment 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
fluent This method is part of a fluent interface and will return the same instance

Parameters

$request

\DOMDocument\DOMNode\SimpleXMLElement\stdClassstring

Exceptions

\Zend\Soap\Exception\InvalidArgumentException

Returns

\Zend\Soap\Server

 Properties

 

Actor URI

$actor : string

Default

 

Container for caught exception during business code execution

$caughtException : \Exception

Default

null
 

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

 

Informs if the soap server is in debug mode

$debug : boolean

Default

false
 

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
 

Server instance

$server : \SoapServer

Default

null
 

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

$soapVersion : integer

Default

SOAP_1_2
 

Array of type mappings

$typemap : array

Default

 

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