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

Source for file interop_Round2GroupB.php

Documentation is available at interop_Round2GroupB.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>   Port to PEAR and more   |
  17. // | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author         |
  18. // +----------------------------------------------------------------------+
  19. //
  20. // $Id: interop_Round2GroupB.php,v 1.8 2004/06/10 23:19:22 thesaur Exp $
  21. //
  22. require_once 'params_classes.php';
  23.  
  24. class SOAP_Interop_GroupB {
  25.     var $__dispatch_map = array();
  26.     
  27.     function SOAP_Interop_GroupB({
  28.     $this->__dispatch_map['echoStructAsSimpleTypes'=
  29.         array('in' => array('inputStruct' => 'SOAPStruct'),
  30.               'out' => array('outputString' => 'string''outputInteger' => 'int''outputFloat' => 'float')
  31.               );
  32.     $this->__dispatch_map['echoSimpleTypesAsStruct'=
  33.         array('in' => array('inputString' => 'string''inputInteger' => 'int''inputFloat' => 'float'),
  34.               'out' => array('return' => 'SOAPStruct')
  35.               );
  36.     $this->__dispatch_map['echoNestedStruct'=
  37.         array('in' => array('inputStruct' => 'SOAPStructStruct'),
  38.               'out' => array('return' => 'SOAPStructStruct')
  39.               );
  40.     $this->__dispatch_map['echo2DStringArray'=
  41.         array('in' => array('input2DStringArray' => 'ArrayOfString2D'),
  42.               'out' => array('return' => 'ArrayOfString2D')
  43.               );
  44.     $this->__dispatch_map['echoNestedArray'=
  45.         array('in' => array('inputString' => 'SOAPArrayStruct'),
  46.               'out' => array('return' => 'SOAPArrayStruct')
  47.               );
  48.     }
  49.     
  50.     /* this private function is called on by SOAP_Server to determine any
  51.         special dispatch information that might be necessary.  This, for example,
  52.         can be used to set up a dispatch map for functions that return multiple
  53.         OUT parameters */
  54.     function __dispatch($methodname{
  55.         if (array_key_exists($methodname,$this->__dispatch_map))
  56.             return $this->__dispatch_map[$methodname];
  57.         return NULL;
  58.     }
  59.     
  60.     function &echoStructAsSimpleTypes (&$struct)
  61.     {
  62.     # convert a SOAPStruct to an array
  63.     $r[=new SOAP_Value('outputString','string',$struct->varString);
  64.     $r[=new SOAP_Value('outputInteger','int',$struct->varInt);
  65.     $r[=new SOAP_Value('outputFloat','float',$struct->varFloat);
  66.     return $r;
  67.     }
  68.  
  69.     function &echoSimpleTypesAsStruct(&$string&$int&$float)
  70.     {
  71.     # convert a input into struct
  72.     $v =new SOAPStruct($string$int$float);
  73.     return new SOAP_Value('return','{http://soapinterop.org/xsd}SOAPStruct',$v);
  74.     }
  75.  
  76.     function &echoNestedStruct(&$struct)
  77.     {
  78.         $separator "\n";
  79.         $methods get_class_methods($struct);
  80.         $arr_str $separator strtolower(implode($separator$methods));
  81.         $string $separator '__to_soap' $separator;
  82.         if(strpos($arr_str$string!== false{
  83.             return $struct->__to_soap();
  84.         }
  85.         return $struct;
  86.     }
  87.  
  88.     function &echo2DStringArray(&$ary)
  89.     {
  90.     $ret =new SOAP_Value('return','Array',$ary);
  91.     $ret->options['flatten'= TRUE;
  92.     return $ret;
  93.     }
  94.  
  95.     function &echoNestedArray(&$ary)
  96.     {
  97.     return $ary;
  98.     }
  99. }
  100.  
  101. ?>

Documentation generated on Mon, 11 Mar 2019 14:54:33 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.