API Documentation

Zend/Soap/Server.php

Show: inherited
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-2012 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
\Zend_Server_Interface
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Uses
\Zend_Server_Interface  
Version
$Id: Server.php 25032 2012-08-17 19:45:06Z matthew $  

Properties

Propertyprotectedstring  $_actor= ''

Actor URI

URI
Details
Type
string
Propertyprotectedstring  $_class= ''

Class registered with this server

Details
Type
string
Propertyprotectedarray  $_classArgs= 'array()'

Arguments to pass to {@link $_class} constructor

Default valuearray()Details
Type
array
Propertyprotectedarray  $_classmap= ''

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

Details
Type
array
Propertyprotectedstring  $_encoding= ''

Encoding

Details
Type
string
Propertyprotectedarray  $_faultExceptions= 'array()'

Registered fault exceptions

Default valuearray()Details
Type
array
Propertyprotectedint  $_features= ''

SOAP Server Features

Details
Type
int
Propertyprotectedarray|int  $_functions= 'array()'

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

Default valuearray()Details
Type
arrayint
Propertyprotected  $_object= ''

Object registered with this server

Details
Type
Propertyprotectedint  $_persistence= ''

Persistence mode; should be one of the SOAP persistence constants

Details
Type
int
Propertyprotectedstring  $_request= ''

Request XML

Details
Type
string
Propertyprotectedstring  $_response= ''

Response XML

Details
Type
string
Propertyprotectedboolean  $_returnResponse= 'false'

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

Default valuefalseDetails
Type
boolean
Propertyprotectedint  $_soapVersion= 'SOAP_1_2'

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

Default valueSOAP_1_2Details
Type
int
Propertyprotectedstring  $_uri= ''

URI namespace for SOAP server

URI
Details
Type
string
Propertyprotectedstring  $_wsdl= ''

URI or path to WSDL

Details
Type
string
Propertyprotectedmixed  $_wsdlCache= ''

WSDL Caching Options of SOAP Server

Details
Type
mixed

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
Name Type Description
$wsdl string
$options array
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
Type Description
\SoapServer
methodprotected_initializeSoapErrorContext( ) : boolean

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

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

Attach a function as a server method

Parameters
Name Type Description
$function array|string

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

$namespace string

Ignored

Returns
Type Description
\Zend_Soap_Server
Throws
Exception Description
\Zend_Soap_Server_Exception on invalid functions
methodpublicderegisterFaultException( string $class ) : boolean

Deregister a fault exception from the fault exception stack

Parameters
Name Type Description
$class string
Returns
Type Description
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
Name Type Description
$fault string|\Exception
$code string

SOAP Fault Codes

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

Retrieve actor

Returns
Type Description
string
methodpublicgetClassmap( ) : mixed

Retrieve classmap

Returns
Type Description
mixed
methodpublicgetEncoding( ) : string

Get encoding

Returns
Type Description
string
methodpublicgetFaultExceptions( ) : array

Return fault exceptions list

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

Retrieve request XML

Returns
Type Description
string
methodpublicgetLastResponse( ) : string

Get response XML

Returns
Type Description
string
methodpublicgetOptions( ) : array

Return array of options suitable for using with SoapServer constructor

Returns
Type Description
array
methodpublicgetPersistence( ) : \Zend_Soap_Server

Get server persistence

Returns
Type Description
\Zend_Soap_Server
methodpublicgetReturnResponse( ) : boolean

Retrieve return response flag

Returns
Type Description
boolean
methodpublicgetSoapFeatures( ) : int

Return current SOAP Features options

Returns
Type Description
int
methodpublicgetSoapVersion( ) : int

Get SOAP version

Returns
Type Description
int
methodpublicgetUri( ) : string

Retrieve URI

Returns
Type Description
string
methodpublicgetWsdl( ) : string

Retrieve wsdl

Returns
Type Description
string
methodpublicgetWsdlCache( ) : void

Get current SOAP Wsdl Caching option

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

Optional request

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

Throw PHP errors as SoapFaults

Parameters
Name Type Description
$errno int
$errstr string
$errfile string
$errline int
$errcontext array
Throws
Exception Description
\SoapFault
methodpublicloadFunctions(  $definition ) : void

Unimplemented: Load server definition

Parameters
Name Type Description
$definition
Throws
Exception Description
\Zend_Soap_Server_Exception Unimplemented
methodpublicregisterFaultException( string|array $class ) : \Zend_Soap_Server

Register a valid fault exception

Parameters
Name Type Description
$class string|array

Exception class or array of exception classes

Returns
Type Description
\Zend_Soap_Server
methodpublicsetActor( string $actor ) : \Zend_Soap_Server

Set actor

Actor is the actor URI for the server.

Parameters
Name Type Description
$actor string
Returns
Type Description
\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
Name Type Description
$class string

Class Name which executes SOAP Requests at endpoint.

$namespace
$argv
Returns
Type Description
\Zend_Soap_Server
Throws
Exception Description
\Zend_Soap_Server_Exception if called more than once, or if class does not exist
methodpublicsetClassmap( array $classmap ) : \Zend_Soap_Server

Set classmap

Parameters
Name Type Description
$classmap array
Returns
Type Description
\Zend_Soap_Server
Throws
Exception Description
\Zend_Soap_Server_Exception for any invalid class in the class map
methodpublicsetEncoding( string $encoding ) : \Zend_Soap_Server

Set encoding

Parameters
Name Type Description
$encoding string
Returns
Type Description
\Zend_Soap_Server
Throws
Exception Description
\Zend_Soap_Server_Exception with 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
Name Type Description
$object object
Returns
Type Description
\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
Name Type Description
$options array|\Zend_Config
Returns
Type Description
\Zend_Soap_Server
methodpublicsetPersistence( int $mode ) : \Zend_Soap_Server

Set server persistence

Parameters
Name Type Description
$mode int
Returns
Type Description
\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
Name Type Description
$flag boolean
Returns
Type Description
\Zend_Soap_Server
methodpublicsetSoapFeatures( string|int $feature ) : \Zend_Soap_Server

Set the SOAP Feature options.

Parameters
Name Type Description
$feature string|int
Returns
Type Description
\Zend_Soap_Server
methodpublicsetSoapVersion( int $version ) : \Zend_Soap_Server

Set SOAP version

Parameters
Name Type Description
$version int

One of the SOAP_1_1 or SOAP_1_2 constants

Returns
Type Description
\Zend_Soap_Server
Throws
Exception Description
\Zend_Soap_Server_Exception with 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
Name Type Description
$uri string
Returns
Type Description
\Zend_Soap_Server
Throws
Exception Description
\Zend_Soap_Server_Exception with invalid uri argument
methodpublicsetWsdl( string $wsdl ) : \Zend_Soap_Server

Set wsdl

Parameters
Name Type Description
$wsdl string

URI or path to a WSDL

Returns
Type Description
\Zend_Soap_Server
methodpublicsetWsdlCache(  $options ) : \Zend_Soap_Server

Set the SOAP Wsdl Caching Options

Parameters
Name Type Description
$options
Returns
Type Description
\Zend_Soap_Server
methodpublicvalidateUrn( string $urn ) : true

Check for valid URN

Parameters
Name Type Description
$urn string
Returns
Type Description
true
Throws
Exception Description
\Zend_Soap_Server_Exception on invalid URN
Documentation was generated by DocBlox 0.15.1.