Class Server

Summary

Fully Qualified Name: Laminas\Soap\Server
Implements: Server

Description

Methods

Name Description Defined By
__construct() Constructor Server
addFunction() Attach a function as a server method Server
deregisterFaultException() Deregister a fault exception from the fault exception stack Server
fault() Generate a server fault Server
getActor() Retrieve actor Server
getClassmap() Retrieve classmap Server
getEncoding() Get encoding Server
getException() Return caught exception during business code execution Server
getFaultExceptions() Return fault exceptions list Server
getFunctions() Return a server definition array Server
getLastRequest() Retrieve request XML Server
getOptions() Return array of options suitable for using with SoapServer constructor Server
getParseHuge() Get flag to allow DOMDocument->loadXML() to parse huge nodes Server
getPersistence() Get server persistence Server
getResponse() Get response XML Server
getReturnResponse() Retrieve return response flag Server
getSendErrors() Get current SOAP send_errors option Server
getSoap() Get SoapServer object Server
getSoapFeatures() Return current SOAP Features options Server
getSoapVersion() Get SOAP version Server
getTypemap() Retrieve typemap Server
getUri() Retrieve URI Server
getWSDL() Retrieve wsdl Server
getWSDLCache() Get current SOAP WSDL Caching option Server
handle() Handle a request Server
handlePhpErrors() Throw PHP errors as SoapFaults Server
isRegisteredAsFaultException() Checks if provided fault name is registered as valid in this server. Server
loadFunctions() Unimplemented: Load server definition Server
registerFaultException() Validate and register fault exception Server
setActor() Set actor Server
setClass() Attach a class to a server Server
setClassmap() Set classmap Server
setDebugMode() Set the debug mode. Server
setEncoding() Set encoding Server
setObject() Attach an object to a server Server
setOptions() Set Options Server
setParseHuge() Set flag to allow DOMDocument->loadXML() to parse huge nodes Server
setPersistence() Set server persistence Server
setReturnResponse() Set return response flag Server
setSendErrors() Set the SOAP send_errors Option Server
setSoapFeatures() Set the SOAP Feature options. Server
setSoapVersion() Set SOAP version Server
setTypemap() Set typemap with xml to php type mappings with appropriate validation. Server
setUri() Set URI Server
setWSDL() Set wsdl Server
setWSDLCache() Set the SOAP WSDL Caching Options Server
validateUrn() Check for valid URN Server

Method Details

__construct()

Constructor

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

If $wsdl is provided, it is passed on to {@link setWSDL()}; if any options are specified, they are passed on to {@link setOptions()}.

Parameter Name Type Description
$wsdl string
$options array

Returns:

addFunction()

Attach a function as a server method

Parameter Name Type Description
$function array|string Function
$namespace string Ignored

Returns: self

deregisterFaultException()

Deregister a fault exception from the fault exception stack

Parameter Name Type Description
$class string

Returns: bool

fault()

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

Parameter Name Type Description
$fault string|\Exception
$code string SOAP

Returns: \SoapFault

getActor()

Retrieve actor

Returns: string

getClassmap()

Retrieve classmap

Returns: mixed

getEncoding()

Get encoding

Returns: string

getException()

Return caught exception during business code execution

Returns: null|\Exception caught exception

getFaultExceptions()

Return fault exceptions list

Returns: array

getFunctions()

Return a server definition array

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

Returns: array

getLastRequest()

Retrieve request XML

Returns: string

getOptions()

Return array of options suitable for using with SoapServer constructor

Returns: array

getParseHuge()

Get flag to allow DOMDocument->loadXML() to parse huge nodes

Returns: bool

getPersistence()

Get server persistence

Returns: int

getResponse()

Get response XML

Returns: string

getReturnResponse()

Retrieve return response flag

Returns: bool

getSendErrors()

Get current SOAP send_errors option

Returns: bool

getSoap()

Get SoapServer object

Uses {@link $wsdl} and return value of {@link getOptions()} to instantiate SoapServer object, and then registers any functions or class with it, as well as persistence.

Returns: \SoapServer

getSoapFeatures()

Return current SOAP Features options

Returns: int

getSoapVersion()

Get SOAP version

Returns: int

getTypemap()

Retrieve typemap

Returns: array

getUri()

Retrieve URI

Returns: string

getWSDL()

Retrieve wsdl

Returns: string

getWSDLCache()

Get current SOAP WSDL Caching option

Returns:

handle()

Handle a request

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

$request may be any of:

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

Parameter Name Type Description
$request \DOMDocument|\DOMNode|\SimpleXMLElement|\stdClass|string Optional

Returns: void|string

handlePhpErrors()

Throw PHP errors as SoapFaults

Parameter Name Type Description
$errno int
$errstr string

Returns:

isRegisteredAsFaultException()

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

Parameter Name Type Description
$fault string Name

Returns: bool

loadFunctions()

Unimplemented: Load server definition

Parameter Name Type Description
$definition array

Returns:

registerFaultException()

Validate and register fault exception

Parameter Name Type Description
$class string|array Exception

Returns: self

setActor()

Set actor

Actor is the actor URI for the server.

Parameter Name Type Description
$actor string

Returns: self

setClass()

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 {@link setObject()} to set pre-configured object instances as request handlers.

Parameter Name Type Description
$class string|object Class
$namespace string
$argv null|array

Returns: self

setClassmap()

Set classmap

Parameter Name Type Description
$classmap array

Returns: self

setDebugMode()

Set the debug mode.

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

Parameter Name Type Description
$debug bool

Returns: self

setEncoding()

Set encoding

Parameter Name Type Description
$encoding string

Returns: self

setObject()

Attach an object to a server

Accepts an instantiated object to use when handling requests.

Parameter Name Type Description
$object object

Returns: self

setOptions()

Set Options

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

Parameter Name Type Description
$options array|\Traversable

Returns: self

setParseHuge()

Set flag to allow DOMDocument->loadXML() to parse huge nodes

Parameter Name Type Description
$parseHuge bool

Returns: self

setPersistence()

Set server persistence

Parameter Name Type Description
$mode int SOAP_PERSISTENCE_SESSION

Returns: self

setReturnResponse()

Set return response flag

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

The response is always available via {@link getResponse()}.

Parameter Name Type Description
$flag bool

Returns: self

setSendErrors()

Set the SOAP send_errors Option

Parameter Name Type Description
$sendErrors bool

Returns: self

setSoapFeatures()

Set the SOAP Feature options.

Parameter Name Type Description
$feature string|int

Returns: self

setSoapVersion()

Set SOAP version

Parameter Name Type Description
$version int One

Returns: self

setTypemap()

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

Parameter Name Type Description
$typeMap array

Returns: self

setUri()

Set URI

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

Parameter Name Type Description
$uri string

Returns: self

setWSDL()

Set wsdl

Parameter Name Type Description
$wsdl string URI

Returns: self

setWSDLCache()

Set the SOAP WSDL Caching Options

Parameter Name Type Description
$options string|int|bool

Returns: self

validateUrn()

Check for valid URN

Parameter Name Type Description
$urn string

Returns: bool

Top