SOAP_Interop
[ class tree: SOAP_Interop ] [ index: SOAP_Interop ] [ all elements ]

Source for file server_Round3GroupDImport3.php

Documentation is available at server_Round3GroupDImport3.php

  1. <?php
  2. //
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.02 of the PHP license,      |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | http://www.php.net/license/2_02.txt.                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | license@php.net so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Authors: Shane Caraveo <Shane@Caraveo.com>                           |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: server_Round3GroupDImport3.php,v 1.6 2007/01/22 14:53:22 yunosh Exp $
  20. //
  21. require_once 'SOAP/Server.php';
  22. require_once 'params_classes.php';
  23.  
  24. // http://www.whitemesa.com/r3/interop3.html
  25. // http://www.whitemesa.com/r3/plan.html
  26.  
  27. class SOAP_Interop_GroupDImport3 {
  28.  
  29.     function echoStruct($inputStruct)
  30.     {
  31.         $ns '{http://soapinterop.org/xsd}';
  32.         if (is_object($inputStruct&&
  33.             strtolower(get_class($inputStruct)) == 'soapstruct'{
  34.             return $inputStruct->__to_soap($ns 'return');
  35.         else {
  36.             if (is_object($inputStruct)) {
  37.                 $inputStruct get_object_vars($inputStruct);
  38.             }
  39.             $struct = new SOAPStruct($inputStruct['varString']$inputStruct['varInt']$inputStruct['varFloat']);
  40.             return $struct->__to_soap($ns.'return');
  41.         }
  42.     }
  43.  
  44.     function echoStructArray($inputStructArray)
  45.     {
  46.         $ra = array();
  47.         if ($inputStructArray{
  48.             $c count($inputStructArray);
  49.             for ($i = 0; $i $c$i++{
  50.                 $ra[$inputStructArray[$i]->__to_soap('item');
  51.             }
  52.         }
  53.         return $ra;
  54.     }
  55.  
  56. }
  57.  
  58. // http://www.whitemesa.com/r3/interop3.html
  59. // http://www.whitemesa.com/r3/plan.html
  60.  
  61. $groupd = new SOAP_Interop_GroupDImport3();
  62. $server = new SOAP_Server();
  63. $server->_auto_translation = true;
  64.  
  65. $server->addObjectMap($groupd'http://soapinterop/');
  66. $server->addObjectMap($groupd'http://soapinterop.org/xsd');
  67.  
  68. $server->bind('http://localhost/soap_interop/wsdl/import3.wsdl.php');
  69. if (isset($_SERVER['SERVER_NAME'])) {
  70.     $server->service(isset($HTTP_RAW_POST_DATA$HTTP_RAW_POST_DATA : null);
  71. else {
  72.     // allows command line testing of specific request
  73.     $test '<?xml version="1.0" encoding="UTF-8"?>
  74.  
  75. <SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  76.  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  77.  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  78.  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  79.  xmlns:ns4="http://soapinterop.org/xsd"
  80.  xmlns:ns5="http://soapinterop/"
  81.  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  82. <SOAP-ENV:Body>
  83.  
  84. <ns5:echoStructArray>
  85. <inputArray xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="ns4:SOAPStruct[3]" SOAP-ENC:offset="[0]">
  86. <item>
  87. <varString xsi:type="xsd:string">arg</varString>
  88. <varInt xsi:type="xsd:int">34</varInt>
  89. <varFloat xsi:type="xsd:float">325.325</varFloat></item>
  90. <item>
  91. <varString xsi:type="xsd:string">arg</varString>
  92. <varInt xsi:type="xsd:int">34</varInt>
  93. <varFloat xsi:type="xsd:float">325.325</varFloat></item>
  94. <item>
  95. <varString xsi:type="xsd:string">arg</varString>
  96. <varInt xsi:type="xsd:int">34</varInt>
  97. <varFloat xsi:type="xsd:float">325.325</varFloat></item></inputArray></ns5:echoStructArray>
  98. </SOAP-ENV:Body>
  99. </SOAP-ENV:Envelope>';
  100.     $server->service($test''true);
  101. }

Documentation generated on Mon, 11 Mar 2019 15:06:27 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.