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

Source for file example_types.php

Documentation is available at example_types.php

  1. <?php
  2. /**
  3.  * This is a data type that is used in SOAP Interop testing, but is here as an
  4.  * example of using complex types.  When the class is deserialized from a SOAP
  5.  * message, it's constructor IS NOT CALLED!  So your type classes need to
  6.  * behave in a way that will work with that.
  7.  *
  8.  * Some types may need more explicit serialization for SOAP.  The __to_soap
  9.  * function allows you to be very explicit in building the SOAP_Value
  10.  * structures.  The soap library does not call this directly, you would call
  11.  * it from your soap server class, echoStruct in the server class is an
  12.  * example of doing this.
  13.  */
  14. class SOAPStruct {
  15.  
  16.     var $varString;
  17.     var $varInt;
  18.     var $varFloat;
  19.  
  20.     function SOAPStruct($s = null$i = null$f = null)
  21.     {
  22.         $this->varString $s;
  23.         $this->varInt $i;
  24.         $this->varFloat $f;
  25.     }
  26.     
  27.     function &__to_soap($name 'inputStruct'$header = false,
  28.                         $mustUnderstand = 0,
  29.                         $actor 'http://schemas.xmlsoap.org/soap/actor/next')
  30.     {
  31.         $inner[=new SOAP_Value('varString''string'$this->varString);
  32.         $inner[=new SOAP_Value('varInt''int'$this->varInt);
  33.         $inner[=new SOAP_Value('varFloat''float'$this->varFloat);
  34.  
  35.         if ($header{
  36.             $value =new SOAP_Header($name,'{http://soapinterop.org/xsd}SOAPStruct',$inner,$mustUnderstand,$actor);
  37.         else {
  38.             $value =new SOAP_Value($name,'{http://soapinterop.org/xsd}SOAPStruct',$inner);
  39.         }
  40.  
  41.         return $value;
  42.     }
  43. }

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