Soap/Server.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Soap  
Subpackage
Server  

\Zend_Soap_Server

Package: Zend_Soap\Server
Zend_Soap_Server
Implements
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Uses
 
Version
$Id$  

Properties

>VPropertyprotectedstring $_actor
Actor URI
Details
Type
string
>VPropertyprotectedstring $_class
Class registered with this server
Details
Type
string
>VPropertyprotectedarray $_classArgs = array()
Arguments to pass to {@link $_class} constructor
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_classmap
Array of SOAP type => PHP class pairings for handling return/incoming values
Details
Type
array
>VPropertyprotectedstring $_encoding
Encoding
Details
Type
string
>VPropertyprotectedarray $_faultExceptions = array()
Registered fault exceptions
Default valuearray()Details
Type
array
>VPropertyprotectedint $_features
SOAP Server Features
Details
Type
int
>VPropertyprotectedarray|int $_functions = array()
Functions registered with this server; may be either an array or the SOAP_FUNCTIONS_ALL constant
Default valuearray()Details
Type
array | int
>VPropertyprotected$_object
Object registered with this server
Details
Type
n/a
>VPropertyprotectedint $_persistence
Persistence mode; should be one of the SOAP persistence constants
Details
Type
int
>VPropertyprotectedstring $_request
Request XML
Details
Type
string
>VPropertyprotectedstring $_response
Response XML
Details
Type
string
>VPropertyprotectedboolean $_returnResponse = false
Flag: whether or not {@link handle()} should return a response instead of automatically emitting it.
Default valuefalseDetails
Type
boolean
>VPropertyprotectedint $_soapVersion = SOAP_1_2
SOAP version to use; SOAP_1_2 by default, to allow processing of headers
Default valueSOAP_1_2Details
Type
int
>VPropertyprotectedstring $_uri
URI namespace for SOAP server
Details
Type
string
>VPropertyprotectedstring $_wsdl
URI or path to WSDL
Details
Type
string
>VPropertyprotectedmixed $_wsdlCache
WSDL Caching Options of SOAP Server
Details
Type
mixed
>VPropertyprotectedboolean $_wsiCompliant
WS-I compliant
Details
Type
boolean

Methods

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

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
NameTypeDescription
$wsdlstring
$optionsarray
methodprotected_getSoap() : \SoapServer

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 peristence.
Returns
TypeDescription
\SoapServer
methodprotected_initializeSoapErrorContext() : boolean

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

Returns
TypeDescription
booleandisplay_errors original value
methodprotected_setRequest(\DOMDocument | \DOMNode | \SimpleXMLElement | \stdClass | string $request) : \Zend_Soap_Server

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
NameTypeDescription
$request\DOMDocument | \DOMNode | \SimpleXMLElement | \stdClass | string
Returns
TypeDescription
\Zend_Soap_Server
methodpublicaddFunction(array | string $function, string $namespace = '') : \Zend_Soap_Server

Attach a function as a server method

Parameters
NameTypeDescription
$functionarray | string

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

$namespacestring

Ignored

Returns
TypeDescription
\Zend_Soap_Server
Throws
ExceptionDescription
\Zend_Soap_Server_Exceptionon invalid functions
methodpublicderegisterFaultException(string $class) : boolean

Deregister a fault exception from the fault exception stack

Parameters
NameTypeDescription
$classstring
Returns
TypeDescription
boolean
methodpublicfault(string | \Exception $fault = null, string $code = "Receiver") : \SoapFault

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
NameTypeDescription
$faultstring | \Exception
$codestring

SOAP Fault Codes

Returns
TypeDescription
\SoapFault
Details
Link
http://www.w3.org/TR/soap12-part1/#faultcodes  
methodpublicgetActor() : string

Retrieve actor

Returns
TypeDescription
string
methodpublicgetClassmap() : mixed

Retrieve classmap

Returns
TypeDescription
mixed
methodpublicgetEncoding() : string

Get encoding

Returns
TypeDescription
string
methodpublicgetFaultExceptions() : array

Return fault exceptions list

Returns
TypeDescription
array
methodpublicgetFunctions() : array

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
TypeDescription
array
Details
Access
public  
methodpublicgetLastRequest() : string

Retrieve request XML

Returns
TypeDescription
string
methodpublicgetLastResponse() : string

Get response XML

Returns
TypeDescription
string
methodpublicgetOptions() : array

Return array of options suitable for using with SoapServer constructor

Returns
TypeDescription
array
methodpublicgetPersistence() : \Zend_Soap_Server

Get server persistence

Returns
TypeDescription
\Zend_Soap_Server
methodpublicgetReturnResponse() : boolean

Retrieve return response flag

Returns
TypeDescription
boolean
methodpublicgetSoapFeatures() : int

Return current SOAP Features options

Returns
TypeDescription
int
methodpublicgetSoapVersion() : int

Get SOAP version

Returns
TypeDescription
int
methodpublicgetUri() : string

Retrieve URI

Returns
TypeDescription
string
methodpublicgetWsdl() : string

Retrieve wsdl

Returns
TypeDescription
string
methodpublicgetWsdlCache() : void

Get current SOAP Wsdl Caching option

methodpublicgetWsiCompliant() : boolean

Gt WS-I compliant

Returns
TypeDescription
boolean
methodpublichandle(\DOMDocument | \DOMNode | \SimpleXMLElement | \stdClass | string $request = null) : void | string

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
NameTypeDescription
$request\DOMDocument | \DOMNode | \SimpleXMLElement | \stdClass | string

Optional request

Returns
TypeDescription
void | string
methodpublichandlePhpErrors(int $errno, string $errstr, string $errfile = null, int $errline = null, array $errcontext = null) : void

Throw PHP errors as SoapFaults

Parameters
NameTypeDescription
$errnoint
$errstrstring
$errfilestring
$errlineint
$errcontextarray
Throws
ExceptionDescription
\SoapFault
methodpublicloadFunctions( $definition) : void

Unimplemented: Load server definition

Parameters
NameTypeDescription
$definition
Throws
ExceptionDescription
\Zend_Soap_Server_ExceptionUnimplemented
methodpublicregisterFaultException(string | array $class) : \Zend_Soap_Server

Register a valid fault exception

Parameters
NameTypeDescription
$classstring | array

Exception class or array of exception classes

Returns
TypeDescription
\Zend_Soap_Server
methodpublicsetActor(string $actor) : \Zend_Soap_Server

Set actor

Actor is the actor URI for the server.
Parameters
NameTypeDescription
$actorstring
Returns
TypeDescription
\Zend_Soap_Server
methodpublicsetClass(string $class,  $namespace = '',  $argv = null) : \Zend_Soap_Server

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
NameTypeDescription
$classstring

Class Name which executes SOAP Requests at endpoint.

$namespace
$argv
Returns
TypeDescription
\Zend_Soap_Server
Throws
ExceptionDescription
\Zend_Soap_Server_Exceptionif called more than once, or if class does not exist
methodpublicsetClassmap(array $classmap) : \Zend_Soap_Server

Set classmap

Parameters
NameTypeDescription
$classmaparray
Returns
TypeDescription
\Zend_Soap_Server
Throws
ExceptionDescription
\Zend_Soap_Server_Exceptionfor any invalid class in the class map
methodpublicsetEncoding(string $encoding) : \Zend_Soap_Server

Set encoding

Parameters
NameTypeDescription
$encodingstring
Returns
TypeDescription
\Zend_Soap_Server
Throws
ExceptionDescription
\Zend_Soap_Server_Exceptionwith invalid encoding argument
methodpublicsetObject(object $object) : \Zend_Soap_Server

Attach an object to a server

Accepts an instanciated object to use when handling requests.
Parameters
NameTypeDescription
$objectobject
Returns
TypeDescription
\Zend_Soap_Server
methodpublicsetOptions(array | \Zend_Config $options) : \Zend_Soap_Server

Set Options

Allows setting options as an associative array of option => value pairs.
Parameters
NameTypeDescription
$optionsarray | \Zend_Config
Returns
TypeDescription
\Zend_Soap_Server
methodpublicsetPersistence(int $mode) : \Zend_Soap_Server

Set server persistence

Parameters
NameTypeDescription
$modeint
Returns
TypeDescription
\Zend_Soap_Server
methodpublicsetReturnResponse(boolean $flag) : \Zend_Soap_Server

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
NameTypeDescription
$flagboolean
Returns
TypeDescription
\Zend_Soap_Server
methodpublicsetSoapFeatures(string | int $feature) : \Zend_Soap_Server

Set the SOAP Feature options.

Parameters
NameTypeDescription
$featurestring | int
Returns
TypeDescription
\Zend_Soap_Server
methodpublicsetSoapVersion(int $version) : \Zend_Soap_Server

Set SOAP version

Parameters
NameTypeDescription
$versionint

One of the SOAP_1_1 or SOAP_1_2 constants

Returns
TypeDescription
\Zend_Soap_Server
Throws
ExceptionDescription
\Zend_Soap_Server_Exceptionwith invalid soap version argument
methodpublicsetUri(string $uri) : \Zend_Soap_Server

Set URI

URI in SoapServer is actually the target namespace, not a URI; $uri must begin with 'urn:'.
Parameters
NameTypeDescription
$uristring
Returns
TypeDescription
\Zend_Soap_Server
Throws
ExceptionDescription
\Zend_Soap_Server_Exceptionwith invalid uri argument
methodpublicsetWsdl(string $wsdl) : \Zend_Soap_Server

Set wsdl

Parameters
NameTypeDescription
$wsdlstring

URI or path to a WSDL

Returns
TypeDescription
\Zend_Soap_Server
methodpublicsetWsdlCache( $options) : \Zend_Soap_Server

Set the SOAP Wsdl Caching Options

Parameters
NameTypeDescription
$options
Returns
TypeDescription
\Zend_Soap_Server
methodpublicsetWsiCompliant(boolean $value) : \Zend_Soap_Server

Set WS-I compliant

Parameters
NameTypeDescription
$valueboolean
Returns
TypeDescription
\Zend_Soap_Server
methodpublicvalidateUrn(string $urn) : true

Check for valid URN

Parameters
NameTypeDescription
$urnstring
Returns
TypeDescription
true
Throws
ExceptionDescription
\Zend_Soap_Server_Exceptionon invalid URN
Documentation was generated by phpDocumentor 2.2.0 .