summaryrefslogtreecommitdiff
path: root/ext/soap/tests/soap12/soap12-test.inc
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-03-14 05:42:27 +0000
committer <>2013-04-03 16:25:08 +0000
commitc4dd7a1a684490673e25aaf4fabec5df138854c4 (patch)
tree4d57c44caae4480efff02b90b9be86f44bf25409 /ext/soap/tests/soap12/soap12-test.inc
downloadphp2-master.tar.gz
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/soap/tests/soap12/soap12-test.inc')
-rw-r--r--ext/soap/tests/soap12/soap12-test.inc131
1 files changed, 131 insertions, 0 deletions
diff --git a/ext/soap/tests/soap12/soap12-test.inc b/ext/soap/tests/soap12/soap12-test.inc
new file mode 100644
index 0000000..fbdc855
--- /dev/null
+++ b/ext/soap/tests/soap12/soap12-test.inc
@@ -0,0 +1,131 @@
+<?php
+class Soap12test {
+ public $header;
+
+ function echoOk($x) {
+ return $x;
+ }
+
+ function echoString($inputString) {
+ return $inputString;
+ }
+
+ function echoStringArray($inputStringArray) {
+ return $inputStringArray;
+ }
+
+ function echoInteger($inputInteger) {
+ return $inputInteger;
+ }
+
+ function echoIntegerArray($inputIntegerArray) {
+ return $inputIntegerArray;
+ }
+
+ function echoFloat($inputFloat) {
+ return $inputFloat;
+ }
+
+ function echoFloatArray($inputFloatArray) {
+ return $inputFloatArray;
+ }
+
+ function echoStruct($x) {
+ return $x;
+ }
+
+ function echoStructArray($x) {
+ return $x;
+ }
+
+ function echoVoid() {
+ return NULL;
+ }
+
+ function echoBase64($b_encoded) {
+ return $b_encoded;
+ }
+
+ function echoDate($timeInstant) {
+ return $timeInstant;
+ }
+
+ function echoHexBinary($hb) {
+ return $hb;
+ }
+
+ function echoDecimal($dec) {
+ return $dec;
+ }
+
+ function echoBoolean($boolean) {
+ return $boolean;
+ }
+
+ function echoStructAsSimpleTypes ($struct) {
+ return array('outputString' => $struct->varString,
+ 'outputInteger' => $struct->varInt,
+ 'outputFloat' => $struct->varFloat);
+ }
+
+ function echoSimpleTypesAsStruct($string, $int, $float) {
+ return (object)array("varString" => $string,
+ "varInt" => $int,
+ "varFloat" => $float);
+ }
+
+ function echoNestedStruct($struct) {
+ return $struct;
+ }
+
+ function echo2DStringArray($ary) {
+ return $ary;
+ }
+
+ function echoNestedArray($ary) {
+ return $ary;
+ }
+
+ function countItems($input) {
+ return count($input);
+ }
+
+ function isNil($input) {
+ return is_null($input);
+ }
+
+ function returnVoid() {
+ }
+
+ function emptyBody() {
+ }
+
+ function requiredHeader($x) {
+ $this->header = $x;
+ }
+
+ function echoHeader() {
+ return $this->header;
+ }
+
+ function echoResolvedRef($ref) {
+ return $ref->RelativeReference->base.$ref->RelativeReference->href;
+ }
+
+ function validateCountryCode($code) {
+ if (strlen($code) != 2) {
+ return new SoapFault("Client", "Not a valid country code", NULL, NULL, NULL, new SoapHeader("http://example.org/ts-tests", "validateCountryCodeFault", "Country code must be 2 letters."));
+ } else {
+ return "OK";
+ }
+ }
+
+}
+
+ini_set("soap.wsdl_cache_enabled",0);
+$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($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>