From 0961729c4928b891a0be0c53d62119495966723b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 22 Mar 2012 13:19:49 +0000 Subject: [PATCH] Soap Test/Beispiel Client --- soap/test.soap.php | 48 +++++++++++++++++++++++++ soap/test.wsdl.php | 48 +++++++++++++++++++++++++ soap/test_client.php | 83 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 179 insertions(+) create mode 100644 soap/test.soap.php create mode 100644 soap/test.wsdl.php create mode 100644 soap/test_client.php diff --git a/soap/test.soap.php b/soap/test.soap.php new file mode 100644 index 000000000..0e8a84ffe --- /dev/null +++ b/soap/test.soap.php @@ -0,0 +1,48 @@ +, + * Andreas Oesterreicher and + * Karl Burkhart . + */ +header("Cache-Control: no-cache"); +header("Cache-Control: post-check=0, pre-check=0",false); +header("Expires Mon, 26 Jul 1997 05:00:00 GMT"); +header("Pragma: no-cache"); + + +require_once('../config/vilesci.config.inc.php'); + +$SOAPServer = new SoapServer(APP_ROOT."soap/test.wsdl.php?".microtime()); +$SOAPServer->addFunction("myTest"); +$SOAPServer->handle(); + +// WSDL Chache auf aus +ini_set("soap.wsdl_cache_enabled", "0"); + + +function myTest($foo) +{ + if($foo=='foo') + return 'OK'; + else + return new SoapFault("Server", 'bar'); +} + +?> + + diff --git a/soap/test.wsdl.php b/soap/test.wsdl.php new file mode 100644 index 000000000..a63a4cba6 --- /dev/null +++ b/soap/test.wsdl.php @@ -0,0 +1,48 @@ +"; +?> + + + + + + + + + + + + + + + + + + + + + + + " /> + + + + + + + + + + + + "/> + + + diff --git a/soap/test_client.php b/soap/test_client.php new file mode 100644 index 000000000..c39c68453 --- /dev/null +++ b/soap/test_client.php @@ -0,0 +1,83 @@ + + + + + + + + + Test-Client + + + + + +
+ + +
+ +
'; + try + { + $response = $client->myTest('foo'); + var_dump($response); + } + catch(SoapFault $fault) + { + echo "SOAP Fault: (faultcode: ".$fault->faultcode.", faultstring: ".$fault->faultstring.")", E_USER_ERROR; + } + +} + +?> + +