API Documentation

Soap/Server.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Soap
subpackage
Server
Classes
Zend_Soap_Server

Description

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.

Zend_Soap_Server

Implements
Zend_Server_Interface
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Soap
subpackage
Server
uses
Zend_Server_Interface
version
$Id: Server.php 20096 2010-01-06 02:05:09Z bkarwin $
Properties
$_actor
$_class
$_classArgs
$_object
$_classmap
$_encoding
$_features
$_wsdlCache
$_faultExceptions
$_functions
$_persistence
$_request
$_response
$_returnResponse
$_soapVersion
$_wsdl
$_uri
Methods
__construct
setOptions
getOptions
setEncoding
getEncoding
setSoapVersion
getSoapVersion
validateUrn
setActor
getActor
setUri
getUri
setClassmap
getClassmap
setWsdl
getWsdl
setSoapFeatures
getSoapFeatures
setWsdlCache
getWsdlCache
addFunction
setClass
setObject
getFunctions
loadFunctions
setPersistence
getPersistence
_setRequest
getLastRequest
setReturnResponse
getReturnResponse
getLastResponse
_getSoap
handle
_initializeSoapErrorContext
registerFaultException
deregisterFaultException
getFaultExceptions
fault
handlePhpErrors

Description

Zend_Soap_Server

Properties

$_actor

string $_actor = ''

Actor URI

Details

$_actor
string
URI
visibility
protected
default
final
false
static
false

$_class

string $_class = ''

Class registered with this server

Details

$_class
string
visibility
protected
default
final
false
static
false

$_classArgs

array $_classArgs = 'array'

Arguments to pass to {@link $_class} constructor

Details

$_classArgs
array
visibility
protected
default
array
final
false
static
false

$_classmap

array $_classmap = ''

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

Details

$_classmap
array
visibility
protected
default
final
false
static
false

$_encoding

string $_encoding = ''

Encoding

Details

$_encoding
string
visibility
protected
default
final
false
static
false

$_faultExceptions

array $_faultExceptions = 'array'

Registered fault exceptions

Details

$_faultExceptions
array
visibility
protected
default
array
final
false
static
false

$_features

int $_features = ''

SOAP Server Features

Details

$_features
int
visibility
protected
default
final
false
static
false

$_functions

array|int $_functions = 'array'

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

Details

$_functions
array|int
visibility
protected
default
array
final
false
static
false

$_object

 $_object = ''

Object registered with this server

Details

visibility
protected
default
final
false
static
false

$_persistence

int $_persistence = ''

Persistence mode; should be one of the SOAP persistence constants

Details

$_persistence
int
visibility
protected
default
final
false
static
false

$_request

string $_request = ''

Request XML

Details

$_request
string
visibility
protected
default
final
false
static
false

$_response

string $_response = ''

Response XML

Details

$_response
string
visibility
protected
default
final
false
static
false

$_returnResponse

boolean $_returnResponse = 'false'

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

Details

$_returnResponse
boolean
visibility
protected
default
false
final
false
static
false

$_soapVersion

int $_soapVersion = 'SOAP_1_2'

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

Details

$_soapVersion
int
visibility
protected
default
SOAP_1_2
final
false
static
false

$_uri

string $_uri = ''

URI namespace for SOAP server

Details

$_uri
string
URI
visibility
protected
default
final
false
static
false

$_wsdl

string $_wsdl = ''

URI or path to WSDL

Details

$_wsdl
string
visibility
protected
default
final
false
static
false

$_wsdlCache

mixed $_wsdlCache = ''

WSDL Caching Options of SOAP Server

Details

$_wsdlCache
mixed
visibility
protected
default
final
false
static
false

Methods

__construct

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

Arguments
$wsdl
string
$options
array
Details
visibility
public
final
false
static
false

_getSoap

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

Output
SoapServer
Details
visibility
protected
final
false
static
false

_initializeSoapErrorContext

_initializeSoapErrorContext( ) : boolean

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

Output
boolean
display_errors original value
Details
visibility
protected
final
false
static
false

_setRequest

_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

Arguments
$request
DOMDocumentDOMNodeSimpleXMLElementstdClassstring
Details
visibility
protected
final
false
static
false

addFunction

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

Attach a function as a server method

Arguments
$function
arraystring
Function name, array of function names to attach, or SOAP_FUNCTIONS_ALL to attach all functions
$namespace
string
Ignored
Details
visibility
public
final
false
static
false
throws
on invalid functions

deregisterFaultException

deregisterFaultException( string $class ) : boolean

Deregister a fault exception from the fault exception stack

Arguments
$class
string
Output
boolean
Details
visibility
public
final
false
static
false

fault

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

Arguments
$fault
stringException
$code
string
SOAP Fault Codes
Output
SoapFault
Details
visibility
public
final
false
static
false
link
http://www.w3.org/TR/soap12-part1/#faultcodes

getActor

getActor( ) : string

Retrieve actor

Output
string
Details
visibility
public
final
false
static
false

getClassmap

getClassmap( ) : mixed

Retrieve classmap

Output
mixed
Details
visibility
public
final
false
static
false

getEncoding

getEncoding( ) : string

Get encoding

Output
string
Details
visibility
public
final
false
static
false

getFaultExceptions

getFaultExceptions( ) : array

Return fault exceptions list

Output
array
Details
visibility
public
final
false
static
false

getFunctions

getFunctions( ) : 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).

Output
array
Details
visibility
public
final
false
static
false
access
public

getLastRequest

getLastRequest( ) : string

Retrieve request XML

Output
string
Details
visibility
public
final
false
static
false

getLastResponse

getLastResponse( ) : string

Get response XML

Output
string
Details
visibility
public
final
false
static
false

getOptions

getOptions( ) : array

Return array of options suitable for using with SoapServer constructor

Output
array
Details
visibility
public
final
false
static
false

getPersistence

getPersistence( ) : Zend_Soap_Server

Get server persistence

Details
visibility
public
final
false
static
false

getReturnResponse

getReturnResponse( ) : boolean

Retrieve return response flag

Output
boolean
Details
visibility
public
final
false
static
false

getSoapFeatures

getSoapFeatures( ) : int

Return current SOAP Features options

Output
int
Details
visibility
public
final
false
static
false

getSoapVersion

getSoapVersion( ) : int

Get SOAP version

Output
int
Details
visibility
public
final
false
static
false

getUri

getUri( ) : string

Retrieve URI

Output
string
Details
visibility
public
final
false
static
false

getWsdl

getWsdl( ) : string

Retrieve wsdl

Output
string
Details
visibility
public
final
false
static
false

getWsdlCache

getWsdlCache( ) :

Get current SOAP Wsdl Caching option

Details
visibility
public
final
false
static
false

handle

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

Arguments
$request
DOMDocumentDOMNodeSimpleXMLElementstdClassstring
Optional request
Output
void|string
Details
visibility
public
final
false
static
false

handlePhpErrors

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

Throw PHP errors as SoapFaults

Arguments
$errno
int
$errstr
string
$errfile
string
$errline
int
$errcontext
array
Details
visibility
public
final
false
static
false
throws

loadFunctions

loadFunctions(  $definition ) : void

Unimplemented: Load server definition

Arguments
$definition
Details
visibility
public
final
false
static
false
throws
Unimplemented

registerFaultException

registerFaultException( string|array $class ) : Zend_Soap_Server

Register a valid fault exception

Arguments
$class
stringarray
Exception class or array of exception classes
Details
visibility
public
final
false
static
false

setActor

setActor( string $actor ) : Zend_Soap_Server

Set actor

Actor is the actor URI for the server.

Arguments
$actor
string
Details
visibility
public
final
false
static
false

setClass

setClass( 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.

Arguments
$class
string
Class Name which executes SOAP Requests at endpoint.
$namespace
$argv
Details
visibility
public
final
false
static
false
throws
if called more than once, or if class does not exist

setClassmap

setClassmap( array $classmap ) : Zend_Soap_Server

Set classmap

Arguments
$classmap
array
Details
visibility
public
final
false
static
false
throws
for any invalid class in the class map

setEncoding

setEncoding( string $encoding ) : Zend_Soap_Server

Set encoding

Arguments
$encoding
string
Details
visibility
public
final
false
static
false
throws
with invalid encoding argument

setObject

setObject( object $object ) : Zend_Soap_Server

Attach an object to a server

Accepts an instanciated object to use when handling requests.

Arguments
$object
object
Details
visibility
public
final
false
static
false

setOptions

setOptions( array|Zend_Config $options ) : Zend_Soap_Server

Set Options

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

Arguments
$options
arrayZend_Config
Details
visibility
public
final
false
static
false

setPersistence

setPersistence( int $mode ) : Zend_Soap_Server

Set server persistence

Arguments
$mode
int
Details
visibility
public
final
false
static
false

setReturnResponse

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

Arguments
$flag
boolean
Details
visibility
public
final
false
static
false

setSoapFeatures

setSoapFeatures( string|int $feature ) : Zend_Soap_Server

Set the SOAP Feature options.

Arguments
$feature
stringint
Details
visibility
public
final
false
static
false

setSoapVersion

setSoapVersion( int $version ) : Zend_Soap_Server

Set SOAP version

Arguments
$version
int
One of the SOAP_1_1 or SOAP_1_2 constants
Details
visibility
public
final
false
static
false
throws
with invalid soap version argument

setUri

setUri( string $uri ) : Zend_Soap_Server

Set URI

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

Arguments
$uri
string
Details
visibility
public
final
false
static
false
throws
with invalid uri argument

setWsdl

setWsdl( string $wsdl ) : Zend_Soap_Server

Set wsdl

Arguments
$wsdl
string
URI or path to a WSDL
Details
visibility
public
final
false
static
false

setWsdlCache

setWsdlCache(  $options ) : Zend_Soap_Server

Set the SOAP Wsdl Caching Options

Arguments
$options
Details
visibility
public
final
false
static
false

validateUrn

validateUrn( string $urn ) : true

Check for valid URN

Arguments
$urn
string
Output
true
Details
visibility
public
final
false
static
false
throws
on invalid URN
Documentation was generated by DocBlox.