home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / SOAP / Interop / params_values.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  6.8 KB  |  174 lines

  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: params_values.php,v 1.7 2007/01/26 15:18:21 yunosh Exp $
  20. //
  21.  
  22. require_once 'SOAP/Value.php';
  23. require_once 'params_classes.php';
  24.  
  25. $soap_test_null = null;
  26.  
  27. $string = 'Hello World';
  28. $string_soapval = new SOAP_Value('inputString', 'string', $string);
  29. $string_null = null;
  30. $string_null_soapval = new SOAP_Value('inputString', 'string', $string_null);
  31. $string_entities = "this is a test <hello>\n";
  32. $string_entities_soapval = new SOAP_Value('inputString', 'string', $string_entities);
  33. $string_utf8 = utf8_encode('ß╗ù├ê├⌐├│├ÆΓéºΓà£ß╗ùß╗╕');
  34. $string_utf8_soapval = new SOAP_Value('inputString', 'string', $string_utf8);
  35. $string_array = array('good', 'bad');
  36. $string_array_soapval = new SOAP_Value(
  37.     'inputStringArray',
  38.     'Array',
  39.     array(new SOAP_Value('item', 'string', 'good'),
  40.           new SOAP_Value('item', 'string', 'bad')));
  41.  
  42. $string_array_one = array('good');
  43. $string_array_one_soapval = new SOAP_Value(
  44.     'inputStringArray',
  45.     'Array',
  46.     array(new SOAP_Value('item', 'string', 'good')));
  47.  
  48. $string_array_null = null;
  49. $string_array_null_soapval = new SOAP_Value('inputStringArray', 'Array', null);
  50. $string_array_null_soapval->arrayType='{http://www.w3.org/2001/XMLSchema}string';
  51.  
  52. $integer = 12345;
  53. $integer_soapval = new SOAP_Value('inputInteger', 'int', $integer);
  54. $integer_array = array(1, 234324324, 2);
  55. $integer_array_soapval = new SOAP_Value(
  56.     'inputIntegerArray',
  57.     'Array',
  58.     array(new SOAP_Value('item', 'int', 1),
  59.           new SOAP_Value('item', 'int', 234324324),
  60.           new SOAP_Value('item', 'int', 2)));
  61.  
  62. $integer_array_null = null;
  63. $integer_array_null_soapval = new SOAP_Value('inputIntegerArray', 'Array', null);
  64. $integer_array_null_soapval->arrayType='{http://www.w3.org/2001/XMLSchema}int';
  65.  
  66. $float = 123.45;
  67. $float_soapval = new SOAP_Value('inputFloat', 'float', $float);
  68. $float_array = array(1.0, 2343.24324, -2.5);
  69. $float_array_soapval = new SOAP_Value(
  70.     'inputFloatArray',
  71.     'Array',
  72.     array(new SOAP_Value('item', 'float', 1.0),
  73.           new SOAP_Value('item', 'float', 2343.24324),
  74.           new SOAP_Value('item', 'float', -2.5)));
  75.  
  76. $float_array_null = null;
  77. $float_array_null_soapval = new SOAP_Value('inputFloatArray', 'Array', null);
  78. $float_array_null_soapval->arrayType='{http://www.w3.org/2001/XMLSchema}float';
  79.  
  80. $soapstruct = new SOAPStruct('arg', 34, 325.325);
  81. $soapstruct_soapval = $soapstruct->__to_soap();
  82. $soapstruct_header_soapval = $soapstruct->__to_soap('{http://soapinterop.org/echoheader/}echoMeStructRequest');
  83. $soapstruct_array = array($soapstruct, $soapstruct, $soapstruct);
  84. $soapstruct_array_soapval = new SOAP_Value(
  85.     'inputStructArray',
  86.     'Array',
  87.     array($soapstruct_soapval,
  88.           $soapstruct_soapval,
  89.           $soapstruct_soapval));
  90.  
  91. $soapstructstruct = new SOAPStructStruct('arg', 34, 325.325, $soapstruct);
  92. $soapstructstruct_soapval = $soapstructstruct->__to_soap();
  93. $soapstructstruct_array = array($soapstructstruct, $soapstructstruct, $soapstructstruct);
  94. $soapstructstruct_array_soapval = new SOAP_Value(
  95.     'inputStructArray',
  96.     'Array',
  97.     array($soapstructstruct_soapval,
  98.           $soapstructstruct_soapval,
  99.           $soapstructstruct_soapval));
  100.  
  101. $soaparraystruct = new SOAPArrayStruct('arg', 34, 325.325,
  102.                                        array('good', 'bad', 'ugly'));
  103. $soaparraystruct_soapval = $soaparraystruct->__to_soap();
  104. $soaparraystruct_array = array($soaparraystruct, $soaparraystruct, $soaparraystruct);
  105. $soaparraystruct_array_soapval = new SOAP_Value(
  106.     'inputStructArray',
  107.     'Array',
  108.     array($soaparraystruct_soapval,
  109.           $soaparraystruct_soapval,
  110.           $soaparraystruct_soapval));
  111.  
  112. $simpletypes = array(
  113.         'inputString'=>'arg',
  114.         'inputInteger'=>34,
  115.         'inputFloat'=>325.325
  116.     );
  117.  
  118. $simpletypes_soapval = array();
  119. $simpletypes_soapval[] = new SOAP_Value('inputString', 'string', 'arg');
  120. $simpletypes_soapval[] = new SOAP_Value('inputInteger', 'int', 34);
  121. $simpletypes_soapval[] = new SOAP_Value('inputFloat', 'float', 325.325);
  122.  
  123. $base64 = 'TmVicmFza2E=';
  124. $base64_soapval = new SOAP_Value('inputBase64', 'base64Binary', $base64);
  125.  
  126. $hexBin = '736F61707834';
  127. $hexBin_soapval = new SOAP_Value('inputHexBinary', 'hexBinary', $hexBin);
  128.  
  129. $decimal = 12345.67890;
  130. $decimal_soapval =new SOAP_Value('inputDecimal', 'decimal', $decimal);
  131.  
  132. $dateTime = '2001-05-24T17:31:41Z';
  133. $dateTime_soapval = new SOAP_Value('inputDate', 'dateTime', $dateTime);
  134.  
  135. $boolean_true = true;
  136. $boolean_true_soapval = new SOAP_Value('inputBoolean', 'boolean', true);
  137. $boolean_false = false;
  138. $boolean_false_soapval = new SOAP_Value('inputBoolean', 'boolean', false);
  139. $boolean_one = 1;
  140. $boolean_one_soapval = new SOAP_Value('inputBoolean', 'boolean', 1);
  141. $boolean_zero = 0;
  142. $boolean_zero_soapval = new SOAP_Value('inputBoolean', 'boolean', 0);
  143.  
  144. // XXX I know this isn't quite right, need to deal with this better
  145. function &make_2d($x, $y)
  146. {
  147.     $a = array();
  148.     for ($_x = 0; $_x < $x; $_x++) {
  149.         $a[$_x] = array();
  150.         for ($_y = 0; $_y < $y; $_y++) {
  151.             $a[$_x][$_y] = "x{$_x}y{$_y}";
  152.         }
  153.     }
  154.     return $a;
  155. }
  156.  
  157. $multidimarray = make_2d(3, 3);
  158. $multidimarray_soapval = new SOAP_Value(
  159.     'input2DStringArray',
  160.     'Array',
  161.     array(array(new SOAP_Value('item', 'string', 'row0col0'),
  162.                 new SOAP_Value('item', 'string', 'row0col1'),
  163.                 new SOAP_Value('item', 'string', 'row0col2')),
  164.           array(new SOAP_Value('item', 'string', 'row1col0'),
  165.                 new SOAP_Value('item', 'string', 'row1col1'),
  166.                 new SOAP_Value('item', 'string', 'row1col2'))));
  167. $multidimarray_soapval->options['flatten'] = true;
  168.  
  169. // Round2GroupC values
  170. $_person = new Person(32, 12345, 'Shane', true);
  171. $person = $_person->__to_soap();
  172. $_employee = new Employee($_person, 12345, 1000000.00);
  173. $employee = $_employee->__to_soap();
  174.