From 968d585a21bf7e8ca96a5b996c5e097fa83dd434 Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Fri, 27 Feb 2004 12:34:16 +0000 Subject: [PATCH] More SOAP docs, thanks to Dmitry for his excellent work # still need some typo hunting git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@152533 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../soap/functions/SoapClient-__call.xml | 82 ++++++++++++++++ .../functions/SoapClient-__getFunctions.xml | 54 +++++++++++ .../functions/SoapClient-__getLastRequest.xml | 55 +++++++++++ .../SoapClient-__getLastResponse.xml | 55 +++++++++++ .../soap/functions/SoapClient-__getTypes.xml | 54 +++++++++++ .../soap/functions/SoapFault-SoapFault.xml | 93 +++++++++++++++++++ .../soap/functions/SoapHeader-SoapHeader.xml | 71 ++++++++++++++ .../soap/functions/SoapParam-SoapParam.xml | 63 +++++++++++++ .../functions/SoapServer-getFunctions.xml | 64 +++++++++++++ .../soap/functions/SoapServer-handle.xml | 63 +++++++++++++ .../soap/functions/SoapServer-setClass.xml | 71 ++++++++++++++ .../functions/SoapServer-setPersistence.xml | 58 ++++++++++++ reference/soap/functions/SoapVar-SoapVar.xml | 75 +++++++++++++++ 13 files changed, 858 insertions(+) create mode 100644 reference/soap/functions/SoapClient-__call.xml create mode 100644 reference/soap/functions/SoapClient-__getFunctions.xml create mode 100644 reference/soap/functions/SoapClient-__getLastRequest.xml create mode 100644 reference/soap/functions/SoapClient-__getLastResponse.xml create mode 100644 reference/soap/functions/SoapClient-__getTypes.xml create mode 100644 reference/soap/functions/SoapFault-SoapFault.xml create mode 100644 reference/soap/functions/SoapHeader-SoapHeader.xml create mode 100644 reference/soap/functions/SoapParam-SoapParam.xml create mode 100644 reference/soap/functions/SoapServer-getFunctions.xml create mode 100644 reference/soap/functions/SoapServer-handle.xml create mode 100644 reference/soap/functions/SoapServer-setClass.xml create mode 100644 reference/soap/functions/SoapServer-setPersistence.xml create mode 100644 reference/soap/functions/SoapVar-SoapVar.xml diff --git a/reference/soap/functions/SoapClient-__call.xml b/reference/soap/functions/SoapClient-__call.xml new file mode 100644 index 0000000000..7369f8c3c2 --- /dev/null +++ b/reference/soap/functions/SoapClient-__call.xml @@ -0,0 +1,82 @@ + + + + + SoapClient::__call + + Calls a SOAP function + + + + Description + + mixedSoapClient::__call + stringfunction_name + arrayarguments + arrayoptions + arrayinput_headers + arrayoutput_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 you like to send and/or receive SOAP Headers. + On error call to SOAP function can cause PHP exceptions or return + SoapFault object, if exceptions was disabled. + To check if function call was failed catch the SoapFault exceptions or + check the result with is_soap_fault function. + + + SOAP function may return one or several values. In the first case it will + return just the value of output parameter, in the second it will return + associative array with named output parameters. + + + + <function>SoapClient::__call</function> examples + +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')); +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapClient-__getFunctions.xml b/reference/soap/functions/SoapClient-__getFunctions.xml new file mode 100644 index 0000000000..ea42638d64 --- /dev/null +++ b/reference/soap/functions/SoapClient-__getFunctions.xml @@ -0,0 +1,54 @@ + + + + + SoapClient::__getFunctions + + Returns list of SOAP functions + + + + Description + + arraySoapClient::__getFunctions + void + + + This function works only in WSDL mode. + + + + <function>SoapClient::__getFunctions</function> example + +__getFunctions()); +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapClient-__getLastRequest.xml b/reference/soap/functions/SoapClient-__getLastRequest.xml new file mode 100644 index 0000000000..bf1be70d54 --- /dev/null +++ b/reference/soap/functions/SoapClient-__getLastRequest.xml @@ -0,0 +1,55 @@ + + + + + SoapClient::__getLastRequest + + Returns last SOAP request + + + + Description + + stringSoapClient::__getLastRequest + void + + + This function works only with SoapClient which was created with trace option. + + + + <function>SoapClient::__getLastRequest</function> example + +1)); +$result = $client->SomeFunction(...); +echo "REQUEST:\n".$client->__getLastRequest()."\n"; +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapClient-__getLastResponse.xml b/reference/soap/functions/SoapClient-__getLastResponse.xml new file mode 100644 index 0000000000..c9962c44dd --- /dev/null +++ b/reference/soap/functions/SoapClient-__getLastResponse.xml @@ -0,0 +1,55 @@ + + + + + SoapClient::__getLastResponse + + Returns last SOAP response + + + + Description + + objectSoapClient::__getLastResponse + void + + + This function works only with SoapClient which was created with trace option. + + + + <function>SoapClient::__getLastResponse</function> example + +1)); +$result = $client->SomeFunction(...); +echo "RESPONSE:\n".$client->__getLastResponse()."\n"; +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapClient-__getTypes.xml b/reference/soap/functions/SoapClient-__getTypes.xml new file mode 100644 index 0000000000..748d831270 --- /dev/null +++ b/reference/soap/functions/SoapClient-__getTypes.xml @@ -0,0 +1,54 @@ + + + + + SoapClient::__getTypes + + Returns list of SOAP types + + + + Description + + arraySoapClient::__getTypes + void + + + This function works only in WSDL mode. + + + + <function>SoapClient::__getTypes</function> example + +__getTypes()); +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapFault-SoapFault.xml b/reference/soap/functions/SoapFault-SoapFault.xml new file mode 100644 index 0000000000..4d6efa202c --- /dev/null +++ b/reference/soap/functions/SoapFault-SoapFault.xml @@ -0,0 +1,93 @@ + + + + + SoapFault::SoapFault + + SoapFault constructor + + + + Description + + objectSoapFault::SoapFault + stringfaultcode + stringfaultstring + stringfaultactor + mixeddetail + stringfaultname + mixedheaderfault + + + This class is useful when you like to send SOAP fault response from PHP + handler. faultcode, faultstring, + faultactor and details are + standard elements of SOAP Fault; faultname is an + optional parameter that can be used to select proper fault encoding from + WSDL; headerfault is an optional parameter that + can be used during SOAP header handling to report error in response header. + + + + Some examples + +"http://test-uri/")); +$server->addFunction("test"); + $server->handle(); +?> +]]> + + + + + It is possible to use PHP exception mechanism to throw SOAP Fault. + + + + Some examples + +"http://test-uri/")); +$server->addFunction("test"); +$server->handle(); +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapHeader-SoapHeader.xml b/reference/soap/functions/SoapHeader-SoapHeader.xml new file mode 100644 index 0000000000..840054a591 --- /dev/null +++ b/reference/soap/functions/SoapHeader-SoapHeader.xml @@ -0,0 +1,71 @@ + + + + + SoapHeader::SoapHeader + + SoapHeader constructor + + + + Description + + objectSoapHeader::SoapHeader + stringnamespace + stringname + mixeddata + boolmustUnderstand + mixedactor + + + 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. namespace 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. + mustUnderstand and actor are values for + mustUnderstand and actor attributes + of this SOAP Header element. + + + + Some examples + + "http://localhost/soap.php", + 'uri' => "http://test-uri/")); +$client->__call("echoVoid",NULL,NULL, + new SoapHeader('http://soapinterop.org/echoheader/', + 'echoMeStringRequest', + 'hello world')); +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapParam-SoapParam.xml b/reference/soap/functions/SoapParam-SoapParam.xml new file mode 100644 index 0000000000..c36a76c1b1 --- /dev/null +++ b/reference/soap/functions/SoapParam-SoapParam.xml @@ -0,0 +1,63 @@ + + + + + SoapParam::SoapParam + + SoapParam constructor + + + + Description + + objectSoapParam::SoapParam + mixeddata + stringname + + + 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 + parameters directly as PHP value, but in this case it will be named as + paramN and SOAP Service may not understand them. + + + + Some examples + + "http://localhost/soap.php", + 'uri' => "http://test-uri/")); +$client->SomeFunction(new SoapParam($a,"a"), + new SoapParam($b,"b"), + new SoapParam($c,"c")); +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapServer-getFunctions.xml b/reference/soap/functions/SoapServer-getFunctions.xml new file mode 100644 index 0000000000..79fa93a049 --- /dev/null +++ b/reference/soap/functions/SoapServer-getFunctions.xml @@ -0,0 +1,64 @@ + + + + + SoapServer::getFunctions + + Returns list of defined functions + + + + Description + + arraySoapServer::getFunctions + void + + + This functions returns the list of all functions which was added by + SoapServer::addFunction or SoapServer::setCalss. + + + + Some examples + +"http://test-uri")); +$server->addFunction(SOAP_FUNCTIONS_ALL ); +if ($_SERVER["REQUEST_METHOD"] == "POST") { + $server->handle(); +} else { + echo "This SOAP server can handle following functions: "; + $functions = $server->getFunctions(); + foreach($functions as $func) { + echo $func . " "; + } +} +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapServer-handle.xml b/reference/soap/functions/SoapServer-handle.xml new file mode 100644 index 0000000000..581f7e509c --- /dev/null +++ b/reference/soap/functions/SoapServer-handle.xml @@ -0,0 +1,63 @@ + + + + + SoapServer::handle + + Handles a SOAP request + + + + Description + + voidSoapServer::handle + stringsoap_request + + + It processes a SOAP request, call necessary functions, and send response + back. It assumes request in input parameter soap_request + or in global $HTTP_RAW_POST_DATA PHP variable if the argument is + omitted. + + + + Some examples + +"http://test-uri/")); +$server->addFunction("test"); +$server->handle(); +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapServer-setClass.xml b/reference/soap/functions/SoapServer-setClass.xml new file mode 100644 index 0000000000..fab470ae33 --- /dev/null +++ b/reference/soap/functions/SoapServer-setClass.xml @@ -0,0 +1,71 @@ + + + + + SoapServer::setClass + + Sets class which will handle SOAP requests + + + + Description + + voidSoapServer::setClass + stringclass_name + mixedargs + + + Exports all methods from specified class. Additional parameters args + 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. + + + + Some examples + +setClass("foo"); + +class bar { + function bar($x, $y) + { + } +} +$server->setClass("bar", $arg1, $arg2); + +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapServer-setPersistence.xml b/reference/soap/functions/SoapServer-setPersistence.xml new file mode 100644 index 0000000000..ddc7052d46 --- /dev/null +++ b/reference/soap/functions/SoapServer-setPersistence.xml @@ -0,0 +1,58 @@ + + + + + SoapServer::setPersistence + + Sets persistence mode of SoapServer + + + + Description + + voidSoapServer::setPersistence + intmode + + + This function allows saving data between requests in PHP session. It works only + with server that exports functions form class with SoapServer::setClass + + + + Some examples + +setPersistence(SOAP_PERSISTENCE_SESSION); + +$server->setPersistence(SOAP_PERSISTENCE_REQUEST); + +?> +]]> + + + + + + + diff --git a/reference/soap/functions/SoapVar-SoapVar.xml b/reference/soap/functions/SoapVar-SoapVar.xml new file mode 100644 index 0000000000..3d9bb24903 --- /dev/null +++ b/reference/soap/functions/SoapVar-SoapVar.xml @@ -0,0 +1,75 @@ + + + + + SoapVar::SoapVar + + SoapVar constructor + + + + Description + + objectSoapVar::SoapVar + mixeddata + intencoding + stringtype_name + stringtype_namespace + stringnode_name + stringnode_namespace + + + 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 XML node name and namespace. + + + + Some examples + +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")); +?> +]]> + + + + + + +