From 508273780c5fad4aa000abae84ced11cc055cbda Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 5 Feb 2004 20:26:05 +0000 Subject: [PATCH] PHP API was changed (see readme.html for more details). --- ext/soap/TODO | 16 +- ext/soap/interop/client_round2_interop.php | 20 +- ext/soap/interop/server_round2_base.php | 3 +- ext/soap/interop/server_round2_groupB.php | 3 +- ext/soap/interop/server_round2_groupC.php | 3 +- ext/soap/php_encoding.h | 86 ++-- ext/soap/readme.html | 570 +++++++++++++++++++++ ext/soap/soap.c | 423 ++++++++------- ext/soap/tests/schema/test_schema.inc | 6 +- ext/soap/tests/server001.phpt | 2 +- ext/soap/tests/server002.phpt | 2 +- ext/soap/tests/server003.phpt | 2 +- ext/soap/tests/server004.phpt | 2 +- ext/soap/tests/server005.phpt | 2 +- ext/soap/tests/server006.phpt | 2 +- ext/soap/tests/server007.phpt | 2 +- ext/soap/tests/server008.phpt | 2 +- ext/soap/tests/server009.phpt | 2 +- ext/soap/tests/server010.phpt | 2 +- ext/soap/tests/server011.phpt | 3 +- ext/soap/tests/server012.phpt | 2 +- ext/soap/tests/server013.phpt | 2 +- ext/soap/tests/server014.phpt | 2 +- ext/soap/tests/soap12/soap12-test.inc | 3 +- 24 files changed, 872 insertions(+), 290 deletions(-) create mode 100644 ext/soap/readme.html diff --git a/ext/soap/TODO b/ext/soap/TODO index e05dd232d2..bd4743bcce 100644 --- a/ext/soap/TODO +++ b/ext/soap/TODO @@ -1,11 +1,10 @@ General ------- -- rename soapobject to soapclient - make sure soapserver.map(), soap_encode_to_xml() and soap_encode_to_zval() are really need - reimplement SoapObject::__getfunctions() and SoapObject::__gettypes() to return structures instead of strings - memory leaks (libxml and WSDL/Schema use malloc to cache WSDL) - +- error handling??? SOAP ---- @@ -89,10 +88,6 @@ Schema ? support for user defined complex types ? full support for content model encoding/decoding -Error Handling --------------- -- ??? - Transport --------- ? HTTP status codes @@ -100,11 +95,10 @@ Transport - support for HTTP compression (gzip,x-gzip,defalte) - transport abstraction layer??? -UDDI ----- -- ??? - Interop Testing --------------- -- more rounds/groups +- more introp rounds/groups + +UDDI +---- - ??? diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php index 7d9f90455e..b543d31643 100644 --- a/ext/soap/interop/client_round2_interop.php +++ b/ext/soap/interop/client_round2_interop.php @@ -90,8 +90,8 @@ class Interop_Client $this->_getEndpoints($test, 1); // retreive endpoints from the endpoint server - $endpointArray = $soapclient->__call("GetEndpointInfo",array("groupName"=>$test),"http://soapinterop.org/","http://soapinterop.org/"); - if ($soapclient->__isfault() || PEAR::isError($endpointArray)) { + $endpointArray = $soapclient->__call("GetEndpointInfo",array("groupName"=>$test),array('soapaction'=>"http://soapinterop.org/",'uri'=>"http://soapinterop.org/")); + if (is_soap_fault($endpointArray) || PEAR::isError($endpointArray)) { print "
".$soapclient->wire."\n";
             print_r($endpointArray);
             print "
"; @@ -134,7 +134,7 @@ class Interop_Client */ function fetchEndpoints($test = NULL) { // fetch from the interop server - $soapclient = new SoapObject($this->interopServer); + $soapclient = new SoapClient($this->interopServer); if ($test) { $this->_fetchEndpoints($soapclient, $test); @@ -358,8 +358,7 @@ class Interop_Client if ($this->useWSDL) { if (array_key_exists('wsdlURL',$endpoint_info)) { if (!array_key_exists('client',$endpoint_info)) { - $endpoint_info['client'] = new SoapObject($endpoint_info['wsdlURL']); - $endpoint_info['client']->__trace(1); + $endpoint_info['client'] = new SoapClient($endpoint_info['wsdlURL'], array("trace"=>1)); } $soap =& $endpoint_info['client']; @@ -394,8 +393,7 @@ class Interop_Client $soapaction = 'urn:soapinterop'; } if (!array_key_exists('client',$endpoint_info)) { - $endpoint_info['client'] = new SoapObject($endpoint_info['endpointURL'],$soapaction); - $endpoint_info['client']->__trace(1); + $endpoint_info['client'] = new SoapClient(null,array('location'=>$endpoint_info['endpointURL'],'uri'=>$soapaction,'trace'=>1)); } $soap = $endpoint_info['client']; } @@ -418,14 +416,14 @@ class Interop_Client $return = eval('return $soap->'.$soap_test->method_name.'('.$args.');'); } else { if ($soap_test->headers || $soap_test->headers_expect) { - $return = $soap->__call($soap_test->method_name,$soap_test->method_params,$soapaction, $namespace, $soap_test->headers, $result_headers); + $return = $soap->__call($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace), $soap_test->headers, $result_headers); } else { - $return = $soap->__call($soap_test->method_name,$soap_test->method_params,$soapaction, $namespace); + $return = $soap->__call($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace)); } } - if(!$soap->__isfault()){ + if(!is_soap_fault($return)){ if ($soap_test->expect !== NULL) { $sent = $soap_test->expect; } else if (is_array($soap_test->method_params) && count($soap_test->method_params) == 1) { @@ -493,7 +491,7 @@ class Interop_Client ); } } else { - $fault = $soap->__getfault(); + $fault = $return; if ($soap_test->expect_fault) { $ok = 1; $res = 'OK'; diff --git a/ext/soap/interop/server_round2_base.php b/ext/soap/interop/server_round2_base.php index b059cd887f..50c98aa139 100644 --- a/ext/soap/interop/server_round2_base.php +++ b/ext/soap/interop/server_round2_base.php @@ -99,8 +99,7 @@ class SOAP_Interop_Base { } } -$server = new SoapServer("http://soapinterop.org/"); -$server->bind((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php"); +$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php"); $server->setClass("SOAP_Interop_Base"); $server->handle(); ?> \ No newline at end of file diff --git a/ext/soap/interop/server_round2_groupB.php b/ext/soap/interop/server_round2_groupB.php index 9501912008..a390a4c75a 100644 --- a/ext/soap/interop/server_round2_groupB.php +++ b/ext/soap/interop/server_round2_groupB.php @@ -52,8 +52,7 @@ class SOAP_Interop_GroupB { } } -$server = new SoapServer("http://soapinterop.org/"); -$server->bind((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php"); +$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php"); $server->setClass("SOAP_Interop_GroupB"); $server->handle(); ?> \ No newline at end of file diff --git a/ext/soap/interop/server_round2_groupC.php b/ext/soap/interop/server_round2_groupC.php index 5d5544b1db..539c9f4d6e 100644 --- a/ext/soap/interop/server_round2_groupC.php +++ b/ext/soap/interop/server_round2_groupC.php @@ -41,8 +41,7 @@ class SOAP_Interop_GroupC { } } -$server = new SoapServer("http://soapinterop.org/"); -$server->bind((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/echoheadersvc.wsdl.php"); +$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/echoheadersvc.wsdl.php"); $server->setClass("SOAP_Interop_GroupC"); $server->handle(); ?> \ No newline at end of file diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h index 5e82854ef2..4673d3ee0e 100644 --- a/ext/soap/php_encoding.h +++ b/ext/soap/php_encoding.h @@ -46,49 +46,49 @@ #define XSD_STRING 101 #define XSD_STRING_STRING "string" -#define XSD_BOOLEAN 103 +#define XSD_BOOLEAN 102 #define XSD_BOOLEAN_STRING "boolean" -#define XSD_DECIMAL 104 +#define XSD_DECIMAL 103 #define XSD_DECIMAL_STRING "decimal" -#define XSD_FLOAT 105 +#define XSD_FLOAT 104 #define XSD_FLOAT_STRING "float" -#define XSD_DOUBLE 106 +#define XSD_DOUBLE 105 #define XSD_DOUBLE_STRING "double" -#define XSD_DURATION 107 +#define XSD_DURATION 106 #define XSD_DURATION_STRING "duration" -#define XSD_DATETIME 108 +#define XSD_DATETIME 107 #define XSD_DATETIME_STRING "dateTime" -#define XSD_TIME 109 +#define XSD_TIME 108 #define XSD_TIME_STRING "time" -#define XSD_DATE 110 +#define XSD_DATE 109 #define XSD_DATE_STRING "date" -#define XSD_GYEARMONTH 111 +#define XSD_GYEARMONTH 110 #define XSD_GYEARMONTH_STRING "gYearMonth" -#define XSD_GYEAR 112 +#define XSD_GYEAR 111 #define XSD_GYEAR_STRING "gYear" -#define XSD_GMONTHDAY 113 +#define XSD_GMONTHDAY 112 #define XSD_GMONTHDAY_STRING "gMonthDay" -#define XSD_GDAY 114 +#define XSD_GDAY 113 #define XSD_GDAY_STRING "gDay" -#define XSD_GMONTH 115 +#define XSD_GMONTH 114 #define XSD_GMONTH_STRING "gMonth" -#define XSD_HEXBINARY 116 +#define XSD_HEXBINARY 115 #define XSD_HEXBINARY_STRING "hexBinary" -#define XSD_BASE64BINARY 117 +#define XSD_BASE64BINARY 116 #define XSD_BASE64BINARY_STRING "base64Binary" -#define XSD_ANYURI 118 +#define XSD_ANYURI 117 #define XSD_ANYURI_STRING "anyURI" -#define XSD_QNAME 119 +#define XSD_QNAME 118 #define XSD_QNAME_STRING "QName" -#define XSD_NOTATION 120 +#define XSD_NOTATION 119 #define XSD_NOTATION_STRING "NOTATION" -#define XSD_NORMALIZEDSTRING 121 +#define XSD_NORMALIZEDSTRING 120 #define XSD_NORMALIZEDSTRING_STRING "normalizedString" -#define XSD_TOKEN 122 +#define XSD_TOKEN 121 #define XSD_TOKEN_STRING "token" -#define XSD_LANGUAGE 123 +#define XSD_LANGUAGE 122 #define XSD_LANGUAGE_STRING "language" -#define XSD_NMTOKEN 124 +#define XSD_NMTOKEN 123 #define XSD_NMTOKEN_STRING "NMTOKEN" #define XSD_NAME 124 #define XSD_NAME_STRING "Name" @@ -98,44 +98,44 @@ #define XSD_ID_STRING "ID" #define XSD_IDREF 127 #define XSD_IDREF_STRING "IDREF" -#define XSD_IDREFS 127 +#define XSD_IDREFS 128 #define XSD_IDREFS_STRING "IDREFS" -#define XSD_ENTITY 128 +#define XSD_ENTITY 129 #define XSD_ENTITY_STRING "ENTITY" -#define XSD_ENTITIES 129 -#define XSD_ENTITIES_STRING "ENTITYS" -#define XSD_INTEGER 130 +#define XSD_ENTITIES 130 +#define XSD_ENTITIES_STRING "ENTITIES" +#define XSD_INTEGER 131 #define XSD_INTEGER_STRING "integer" -#define XSD_NONPOSITIVEINTEGER 131 +#define XSD_NONPOSITIVEINTEGER 132 #define XSD_NONPOSITIVEINTEGER_STRING "nonPositiveInteger" -#define XSD_NEGATIVEINTEGER 132 +#define XSD_NEGATIVEINTEGER 133 #define XSD_NEGATIVEINTEGER_STRING "negativeInteger" -#define XSD_LONG 133 +#define XSD_LONG 134 #define XSD_LONG_STRING "long" -#define XSD_INT 134 +#define XSD_INT 135 #define XSD_INT_STRING "int" -#define XSD_SHORT 135 +#define XSD_SHORT 136 #define XSD_SHORT_STRING "short" -#define XSD_BYTE 136 +#define XSD_BYTE 137 #define XSD_BYTE_STRING "byte" -#define XSD_NONNEGATIVEINTEGER 137 +#define XSD_NONNEGATIVEINTEGER 138 #define XSD_NONNEGATIVEINTEGER_STRING "nonNegativeInteger" -#define XSD_UNSIGNEDLONG 138 +#define XSD_UNSIGNEDLONG 139 #define XSD_UNSIGNEDLONG_STRING "unsignedLong" -#define XSD_UNSIGNEDINT 139 +#define XSD_UNSIGNEDINT 140 #define XSD_UNSIGNEDINT_STRING "unsignedInt" -#define XSD_UNSIGNEDSHORT 140 +#define XSD_UNSIGNEDSHORT 141 #define XSD_UNSIGNEDSHORT_STRING "unsignedShort" -#define XSD_UNSIGNEDBYTE 141 +#define XSD_UNSIGNEDBYTE 142 #define XSD_UNSIGNEDBYTE_STRING "unsignedByte" -#define XSD_POSITIVEINTEGER 142 +#define XSD_POSITIVEINTEGER 143 #define XSD_POSITIVEINTEGER_STRING "positiveInteger" -#define XSD_ANYTYPE 143 +#define XSD_NMTOKENS 144 +#define XSD_NMTOKENS_STRING "NMTOKENS" +#define XSD_ANYTYPE 145 #define XSD_ANYTYPE_STRING "anyType" -#define XSD_UR_TYPE 144 +#define XSD_UR_TYPE 146 #define XSD_UR_TYPE_STRING "ur-type" -#define XSD_NMTOKENS 145 -#define XSD_NMTOKENS_STRING "NMTOKENS" #define APACHE_NAMESPACE "http://xml.apache.org/xml-soap" #define APACHE_MAP 200 diff --git a/ext/soap/readme.html b/ext/soap/readme.html new file mode 100644 index 0000000000..e636cb09e2 --- /dev/null +++ b/ext/soap/readme.html @@ -0,0 +1,570 @@ + + +PHP SOAP Manual + + + + +

PHP SOAP

+

Introduction

+ + + +
Warning
This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk. +
+FIXME +
+

Requirements

+This extension makes use of the
GNOME XML library. Download and install this library. You will need at least libxml-2.5.4. +
+

Installation

+FIXME +
+

Predefined Constants

+The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ConstantValueDescription
SOAP_1_1 (integer)1SOAP version - SOAP 1.1. Can be used as an option in SoapClient and SoapServer constructors.
SOAP_1_2 (integer)2SOAP version - SOAP 1.2. Can be used as an option in SoapClient and SoapServer constructors.
SOAP_FUNCTIONS_ALL (integer)999Allows to export all defined functions with SoapClient::addFunction
SOAP_PERSISTENCE_SESSION (integer)1Allows making class passed to SoapServer::setClass persistent for a PHP session.
SOAP_PERSISTENCE_REQUEST (integer)2Allows making class passed to SoapServer::setClass non-persistent for a PHP session.
SOAP_ENCODED (integer)1Can be passed as style option to SoapClient constructor in nonWSDL mode.
SOAP_LITERAL (integer)2Can be passed as style option to SoapClient constructor in nonWSDL mode.
SOAP_RPC (integer)1Can be passed as use option to SoapClient constructor in nonWSDL mode.
SOAP_DOCUMENT (integer)2Can be passed as use option to SoapClient constructor in nonWSDL mode.
SOAP_ACTOR_NEXT (integer)1Can be passed as actor to SoapHeader constructor.
SOAP_ACTOR_NONE (integer)2Can be passed as actor to SoapHeader constructor
SOAP_ACTOR_UNLIMATERECEIVER (integer)3Can be passed as actor to SoapHeader constructor
UNKNOWN_TYPE (integer)999998Encoding for unknown type. Can be passed to SoapVar constructor.
XSD_STRING (integer)101Encoding for standard XMLSchema string type. Can be passed to SoapVar constructor.
XSD_BOOLEAN (integer)102Encoding for standard XMLSchema boolen type. Can be passed to SoapVar constructor.
XSD_DECIMAL (integer)103Encoding for standard XMLSchema decimal type. Can be passed to SoapVar constructor.
XSD_FLOAT (integer)104Encoding for standard XMLSchema float type. Can be passed to SoapVar constructor.
XSD_DOUBLE (integer)105Encoding for standard XMLSchema double type. Can be passed to SoapVar constructor.
XSD_DURATION (integer)106Encoding for standard XMLSchema duration type. Can be passed to SoapVar constructor.
XSD_DATETIME (integer)107Encoding for standard XMLSchema dateTime type. Can be passed to SoapVar constructor.
XSD_TIME (integer)108Encoding for standard XMLSchema time type. Can be passed to SoapVar constructor.
XSD_DATE (integer)109Encoding for standard XMLSchema data type. Can be passed to SoapVar constructor.
XSD_GYEARMONTH (integer)110Encoding for standard XMLSchema gYearMonth type. Can be passed to SoapVar constructor.
XSD_GYEAR (integer)111Encoding for standard XMLSchema gYear type. Can be passed to SoapVar constructor.
XSD_GMONTHDAY (integer)112Encoding for standard XMLSchema gMonthDay type. Can be passed to SoapVar constructor.
XSD_GDAY (integer)113Encoding for standard XMLSchema gDay type. Can be passed to SoapVar constructor.
XSD_GMONTH (integer)114Encoding for standard XMLSchema gMonth type. Can be passed to SoapVar constructor.
XSD_HEXBINARY (integer)115Encoding for standard XMLSchema hexBinary type. Can be passed to SoapVar constructor.
XSD_BASE64BINARY (integer)116Encoding for standard XMLSchema base64Binary type. Can be passed to SoapVar constructor.
XSD_ANYURI (integer)117Encoding for standard XMLSchema anyURI type. Can be passed to SoapVar constructor.
XSD_QNAME (integer)118Encoding for standard XMLSchema QName type. Can be passed to SoapVar constructor.
XSD_NOTATION (integer)119Encoding for standard XMLSchema NOTATION type. Can be passed to SoapVar constructor.
XSD_NORMALIZEDSTRING (integer)120Encoding for standard XMLSchema normalizedString type. Can be passed to SoapVar constructor.
XSD_TOKEN (integer)121Encoding for standard XMLSchema token type. Can be passed to SoapVar constructor.
XSD_LANGUAGE (integer)122Encoding for standard XMLSchema language type. Can be passed to SoapVar constructor.
XSD_NMTOKEN (integer)123Encoding for standard XMLSchema NMTOKEN type. Can be passed to SoapVar constructor.
XSD_NAME (integer)124Encoding for standard XMLSchema Name type. Can be passed to SoapVar constructor.
XSD_NCNAME (integer)125Encoding for standard XMLSchema NCName type. Can be passed to SoapVar constructor.
XSD_ID (integer)126Encoding for standard XMLSchema ID type. Can be passed to SoapVar constructor.
XSD_IDREF (integer)127Encoding for standard XMLSchema IDREF type. Can be passed to SoapVar constructor.
XSD_IDREFS (integer)128Encoding for standard XMLSchema IDREFS type. Can be passed to SoapVar constructor.
XSD_ENTITY (integer)129Encoding for standard XMLSchema ENTITY type. Can be passed to SoapVar constructor.
XSD_ENTITIES (integer)130Encoding for standard XMLSchema ENTITIES type. Can be passed to SoapVar constructor.
XSD_INTEGER (integer)131Encoding for standard XMLSchema integer type. Can be passed to SoapVar constructor.
XSD_NONPOSITIVEINTEGER (integer)132Encoding for standard XMLSchema nonPositiveInteger type. Can be passed to SoapVar constructor.
XSD_NEGATIVEINTEGER (integer)133Encoding for standard XMLSchema negativeInteger type. Can be passed to SoapVar constructor.
XSD_LONG (integer)134Encoding for standard XMLSchema long type. Can be passed to SoapVar constructor.
XSD_INT (integer)135Encoding for standard XMLSchema int type. Can be passed to SoapVar constructor.
XSD_SHORT (integer)136Encoding for standard XMLSchema short type. Can be passed to SoapVar constructor.
XSD_BYTE (integer)137Encoding for standard XMLSchema byte type. Can be passed to SoapVar constructor.
XSD_NONNEGATIVEINTEGER (integer)138Encoding for standard XMLSchema nonNegativeInteger type. Can be passed to SoapVar constructor.
XSD_UNSIGNEDLONG (integer)139Encoding for standard XMLSchema unsignedLong type. Can be passed to SoapVar constructor.
XSD_UNSIGNEDINT (integer)140Encoding for standard XMLSchema unsignedInt type. Can be passed to SoapVar constructor.
XSD_UNSIGNEDSHORT (integer)141Encoding for standard XMLSchema unsignedShort type. Can be passed to SoapVar constructor.
XSD_UNSIGNEDBYTE (integer)142Encoding for standard XMLSchema unsignedByte type. Can be passed to SoapVar constructor.
XSD_POSITIVEINTEGER (integer)143Encoding for standard XMLSchema positiveInteger type. Can be passed to SoapVar constructor.
XSD_NMTOKENS (integer)144Encoding for standard XMLSchema NMTOKENS type. Can be passed to SoapVar constructor.
XSD_ANYTYPE (integer)145Encoding for standard XMLSchema anyType type. Can be passed to SoapVar constructor.
SOAP_ENC_ARRAY (integer)300Encoding for SOAP Array type. Can be passed to SoapVar constructor.
SOAP_ENC_OBJECT (integer)301Encoding for SOAP Struct type. Can be passed to SoapVar constructor.
XSD_1999_TIMEINSTANT (integer)401Encoding for old XMLSchema timeInstant type. Can be passed to SoapVar constructor.
XSD_NAMESPACE (string) The XML Schema namespace.
XSD_1999_NAMESPACE (string) The old XML Schema namespace.
+
+

Classes

+

List of classes

+ + + + + + +
SoapClient
SoapServer
SoapParam
SoapVar
SoapHeader
+ +

SoapClient class

+A SOAP client, that allows calling remote methods on SOAP WebService over HTTP +or HTTPS. + + + + + + + +
SoapClient -- SoapClient constructor
__call -- calls a SOAP function
__getLastRequest -- returns last SOAP request
__getLastResponse -- returns last SOAP response
__getFunctions -- returns list of SOAP functions
__getTypes -- returns list of SOAP types
+
+

SoapServer class

+This class can be used to build SOAP WebServices, which can be accessed from +remote SOAP clients over HTTP or HTTPS. + + + + + + + + +
SoapServer -- SoapServer constructor
addFunction -- adds one or several functions those will handle SOAP requests
setClass -- sets class which will handle SOAP requests
getFunctions -- returns list of defined functions
setPersistence -- sets persistence mode of SoapServer
handle -- handles a SOAP request
fault -- generates SOAP fault response
+
+

SoapParam class

+

+SoapParam is a special low-level class for naming parameters and return values +in nonWSDL mode. It is just a data holder and it has not any special method +except constructor. +

+ + +
SoapParam -- SoapParam constructor
+
+

SoapVar classes

+

+SoapVar is a special low-level class for encoding parameters and return values +in nonWSDL mode. It is just a data holder and it has not any special method +except constructor. It is useful when you like to set type property in SOAP +request or response. +

+ + +
SoapVar -- SoapVar constructor
+
+

SoapHeader class

+

+SoapHeader is a special low-level class for passing or returning SOAP headers. +It is just a data holder and it has not any special method except constructor. +

+ + +
SoapHeader -- SoapHeader constructor
+
+ +

Table of Contents

+ + + + + + + + + + + + + + + + + + +
is_sopa_fault -- checks if SOAP call was failed
SoapClient::SoapClient -- SoapClient constructor
SoapClient::__call -- calls a SOAP function
SoapClient::__getLastRequest -- returns last SOAP request
SoapClient::__getLastResponse -- returns last SOAP response
SoapClient::__getFunctions -- returns list of SOAP functions
SoapClient::__getTypes -- returns list of SOAP types
SoapServer::SoapServer -- SoapServer constructor
SoapServer::addFunction -- adds one or several functions those will handle SOAP requests
SoapServer::setClass -- sets class which will handle SOAP requests
SoapServer::getFunctions -- returns list of defined functions
SoapServer::setPersistence -- sets persistence mode of SoapServer
SoapServer::handle -- handles a SOAP request
SoapServer::fault -- generates SOAP fault response
SoapParam::SoapParam -- SoapParam constructor
SoapVar::SoapVar -- SoapVar constructor
SoapHeader::SoapHeader -- SoapHeader constructor
+ +
+

is_sopa_fault

+

(PHP 5)

+

checks if SOAP call was failed

+

Description

+

bool is_soap_fault(mixed obj)

+

+This function is useful when you like to check if the SOAP call was failed. +In this case SOAP method returns a special SoapFault object which encapsulate +the fault details (faultcode, faultstring, faultactor and faultdetails). +is_soap_fault() functions checks if the given parameter is a SoapFault object. +

+

Example

+
+<?php
+    $client = SoapClient("some.wsdl");
+    $result = $client->SomeFunction(...);
+    if (is_soap_fault($result)) {
+        trigger_error("SOAP Fault: (faultcode: {$result->faultcode}, faultstring: {$result->faulstring})", E_ERROR);
+    }
+?>
+ + +

SoapClient::SoapClient

+

(PHP 5)

+

SoapClient constructor

+

Description

+

SoapClient(mixed wsdl [, array options])

+

Examples

+

+The constructor allows creating SoapClient objects in WSDL or nonWSDL mode. +The first case requires URI of WSDL file as first parameter and optional +options array. The second case requires NULL as first parameter and options +array with location and uri options set. Where location is +a URL to request and uri is a target namespace of the SOAP service. +style and use options has effect only on nonWSDL (in WSDL mode +they comes from WSDL file). soap_version option allows to work as SOAP 1.1 or +SOAP 1.2 client. +Some additional optional options allow using HTTP authentication (login +and password) and HTTP connection through proxy server (proxy_host, +proxy_port, proxy_login and proxy_password). +

+
+    $client = new SoapClient("some.wsdl");
+
+    $client = new SoapClient("some.wsdl",array('soap_version'   => SOAP_1_2));
+
+    $client = new SoapClient("some.wsdl",array('login'          => "some_name",
+                                               'password'       => "some_password"));
+
+    $client = new SoapClient("some.wsdl",array('proxy_host'     => "localhost",
+                                               'proxy_port'     => 8080));
+
+    $client = new SoapClient("some.wsdl",array('proxy_host'     => "localhost",
+                                               'proxy_port'     => 8080,
+                                               'proxy_login'    => "some_name",
+                                               'proxy_password' => "some_password"));
+
+    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
+                                        'uri'      => "http://test-uri/"));
+
+    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
+                                        'uri'      => "http://test-uri/",
+                                        'style'    => SOAP_DOCUMENT,
+                                        'use'      => SOAP_LITERAL));
+
+ + +

SoapClient::__call

+

(PHP 5)

+

calls a SOAP function

+

Description

+

mixed __call(string function_name, array arguments, [array options [, mixed input_headers [, mixed &output_headers]]])

+

+This is a low level API function to make a SOAP call. Usually in WSDL mode +you can simple call SOAP functions as SoapClient methods. It is useful for +nonWSDL mode when 'soapaction' is unknown, 'uri' is differ form default or +when ypu like to send and/or receive SOAP Headers. To check if function call +is failed check the result with is_soap_fault() function. +

+

Examples

+
+    $client = new SoapClient("some.wsdl");
+    $client->SomeFunction($a,$b,$c);
+    $client->__call("SomeFunction",array($a,$b,$c));
+    $client->__call("SomeFunction",array($a,$b,$c), NULL,
+                    new SoapHeader(...), $output_headers);
+
+
+    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
+                                        'uri'      => "http://test-uri/"));
+    $client->SomeFunction($a,$b,$c);
+    $client->__call("SomeFunction",array($a,$b,$c));
+    $client->__call("SomeFunction",array($a,$b,$c),
+                    array('soapaction' => 'some_action',
+                          'uri'        => 'some_uri'));
+
+ + +

SoapClient::__getLastRequest

+

(PHP 5)

+

returns last SOAP request

+

Description

+

string __getLastRequest()

+

+This function works only with SoapClient which was created with trace option. +

+

Example

+
+<?php
+    $client = SoapClient("some.wsdl", array('trace'=>1));
+    $result = $client->SomeFunction(...);
+    echo "REQUEST:\n".$client->__getLastRequest()."\n";
+?>
+
+ + +

SoapClient::__getLastResponse

+

(PHP 5)

+

returns last SOAP response

+

Description

+

string __getLastResponse()

+

+This function works only with SoapClient which was created with trace option. +

+

Example

+
+<?php
+    $client = SoapClient("some.wsdl", array('trace'=>1));
+    $result = $client->SomeFunction(...);
+    echo "RESPONSE:\n".$client->__getLastResponse()."\n";
+?>
+
+ + +

SoapClient::__getFunctions

+

(PHP 5)

+

returns list of SOAP functions

+

Description

+

array __getFunctions()

+

+This function works only in WSDL mode. +

+

Example

+
+<?php
+    $client = SoapClient("some.wsdl");
+    var_dump($client->__getFunctions());
+?>
+
+ + +

SoapClient::__getTypes

+

(PHP 5)

+

returns list of SOAP types

+

Description

+

array __getTypes()

+

+This function works only in WSDL mode. +

+

Example

+
+<?php
+    $client = SoapClient("some.wsdl");
+    var_dump($client->__getTypes());
+?>
+
+ + +

SoapServer::SoapServer

+

(PHP 5)

+

SoapServer constructor

+

Description

+

SoapServer(mixed wsdl [, array options])

+It allows creating SoapServer objects in WSDL or nonWSDL mode. In the first +case wsdl must be set to URI of WSDL file. In the second wsdl +must be set to null and uti option must be set. Additional options +allow setting a default SOAP version (soap_version) and actor URI +(actor). + +

Examples

+
+    $server = new SoapServer("some.wsdl");
+
+    $server = new SoapServer("some.wsdl",array('soap_version'=>SOAP_1_2));
+
+    $server = new SoapServer("some.wsdl",array('actor'=>"http://example.org/ts-tests/C"));
+
+    $server = new SoapServer(null,array('uri'=>"http://test-uri/"));
+
+ + +

SoapServer::addFunction

+

(PHP 5)

+

adds one or several functions those will handle SOAP requests

+

Description

+

void addFunction(mixed functions)

+Exports one or more functions for remote clients. To export one function pass +function name into functions parameter as string. To export several +functions pass an array of function names and to export all functions pass +a special constant SOAP_FUNCTIONS_ALL. +

Examples

+
+    $server->addFunction("func");
+
+    $server->addFunction(array("func1","func2"));
+
+    $server->addFunction(SOAP_FUNCTIONS_ALL);
+
+ +
+

SoapServer::setClass

+

(PHP 5)

+

sets class which will handle SOAP requests

+

Description

+

void setClass(string class_name [, ...])

+Exports all methods from specified class. Additional parameters will be passed +to default class constructor during object creation. The object can be maiden +persistent across request for a given PHP session with +SoapServer::setPersistence method. +

Examples

+
+    $server->setClass("foo");
+
+    $server->setClass("foo", $arg1, $arg2);
+
+ + +

SoapServer::getFunctions

+

(PHP 5)

+

returns list of defined functions

+

Description

+

array getFunctions()

+ +
+

SoapServer::setPersistence

+

(PHP 5)

+

sets persistence mode of SoapServer

+

Description

+

void setPersistence(int mode)

+This function allows saving data between requests in PHP session. It works only +with server that exports functions form class (see +SoapServer:setCalss). +

Examples

+
+    $server->setpersistence(SOAP_PERSISTENCE_SESSION);
+
+    $server->setpersistence(SOAP_PERSISTENCE_REQUEST);
+
+ + +

SoapServer::handle

+

(PHP 5)

+

handles a SOAP request

+

Description

+

void handle()

+It processes a SOAP request, call necessary functions, and send response back. +It assumes request in global $HTTP_RAW_POST_DATA PHP variable. +

Example

+
+<?php
+    function test($x) {
+        return $x;
+    }
+
+    $server = new SoapServer(null,array('uri'=>"http://test-uri/"));
+    $server->addFunction("test");
+    $server->handle();
+?>
+
+ + +

SoapServer::fault

+

(PHP 5)

+

generates SOAP fault response

+

Description

+

void fault(string faultcode, string faultstring [, string faultactor [, mixed details]])

+This function is useful when you like to send SOAP fault response from PHP handler. +It never returns. +

Example

+
+<?php
+    function test($x) {
+        global $server;
+        $server->fault("Server","Some error message");
+    }
+
+    $server = new SoapServer(null,array('uri'=>"http://test-uri/"));
+    $server->addFunction("test");
+    $server->handle();
+?>
+
+ + +

SoapParam::SoapParam

+

(PHP 5)

+

SoapParam constructor

+

Description

+

SoapParam(mixed data, string name)

+

+SoapParam is a special low-level class for naming parameters and return values +in nonWSDL mode. It is just a data holder and it has not any special method +except constructor. The constructor takes data to pass or return and +name. It is possible to pass parameter directly as PHP value, but in +this case it will be named as paramN and SOAP Service may not +understand it. +

+

Example

+
+<?php
+    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
+                                        'uri'      => "http://test-uri/"));
+    $client->SomeFunction(new SoapParam($a,"a"),
+                          new SoapParam($b,"b"),
+                          new SoapParam($c,"c"));
+?>
+
+ + +

SoapVar::SoapVar

+

(PHP 5)

+

SoapVar constructor

+

Description

+

SoapVar(mixed data, int encoding [, string type [, string type_ns [, string name [, string name_ns]]]])

+

+SoapVar is a special low-level class for encoding parameters and return values +in nonWSDL mode. It is just a data holder and it has not any special method +except constructor. It is useful when you like to set type property in SOAP +request or response. The constructor takes data to pass or return, +encoding ID to encode it (see XSD_... constants) and as +option type name and namespace and value name and namespace. +

+

Example

+
+<?php
+    class SOAPStruct {
+    	function SOAPStruct($s, $i, $f) {
+    		$this->varString = $s;
+    		$this->varInt = $i;
+    		$this->varFloat = $f;
+    	}
+    }
+    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
+                                        'uri'      => "http://test-uri/"));
+    $struct = new SOAPStruct('arg',34,325.325);
+    $soapstruct = new SoapVar($struct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
+    $client->echoStruct(new SoapParam($soapstruct, "inputStruct"));
+?>
+
+ + +

SoapHeader::SoapHeader

+

(PHP 5)

+

SoapHeader constructor

+

Description

+

SoapHeader(string name_ns, string name [, mixed data [, bool must_understand [, mixed actor]]])

+

+SoapHeader is a special low-level class for passing or returning SOAP headers. +It is just a data holder and it has not any special method except constructor. +It can be used in SoapClient::__call +method to pass SOAP header or in SOAP header handler to return header in SOAP +response. name_ns and name are namespace and name of the SOAP +header element. data is a SOAP header's content. It can be a PHP value +or SoapVar object. must_understand and actor are values for +mustUnderstand and actor attributes of this SOAP +Header element. +

+

Example

+
+<?php
+    $client = new SoapClient(null,array('location' => "http://localhost/soap.php",
+                                        'uri'      => "http://test-uri/"));
+    $client->__call("echoVoid",NULL,NULL,
+                    new SoapHeader('http://soapinterop.org/echoheader/',
+                                   'echoMeStringRequest',
+                                   'hello world'));
+?>
+
+ + \ No newline at end of file diff --git a/ext/soap/soap.c b/ext/soap/soap.c index d9bf00e909..7e8cf86f0c 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -108,16 +108,16 @@ static void soap_error_handler(int error_num, const char *error_filename, const static zend_class_entry* soap_class_entry; static zend_class_entry* soap_server_class_entry; static zend_class_entry* soap_fault_class_entry; +static zend_class_entry* soap_header_class_entry; +static zend_class_entry* soap_param_class_entry; zend_class_entry* soap_var_class_entry; -zend_class_entry* soap_param_class_entry; -zend_class_entry* soap_header_class_entry; ZEND_DECLARE_MODULE_GLOBALS(soap) static void (*old_error_handler)(int, const char *, const uint, const char*, va_list); #define PHP_SOAP_SERVER_CLASSNAME "soapserver" -#define PHP_SOAP_CLASSNAME "soapobject" +#define PHP_SOAP_CLIENT_CLASSNAME "soapclient" #define PHP_SOAP_VAR_CLASSNAME "soapvar" #define PHP_SOAP_FAULT_CLASSNAME "soapfault" #define PHP_SOAP_PARAM_CLASSNAME "soapparam" @@ -155,6 +155,7 @@ static char *zend_str_tolower_copy(char *dest, const char *source, unsigned int PHP_FUNCTION(soap_encode_to_xml); PHP_FUNCTION(soap_encode_to_zval); PHP_FUNCTION(use_soap_error_handler); +PHP_FUNCTION(is_soap_fault); /* Server Functions */ @@ -164,24 +165,18 @@ PHP_METHOD(soapserver,addfunction); PHP_METHOD(soapserver,getfunctions); PHP_METHOD(soapserver,handle); PHP_METHOD(soapserver,setpersistence); -PHP_METHOD(soapserver,bind); PHP_METHOD(soapserver,fault); #ifdef HAVE_PHP_DOMXML PHP_METHOD(soapserver,map); #endif /* Client Functions */ -PHP_METHOD(soapobject, soapobject); -PHP_METHOD(soapobject, __login); -PHP_METHOD(soapobject, __useproxy); -PHP_METHOD(soapobject, __isfault); -PHP_METHOD(soapobject, __getfault); -PHP_METHOD(soapobject, __call); -PHP_METHOD(soapobject, __getfunctions); -PHP_METHOD(soapobject, __gettypes); -PHP_METHOD(soapobject, __trace); -PHP_METHOD(soapobject, __getlastresponse); -PHP_METHOD(soapobject, __getlastrequest); +PHP_METHOD(soapclient, soapclient); +PHP_METHOD(soapclient, __call); +PHP_METHOD(soapclient, __getlastrequest); +PHP_METHOD(soapclient, __getlastresponse); +PHP_METHOD(soapclient, __getfunctions); +PHP_METHOD(soapclient, __gettypes); /* SoapVar Functions */ PHP_METHOD(soapvar, soapvar); @@ -201,6 +196,7 @@ static zend_function_entry soap_functions[] = { PHP_FE(soap_encode_to_zval, NULL) #endif PHP_FE(use_soap_error_handler, NULL) + PHP_FE(is_soap_fault, NULL) {NULL, NULL, NULL} }; @@ -216,7 +212,6 @@ static zend_function_entry soap_server_functions[] = { PHP_ME(soapserver, addfunction, NULL, 0) PHP_ME(soapserver, getfunctions, NULL, 0) PHP_ME(soapserver, handle, NULL, 0) - PHP_ME(soapserver, bind, NULL, 0) PHP_ME(soapserver, fault, NULL, 0) #ifdef HAVE_PHP_DOMXML PHP_ME(soapserver, map, NULL, 0) @@ -230,25 +225,19 @@ ZEND_BEGIN_ARG_INFO(__call_args, 0) ZEND_ARG_PASS_INFO(0) ZEND_ARG_PASS_INFO(0) ZEND_ARG_PASS_INFO(0) - ZEND_ARG_PASS_INFO(0) ZEND_ARG_PASS_INFO(1) ZEND_END_ARG_INFO() #else -unsigned char __call_args[] = { 6, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; +unsigned char __call_args[] = { 5, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; #endif static zend_function_entry soap_client_functions[] = { - PHP_ME(soapobject, soapobject, NULL, 0) - PHP_ME(soapobject, __login, NULL, 0) - PHP_ME(soapobject, __useproxy, NULL, 0) - PHP_ME(soapobject, __isfault, NULL, 0) - PHP_ME(soapobject, __getfault, NULL, 0) - PHP_ME(soapobject, __call, __call_args, 0) - PHP_ME(soapobject, __trace, NULL, 0) - PHP_ME(soapobject, __getlastrequest, NULL, 0) - PHP_ME(soapobject, __getlastresponse, NULL, 0) - PHP_ME(soapobject, __getfunctions, NULL, 0) - PHP_ME(soapobject, __gettypes, NULL, 0) + PHP_ME(soapclient, soapclient, NULL, 0) + PHP_ME(soapclient, __call, __call_args, 0) + PHP_ME(soapclient, __getlastrequest, NULL, 0) + PHP_ME(soapclient, __getlastresponse, NULL, 0) + PHP_ME(soapclient, __getfunctions, NULL, 0) + PHP_ME(soapclient, __gettypes, NULL, 0) {NULL, NULL, NULL} }; @@ -372,7 +361,7 @@ PHP_MINIT_FUNCTION(soap) xmlRegisterInputCallbacks(php_stream_xmlIO_match_wrapper, php_stream_xmlIO_open_wrapper, php_stream_xmlIO_read, php_stream_xmlIO_close); - /* Register SoapObject class */ + /* Register SoapClient class */ /* BIG NOTE : THIS EMITS AN COMPILATION WARNING UNDER ZE2 - handle_function_call deprecated. soap_call_function_handler should be of type struct _zend_function, not (*handle_function_call). */ @@ -381,7 +370,7 @@ PHP_MINIT_FUNCTION(soap) zend_internal_function fe; fe.type = ZEND_INTERNAL_FUNCTION; - fe.handler = zif_soapobject___call; + fe.handler = zif_soapclient___call; fe.function_name = NULL; fe.scope = NULL; fe.fn_flags = 0; @@ -390,12 +379,12 @@ PHP_MINIT_FUNCTION(soap) fe.arg_info = NULL; fe.pass_rest_by_reference = 0; - INIT_OVERLOADED_CLASS_ENTRY(ce, PHP_SOAP_CLASSNAME, soap_client_functions, + INIT_OVERLOADED_CLASS_ENTRY(ce, PHP_SOAP_CLIENT_CLASSNAME, soap_client_functions, (zend_function *)&fe, NULL, NULL); soap_class_entry = zend_register_internal_class(&ce TSRMLS_CC); } #else - INIT_OVERLOADED_CLASS_ENTRY(ce, PHP_SOAP_CLASSNAME, soap_client_functions, soap_call_function_handler, NULL, NULL); + INIT_OVERLOADED_CLASS_ENTRY(ce, PHP_SOAP_CLIENT_CLASSNAME, soap_client_functions, soap_call_function_handler, NULL, NULL); soap_class_entry = zend_register_internal_class(&ce TSRMLS_CC); #endif @@ -435,19 +424,12 @@ PHP_MINIT_FUNCTION(soap) REGISTER_LONG_CONSTANT("SOAP_RPC", SOAP_RPC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SOAP_DOCUMENT", SOAP_DOCUMENT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_1999_TIMEINSTANT", XSD_1999_TIMEINSTANT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_ACTOR_NEXT", SOAP_ACTOR_NEXT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SOAP_ACTOR_NONE", SOAP_ACTOR_NONE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SOAP_ACTOR_UNLIMATERECEIVER", SOAP_ACTOR_UNLIMATERECEIVER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("UNKNOWN_TYPE", UNKNOWN_TYPE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_ENC_OBJECT", SOAP_ENC_OBJECT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("SOAP_ENC_ARRAY", SOAP_ENC_ARRAY, CONST_CS | CONST_PERSISTENT); - - REGISTER_STRING_CONSTANT("XSD_NAMESPACE", XSD_NAMESPACE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("XSD_ANYTYPE", XSD_ANYTYPE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("XSD_STRING", XSD_STRING, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("XSD_BOOLEAN", XSD_BOOLEAN, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("XSD_DECIMAL", XSD_DECIMAL, CONST_CS | CONST_PERSISTENT); @@ -491,6 +473,16 @@ PHP_MINIT_FUNCTION(soap) REGISTER_LONG_CONSTANT("XSD_UNSIGNEDSHORT", XSD_UNSIGNEDSHORT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("XSD_UNSIGNEDBYTE", XSD_UNSIGNEDBYTE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("XSD_POSITIVEINTEGER", XSD_POSITIVEINTEGER, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XSD_NMTOKENS", XSD_NMTOKENS, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("XSD_ANYTYPE", XSD_ANYTYPE, CONST_CS | CONST_PERSISTENT); + + REGISTER_LONG_CONSTANT("SOAP_ENC_OBJECT", SOAP_ENC_OBJECT, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SOAP_ENC_ARRAY", SOAP_ENC_ARRAY, CONST_CS | CONST_PERSISTENT); + + REGISTER_LONG_CONSTANT("XSD_1999_TIMEINSTANT", XSD_1999_TIMEINSTANT, CONST_CS | CONST_PERSISTENT); + + REGISTER_STRING_CONSTANT("XSD_NAMESPACE", XSD_NAMESPACE, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("XSD_1999_NAMESPACE", XSD_1999_NAMESPACE, CONST_CS | CONST_PERSISTENT); old_error_handler = zend_error_cb; zend_error_cb = soap_error_handler; @@ -587,7 +579,6 @@ PHP_METHOD(soapheader,soapheader) } add_property_bool(this_ptr, "mustUnderstand", must_understand); if (actor == NULL) { - add_property_long(this_ptr, "actor", SOAP_ACTOR_NEXT); } else if (Z_TYPE_P(actor) == IS_LONG) { add_property_long(this_ptr, "actor", Z_LVAL_P(actor)); } else if (Z_TYPE_P(actor) == IS_STRING) { @@ -660,29 +651,71 @@ PHP_METHOD(soapvar,soapvar) PHP_METHOD(soapserver,soapserver) { soapServicePtr service; - char *uri, *actor = NULL; - int ret, uri_len, actor_len; - long version = SOAP_1_1; + zval *wsdl, *options = NULL; + int ret; + int version = SOAP_1_1; SOAP_SERVER_BEGIN_CODE(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &uri, &uri_len, &version, &actor, &actor_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) { + php_error(E_ERROR, "Invalid arguments to SoapServer constructor"); + } + + if (Z_TYPE_P(wsdl) == IS_STRING) { + } else if (Z_TYPE_P(wsdl) == IS_NULL) { + wsdl = NULL; + } else { php_error(E_ERROR, "Invalid arguments to SoapServer constructor"); } service = emalloc(sizeof(soapService)); memset(service, 0, sizeof(soapService)); - service->version = version; - service->uri = estrndup(uri, uri_len); - if (actor) { - service->actor = estrndup(actor, actor_len); + if (options != NULL) { + HashTable *ht = Z_ARRVAL_P(options); + zval **tmp; + + if (zend_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) { + if (Z_TYPE_PP(tmp) == IS_LONG || + (Z_LVAL_PP(tmp) == SOAP_1_1 && Z_LVAL_PP(tmp) == SOAP_1_2)) { + version = Z_LVAL_PP(tmp); + } + } + + if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + service->uri = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + } else if (wsdl == NULL) { + php_error(E_ERROR, "Invalid arguments to SoapServer constructor. 'uri' option is required in nonWSDL mode."); + return; + } + + if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + service->actor = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + } + } else if (wsdl == NULL) { + php_error(E_ERROR, "Invalid arguments to SoapServer constructor. 'uri' option is required in nonWSDL mode."); } + + service->version = version; service->type = SOAP_FUNCTIONS; service->soap_functions.functions_all = FALSE; service->soap_functions.ft = emalloc(sizeof(HashTable)); zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0); + if (wsdl) { + service->sdl = get_sdl(Z_STRVAL_P(wsdl)); + if (service->uri == NULL) { + if (service->sdl->target_ns) { + service->uri = estrdup(service->sdl->target_ns); + } else { + /*FIXME*/ + service->uri = estrdup("http://unknown-uri/"); + } + } + } + ret = zend_list_insert(service, le_service); add_property_resource(this_ptr, "service", ret); zend_list_addref(ret); @@ -810,24 +843,6 @@ PHP_FUNCTION(SoapServer,map) } #endif -PHP_METHOD(soapserver,bind) -{ - char *wsdl; - int wsdl_len; - soapServicePtr service; - - SOAP_SERVER_BEGIN_CODE(); - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &wsdl, &wsdl_len) == FAILURE) { - php_error(E_ERROR, "Wrong number of parameters to SoapServer->bind"); - } - - FETCH_THIS_SERVICE(service); - service->sdl = get_sdl(wsdl); - - SOAP_SERVER_END_CODE(); -} - PHP_METHOD(soapserver,setpersistence) { soapServicePtr service; @@ -1441,82 +1456,134 @@ PHP_FUNCTION(use_soap_error_handler) } } +PHP_FUNCTION(is_soap_fault) +{ + zval *fault; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &fault) == SUCCESS && + Z_TYPE_P(fault) == IS_OBJECT && + Z_OBJCE_P(fault) == soap_fault_class_entry) { + RETURN_TRUE; + } + RETURN_FALSE +} -/* SoapObject functions */ +/* SoapClient functions */ /* - SoapObject($wsdl, $version=SOAP_1_1) - SoapObject($location, $uri, $style=SOAP_RPC, $use=SOAP_ENCODED, $version=SOAP_1_1) + SoapClient($wsdl, $options=array()) */ -PHP_METHOD(soapobject, soapobject) +PHP_METHOD(soapclient, soapclient) { - char *location; - int location_len; - zval *arg2 = NULL; - long use = SOAP_RPC; - long style = SOAP_ENCODED; - long version = SOAP_1_1; - long old_soap_version ; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zlll", &location, &location_len, &arg2, &style, &use, &version) == SUCCESS) { - if (arg2 == NULL || Z_TYPE_P(arg2) == IS_LONG) { - /* SoapObject($wsdl, $version=SOAP_1_1) */ - sdlPtr sdl; - int ret; - - if (arg2 != NULL) { - version = Z_LVAL_P(arg2); - } - if (version == SOAP_1_1 || version == SOAP_1_2) { - add_property_long(this_ptr, "_soap_version", version); - } else { - php_error(E_ERROR,"Can't create SoapObject. Wrong 'version' parameter."); - } - old_soap_version = SOAP_GLOBAL(soap_version); - SOAP_GLOBAL(soap_version) = version; - sdl = get_sdl(location); - ret = zend_list_insert(sdl, le_sdl); + zval *wsdl; + zval *options = NULL; + int soap_version = SOAP_1_1; - add_property_resource(this_ptr, "sdl", ret); - zend_list_addref(ret); + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|a", &wsdl, &options) == FAILURE) { + php_error(E_ERROR, "Can't create SoapClient. Invalid parameters."); + return; + } - SOAP_GLOBAL(soap_version) = old_soap_version; + if (Z_TYPE_P(wsdl) == IS_STRING) { + } else if (Z_TYPE_P(wsdl) != IS_NULL ) { + php_error(E_ERROR, "Can't create SoapClient. $wsdl must be string or null."); + return; + } else { + wsdl = NULL; + } + if (options != NULL) { + HashTable *ht = Z_ARRVAL_P(options); + zval **tmp; - } else if (arg2 != NULL && Z_TYPE_P(arg2) == IS_STRING) { - /* SoapObject($location, $uri, $style=SOAP_RPC, $use=SOAP_ENCODED, $version=SOAP_1_1) */ - add_property_stringl(this_ptr, "location", location, location_len, 1); - add_property_stringl(this_ptr, "uri", Z_STRVAL_P(arg2), Z_STRLEN_P(arg2), 1); - if (style == SOAP_RPC || style == SOAP_DOCUMENT) { - add_property_long(this_ptr, "style", style); + if (wsdl == NULL) { + /* Fetching non-WSDL mode options */ + if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + add_property_stringl(this_ptr, "location", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); } else { - php_error(E_ERROR,"Can't create SoapObject. Wrong 'style' parameter."); + php_error(E_ERROR, "Can't create SoapClient. 'location' option is requred in nonWSDL mode."); + return; } - if (use == SOAP_ENCODED || use == SOAP_LITERAL) { - add_property_long(this_ptr, "use", use); + + if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + add_property_stringl(this_ptr, "uri", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); } else { - php_error(E_ERROR,"Can't create SoapObject. Wrong 'use' parameter."); + php_error(E_ERROR, "Can't create SoapClient. 'uri' option is requred in nonWSDL mode."); + return; } - if (version == SOAP_1_1 || version == SOAP_1_2) { - add_property_long(this_ptr, "_soap_version", version); - } else { - php_error(E_ERROR,"Can't create SoapObject. Wrong 'version' parameter."); + + if (zend_hash_find(ht, "style", sizeof("style"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_LONG && + (Z_LVAL_PP(tmp) == SOAP_RPC || Z_LVAL_PP(tmp) == SOAP_DOCUMENT)) { + add_property_long(this_ptr, "style", Z_LVAL_PP(tmp)); } - } else { - php_error(E_ERROR,"Can't create SoapObject. Wrong parameters."); + + if (zend_hash_find(ht, "use", sizeof("use"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_LONG && + (Z_LVAL_PP(tmp) == SOAP_LITERAL || Z_LVAL_PP(tmp) == SOAP_ENCODED)) { + add_property_long(this_ptr, "use", Z_LVAL_PP(tmp)); + } + } + + if (zend_hash_find(ht, "soap_version", sizeof("soap_version"), (void**)&tmp) == SUCCESS) { + if (Z_TYPE_PP(tmp) == IS_LONG || + (Z_LVAL_PP(tmp) == SOAP_1_1 && Z_LVAL_PP(tmp) == SOAP_1_2)) { + soap_version = Z_LVAL_PP(tmp); + } + } + if (zend_hash_find(ht, "login", sizeof("login"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + add_property_stringl(this_ptr, "_login", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + if (zend_hash_find(ht, "password", sizeof("password"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + add_property_stringl(this_ptr, "_password", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + } + } + if (zend_hash_find(ht, "proxy_host", sizeof("proxy_host"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + add_property_stringl(this_ptr, "_proxy_host", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + if (zend_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_LONG) { + add_property_long(this_ptr, "_proxy_port", Z_LVAL_PP(tmp)); + } + if (zend_hash_find(ht, "proxy_login", sizeof("proxy_login"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + add_property_stringl(this_ptr, "_proxy_login", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + if (zend_hash_find(ht, "proxy_password", sizeof("proxy_password"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + add_property_stringl(this_ptr, "_proxy_password", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); + } + } + } + if (zend_hash_find(ht, "trace", sizeof("trace"), (void**)&tmp) == SUCCESS && + (Z_TYPE_PP(tmp) == IS_BOOL || Z_TYPE_PP(tmp) == IS_LONG) && + Z_LVAL_PP(tmp) == 1) { + add_property_long(this_ptr, "trace", 1); } + } else if (wsdl == NULL) { + php_error(E_ERROR, "Can't create SoapClient. 'location' and 'uri' options are requred in nonWSDL mode."); + return; } -} -PHP_METHOD(soapobject, __trace) -{ - int level; + add_property_long(this_ptr, "_soap_version", soap_version); + + if (wsdl) { + int old_soap_version, ret; + sdlPtr sdl; + + old_soap_version = SOAP_GLOBAL(soap_version); + SOAP_GLOBAL(soap_version) = soap_version; + + sdl = get_sdl(Z_STRVAL_P(wsdl)); + ret = zend_list_insert(sdl, le_sdl); + + add_property_resource(this_ptr, "sdl", ret); + zend_list_addref(ret); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &level)) { - php_error(E_ERROR, "Invalid arguments to SoapObject->__trace"); + SOAP_GLOBAL(soap_version) = old_soap_version; } - add_property_long(this_ptr, "trace", level); - RETURN_TRUE; } static void do_soap_call(zval* thisObj, @@ -1661,52 +1728,12 @@ zend_try { SOAP_GLOBAL(sdl) = old_sdl; } -PHP_METHOD(soapobject, __login) -{ - char *login_name; - char *login_pass; - int login_name_len; - int login_pass_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", - &login_name, &login_name_len, &login_pass, &login_pass_len) == FAILURE) { - return; - } - add_property_stringl(this_ptr,"_login",login_name,login_name_len, 1); - add_property_stringl(this_ptr,"_password",login_pass,login_pass_len, 1); -} - -PHP_METHOD(soapobject, __useproxy) -{ - char *proxy_host; - char *proxy_name = NULL; - char *proxy_pass = NULL; - int proxy_host_len; - int proxy_name_len; - int proxy_pass_len; - long proxy_port; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ss", - &proxy_host, &proxy_host_len, &proxy_port, &proxy_name, &proxy_name_len, &proxy_pass, &proxy_pass_len) == FAILURE) { - return; - } - add_property_stringl(this_ptr,"_proxy_host",proxy_host,proxy_host_len, 1); - add_property_long(this_ptr,"_proxy_port",proxy_port); - if (proxy_name) { - add_property_stringl(this_ptr,"_proxy_login",proxy_name,proxy_name_len, 1); - } - if (proxy_pass) { - add_property_stringl(this_ptr,"_proxy_password",proxy_pass,proxy_pass_len, 1); - } - zend_hash_del(Z_OBJPROP_P(this_ptr), "httpsocket", sizeof("httpsocket")); - zend_hash_del(Z_OBJPROP_P(this_ptr), "_use_proxy", sizeof("_use_proxy")); -} - -PHP_METHOD(soapobject, __call) +PHP_METHOD(soapclient, __call) { char *function, *soap_action = NULL, *uri = NULL; - int function_len, soap_action_len, uri_len, i = 0; + int function_len, i = 0; HashTable* soap_headers = NULL; + zval *options = NULL; zval *headers = NULL; zval *output_headers = NULL; zval *args; @@ -1716,9 +1743,28 @@ PHP_METHOD(soapobject, __call) HashPosition pos; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa|sszz", - &function, &function_len, &args, &soap_action, &soap_action_len, &uri, &uri_len, &headers, &output_headers) == FAILURE) { - php_error(E_ERROR, "Invalid arguments to SoapObject->__call"); + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa|zzz", + &function, &function_len, &args, &options, &headers, &output_headers) == FAILURE) { + php_error(E_ERROR, "Invalid arguments to SoapClient->__call"); + } + + if (options) { + if (Z_TYPE_P(options) == IS_ARRAY) { + HashTable *ht = Z_ARRVAL_P(options); + zval **tmp; + + if (zend_hash_find(ht, "soapaction", sizeof("soapaction"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + soap_action = Z_STRVAL_PP(tmp); + } + + if (zend_hash_find(ht, "uri", sizeof("uri"), (void**)&tmp) == SUCCESS && + Z_TYPE_PP(tmp) == IS_STRING) { + soap_action = Z_STRVAL_PP(tmp); + } + } else if (Z_TYPE_P(options) != IS_NULL) { + php_error(E_ERROR, "Invalid arguments to SoapClient->__call"); + } } if (headers == NULL || Z_TYPE_P(headers) == IS_NULL) { @@ -1730,7 +1776,7 @@ PHP_METHOD(soapobject, __call) while (zend_hash_get_current_data(soap_headers, (void**)&tmp) == SUCCESS) { if (Z_TYPE_PP(tmp) != IS_OBJECT || Z_OBJCE_PP(tmp) != soap_header_class_entry) { - php_error(E_ERROR, "Invalid arguments to SoapObject->__call"); + php_error(E_ERROR, "Invalid arguments to SoapClient->__call"); } zend_hash_move_forward(soap_headers); } @@ -1741,7 +1787,7 @@ PHP_METHOD(soapobject, __call) zend_hash_next_index_insert(soap_headers, &headers, sizeof(zval*), NULL); headers = NULL; } else{ - php_error(E_ERROR, "Invalid arguments to SoapObject->__call"); + php_error(E_ERROR, "Invalid arguments to SoapClient->__call"); } arg_count = zend_hash_num_elements(Z_ARRVAL_P(args)); @@ -1765,28 +1811,7 @@ PHP_METHOD(soapobject, __call) } } -PHP_METHOD(soapobject, __isfault) -{ - if (zend_hash_exists(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"))) { - RETURN_TRUE - } else { - RETURN_FALSE - } -} - -PHP_METHOD(soapobject, __getfault) -{ - zval **tmp; - - if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **)&tmp) == SUCCESS) { - *return_value = *(*tmp); - zval_copy_ctor(return_value); - return; - } - RETURN_NULL(); -} - -PHP_METHOD(soapobject, __getfunctions) +PHP_METHOD(soapclient, __getfunctions) { sdlPtr sdl; HashPosition pos; @@ -1808,7 +1833,7 @@ PHP_METHOD(soapobject, __getfunctions) } } -PHP_METHOD(soapobject, __gettypes) +PHP_METHOD(soapclient, __gettypes) { sdlPtr sdl; HashPosition pos; @@ -1832,7 +1857,7 @@ PHP_METHOD(soapobject, __gettypes) } } -PHP_METHOD(soapobject, __getlastrequest) +PHP_METHOD(soapclient, __getlastrequest) { zval **tmp; @@ -1842,7 +1867,7 @@ PHP_METHOD(soapobject, __getlastrequest) RETURN_NULL(); } -PHP_METHOD(soapobject, __getlastresponse) +PHP_METHOD(soapclient, __getlastresponse) { zval **tmp; @@ -3077,6 +3102,8 @@ static void delete_service(void *data) if (service->actor) { efree(service->actor); } - efree(service->uri); + if (service->uri) { + efree(service->uri); + } efree(service); } diff --git a/ext/soap/tests/schema/test_schema.inc b/ext/soap/tests/schema/test_schema.inc index 4e1e2df9eb..3bdcd95ef7 100644 --- a/ext/soap/tests/schema/test_schema.inc +++ b/ext/soap/tests/schema/test_schema.inc @@ -53,13 +53,11 @@ EOF; $f = fopen($fname,"w"); fwrite($f,$wsdl); fclose($f); - $x = new SoapObject($fname); - $y = new SoapServer("http://test-uri/"); - $y->bind($fname); + $x = new SoapClient($fname, array("trace"=>1)); + $y = new SoapServer($fname); $y->addfunction("test"); unlink($fname); - $x->__trace(1); $x->test($param); $xml = xml_parser_create(); $req = $x->__getlastrequest(); diff --git a/ext/soap/tests/server001.phpt b/ext/soap/tests/server001.phpt index 0ee679889b..582759f06f 100644 --- a/ext/soap/tests/server001.phpt +++ b/ext/soap/tests/server001.phpt @@ -8,7 +8,7 @@ function test() { return "Hello World"; } -$server = new soapserver("http://testuri.org"); +$server = new soapserver(null,array('uri'=>"http://testuri.org")); $server->addfunction("test"); $HTTP_RAW_POST_DATA = <<"http://testuri.org")); $server->addfunction("Add"); $HTTP_RAW_POST_DATA = << --FILE-- "http://testuri.org")); $server->addfunction(SOAP_FUNCTIONS_ALL); $HTTP_RAW_POST_DATA = <<"http://testuri.org")); $server->addfunction(array("Sub","Add")); $HTTP_RAW_POST_DATA = <<"http://testuri.org")); $server->setclass("Foo"); $HTTP_RAW_POST_DATA = <<"http://testuri.org")); $server->setclass("Foo","Hello"); $HTTP_RAW_POST_DATA = <<"http://testuri.org")); $server->addfunction(array("Sub","Add")); var_dump($server->getfunctions()); echo "ok\n"; diff --git a/ext/soap/tests/server008.phpt b/ext/soap/tests/server008.phpt index 73f91f3891..87fb69d25f 100644 --- a/ext/soap/tests/server008.phpt +++ b/ext/soap/tests/server008.phpt @@ -14,7 +14,7 @@ class Foo { } } -$server = new soapserver("http://testuri.org"); +$server = new soapserver(null,array('uri'=>"http://testuri.org")); $server->setclass("Foo"); var_dump($server->getfunctions()); echo "ok\n"; diff --git a/ext/soap/tests/server009.phpt b/ext/soap/tests/server009.phpt index 9e338450da..0a7b30f40c 100644 --- a/ext/soap/tests/server009.phpt +++ b/ext/soap/tests/server009.phpt @@ -17,7 +17,7 @@ class foo { } } -$server = new soapserver("http://testuri.org"); +$server = new soapserver(null,array('uri'=>"http://testuri.org")); $server->setclass("foo"); $server->setpersistence(SOAP_PERSISTENCE_SESSION); diff --git a/ext/soap/tests/server010.phpt b/ext/soap/tests/server010.phpt index 8cbdc4af46..76cc1e6949 100644 --- a/ext/soap/tests/server010.phpt +++ b/ext/soap/tests/server010.phpt @@ -12,7 +12,7 @@ class foo { } } -$server = new soapserver("http://testuri.org"); +$server = new soapserver(null,array('uri'=>"http://testuri.org")); $server->setclass("foo"); $server->setpersistence(SOAP_PERSISTENCE_REQUEST); diff --git a/ext/soap/tests/server011.phpt b/ext/soap/tests/server011.phpt index d5f6d3703d..fb9aabe89c 100644 --- a/ext/soap/tests/server011.phpt +++ b/ext/soap/tests/server011.phpt @@ -10,8 +10,7 @@ function Add($x,$y) { return $x+$y; } -$server = new soapserver("http://testuri.org"); -$server->bind(dirname(__FILE__)."/test.wsdl"); +$server = new soapserver(dirname(__FILE__)."/test.wsdl"); ob_start(); $server->handle(); $wsdl = ob_get_contents(); diff --git a/ext/soap/tests/server012.phpt b/ext/soap/tests/server012.phpt index 5739f5beae..9a41de9d50 100644 --- a/ext/soap/tests/server012.phpt +++ b/ext/soap/tests/server012.phpt @@ -10,7 +10,7 @@ function Add($x,$y) { return $x+$y; } -$server = new soapserver("http://testuri.org"); +$server = new soapserver(null,array('uri'=>"http://testuri.org")); $server->addfunction("Add"); $server->handle(); echo "ok\n"; diff --git a/ext/soap/tests/server013.phpt b/ext/soap/tests/server013.phpt index ca7efbfeeb..4bb94c79c4 100644 --- a/ext/soap/tests/server013.phpt +++ b/ext/soap/tests/server013.phpt @@ -14,7 +14,7 @@ function Sum($a) { return $sum; } -$server = new soapserver("http://testuri.org"); +$server = new soapserver(null,array('uri'=>"http://testuri.org")); $server->addfunction("Sum"); $HTTP_RAW_POST_DATA = <<"http://testuri.org")); $server->addfunction("Add"); $HTTP_RAW_POST_DATA = <<bind(dirname(__FILE__)."/soap12-test.wsdl"); +$server = new soapserver(dirname(__FILE__)."/soap12-test.wsdl", array('soap_version'=>SOAP_1_2,'actor'=>"http://example.org/ts-tests/C")); $server->setClass("Soap12test"); $server->handle(); -- 2.50.1