1744. Class

1744.1. Zend\Soap\Server

Zend_Soap_Server

1744.1.1. Methods

1744.1.1.1. __construct

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

Parameters:
  • string
  • array
Throws ExceptionExtensionNotLoadedException:
 

1744.1.1.2. setOptions

setOptions()

Set Options

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

Parameters:array|Traversable
Return type:ZendSoapServer

1744.1.1.3. getOptions

getOptions()

Return array of options suitable for using with SoapServer constructor

Return type:array

1744.1.1.4. setEncoding

setEncoding()

Set encoding

Parameters:string
Return type:Server
Throws :ExceptionInvalidArgumentException with invalid encoding argument

1744.1.1.5. getEncoding

getEncoding()

Get encoding

Return type:string

1744.1.1.6. setSoapVersion

setSoapVersion()

Set SOAP version

Parameters:int – One of the SOAP_1_1 or SOAP_1_2 constants
Return type:Server
Throws :ExceptionInvalidArgumentException with invalid soap version argument

1744.1.1.7. getSoapVersion

getSoapVersion()

Get SOAP version

Return type:int

1744.1.1.8. validateUrn

validateUrn()

Check for valid URN

Parameters:string
Return type:true
Throws :ExceptionInvalidArgumentException on invalid URN

1744.1.1.9. setActor

setActor()

Set actor

Actor is the actor URI for the server.

Parameters:string
Return type:Server

1744.1.1.10. getActor

getActor()

Retrieve actor

Return type:string

1744.1.1.11. setUri

setUri()

Set URI

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

Parameters:string
Return type:Server

1744.1.1.12. getUri

getUri()

Retrieve URI

Return type:string

1744.1.1.13. setClassmap

setClassmap()

Set classmap

Parameters:array
Return type:Server
Throws :ExceptionInvalidArgumentException for any invalid class in the class map

1744.1.1.14. getClassmap

getClassmap()

Retrieve classmap

Return type:mixed

1744.1.1.15. setWSDL

setWSDL()

Set wsdl

Parameters:string – URI or path to a WSDL
Return type:Server

1744.1.1.16. getWSDL

getWSDL()

Retrieve wsdl

Return type:string

1744.1.1.17. setSoapFeatures

setSoapFeatures()

Set the SOAP Feature options.

Parameters:string|int
Return type:Server

1744.1.1.18. getSoapFeatures

getSoapFeatures()

Return current SOAP Features options

Return type:int

1744.1.1.19. setWSDLCache

setWSDLCache()

Set the SOAP WSDL Caching Options

Parameters:string|int|bool
Return type:Server

1744.1.1.20. getWSDLCache

getWSDLCache()

Get current SOAP WSDL Caching option

1744.1.1.21. addFunction

addFunction()

Attach a function as a server method

Parameters:array|string – Function name, array of function names to attach,
or SOAP_FUNCTIONS_ALL to attach all functions
param string:Ignored
rtype:Server
throws:ExceptionInvalidArgumentException on invalid functions

1744.1.1.22. setClass

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 preconfigured object instances as request handlers.

Parameters:
  • string|object – Class name or object instance which executes SOAP Requests at endpoint.
  • string
  • $argv
Return type:

Server

Throws :

ExceptionInvalidArgumentException if called more than once, or if class

does not exist

1744.1.1.23. setObject

setObject()

Attach an object to a server

Accepts an instanciated object to use when handling requests.

Parameters:object
Throws ExceptionInvalidArgumentException:
 
Return type:Server

1744.1.1.24. getFunctions

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

Return type:array

1744.1.1.25. loadFunctions

loadFunctions()

Unimplemented: Load server definition

Parameters:array
Return type:void
Throws :ExceptionRuntimeException Unimplemented

1744.1.1.26. setPersistence

setPersistence()

Set server persistence

Parameters:int
Throws ExceptionInvalidArgumentException:
 
Return type:Server

1744.1.1.27. getPersistence

getPersistence()

Get server persistence

Return type:int

1744.1.1.28. _setRequest

_setRequest()

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
Throws ExceptionInvalidArgumentException:
 
Return type:Server

1744.1.1.29. getLastRequest

getLastRequest()

Retrieve request XML

Return type:string

1744.1.1.30. setReturnResponse

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

Parameters:bool
Return type:Server

1744.1.1.31. getReturnResponse

getReturnResponse()

Retrieve return response flag

Return type:bool

1744.1.1.32. getResponse

getResponse()

Get response XML

Return type:string

1744.1.1.33. _getSoap

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

Return type:SoapServer

1744.1.1.34. handle

handle()

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

Parameters:DOMDocument|DOMNode|SimpleXMLElement|stdClass|string – Optional request
Return type:void|string

1744.1.1.35. _initializeSoapErrorContext

_initializeSoapErrorContext()

Method initializes the error context that the SOAPServer environment will run in.

Return type:bool display_errors original value

1744.1.1.36. registerFaultException

registerFaultException()

Register a valid fault exception

Parameters:string|array – Exception class or array of exception classes
Return type:Server

1744.1.1.37. deregisterFaultException

deregisterFaultException()

Deregister a fault exception from the fault exception stack

Parameters:string
Return type:bool

1744.1.1.38. getFaultExceptions

getFaultExceptions()

Return fault exceptions list

Return type:array

1744.1.1.39. fault

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

Parameters:
  • string|Exception
  • string – SOAP Fault Codes
Return type:

SoapFault

1744.1.1.40. handlePhpErrors

handlePhpErrors()

Throw PHP errors as SoapFaults

Parameters:
  • int
  • string
  • string
  • int
  • array
Return type:

void

Throws :

SoapFault