From 85bb35cb2b11e90b9ff89fb80d92f0913012543c Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Fri, 10 Aug 2001 00:31:21 +0000 Subject: [PATCH] Move/copy a soap server to phpgw root --- phpgwapi/inc/soaplib.soapinterop.php | 121 +++++++++++++++++++++++++++ soap.php | 33 ++++++++ 2 files changed, 154 insertions(+) create mode 100644 phpgwapi/inc/soaplib.soapinterop.php create mode 100644 soap.php diff --git a/phpgwapi/inc/soaplib.soapinterop.php b/phpgwapi/inc/soaplib.soapinterop.php new file mode 100644 index 0000000000..f1f8d1ef8f --- /dev/null +++ b/phpgwapi/inc/soaplib.soapinterop.php @@ -0,0 +1,121 @@ +add_to_map( + 'hello', + array('string'), + array('string') + ); + function hello($serverid) + { + global $phpgw_info; + return CreateObject('soap.soapval','return','string',$phpgw_info['server']['site_title']); + } + + $server->add_to_map( + "echoString", + array("string"), + array("string") + ); + function echoString($inputString) + { + return CreateObject('soap.soapval',"return","string",$inputString); + } + + $server->add_to_map( + "echoStringArray", + array("array"), + array("array") + ); + function echoStringArray($inputStringArray) + { + return $inputStringArray; + } + + $server->add_to_map( + "echoInteger", + array("int"), + array("int") + ); + function echoInteger($inputInteger) + { + return $inputInteger; + } + + $server->add_to_map( + "echoIntegerArray", + array("array"), + array("array") + ); + function echoIntegerArray($inputIntegerArray) + { + return $inputIntegerArray; + } + + $server->add_to_map( + "echoFloat", + array("float"), + array("float") + ); + function echoFloat($inputFloat) + { + return $inputFloat; + } + + $server->add_to_map( + "echoFloatArray", + array("array"), + array("array") + ); + function echoFloatArray($inputFloatArray) + { + return $inputFloatArray; + } + + $server->add_to_map( + "echoStruct", + array("SOAPStruct"), + array("SOAPStruct") + ); + function echoStruct($inputStruct) + { + return $inputStruct; + } + + $server->add_to_map( + "echoStructArray", + array("array"), + array("array") + ); + function echoStructArray($inputStructArray) + { + return $inputStructArray; + } + + $server->add_to_map( + "echoVoid", + array(), + array() + ); + function echoVoid() + { + } + + $server->add_to_map( + "echoBase64", + array("base64"), + array("base64") + ); + function echoBase64($b_encoded) + { + return base64_encode(base64_decode($b_encoded)); + } + + $server->add_to_map( + "echoDate", + array("timeInstant"), + array("timeInstant") + ); + function echoDate($timeInstant) + { + return $timeInstant; + } +?> diff --git a/soap.php b/soap.php new file mode 100644 index 0000000000..eff6312bfa --- /dev/null +++ b/soap.php @@ -0,0 +1,33 @@ + * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) any later version. * + \**************************************************************************/ + + /* $Id$ */ + + //$login = 'anonymous'; + //$passwd = 'anonymous1'; + + $phpgw_info['flags'] = array( + 'disable_Template_class' => True, + 'currentapp' => 'login', + 'noheader' => True + ); + + include('./header.inc.php'); + //$sessionid = $phpgw->session->create($login,$passwd); + + $server = CreateObject('phpgwapi.soap_server'); + /* _debug_array($server);exit; */ + + include(PHPGW_API_INC . '/soaplib.soapinterop.php'); + + $server->service($HTTP_RAW_POST_DATA); +?>