source: branches/version-2_11-dev/data/module/SOAP/example/example_types.php @ 21304

Revision 21304, 1.5 KB checked in by kotani, 12 years ago (diff)

#1521 (PEAR::SOAP 配布と異なる部分がある)

  • 新しいバージョンの配布ファイルを上書きすることで解決
  • →2.11.4には含めないため一旦コミットキャンセル

#1522 (PEAR::SOAP をバージョンアップ)

  • 0.11.0 -> 0.12.0
  • →2.11.4には含めないため一旦コミットキャンセル
  • Property svn:eol-style set to LF
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
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 */
14class SOAPStruct
15{
16
17    var $varString;
18    var $varInt;
19    var $varFloat;
20
21    function SOAPStruct($s = null, $i = null, $f = null)
22    {
23        $this->varString = $s;
24        $this->varInt = $i;
25        $this->varFloat = $f;
26    }
27   
28    function &__to_soap($name = 'inputStruct', $header = false,
29                        $mustUnderstand = 0,
30                        $actor = 'http://schemas.xmlsoap.org/soap/actor/next')
31    {
32        $inner[] = new SOAP_Value('varString', 'string', $this->varString);
33        $inner[] = new SOAP_Value('varInt', 'int', $this->varInt);
34        $inner[] = new SOAP_Value('varFloat', 'float', $this->varFloat);
35
36        if ($header) {
37            $value = new SOAP_Header($name,'{http://soapinterop.org/xsd}SOAPStruct',$inner,$mustUnderstand,$actor);
38        } else {
39            $value = new SOAP_Value($name,'{http://soapinterop.org/xsd}SOAPStruct',$inner);
40        }
41
42        return $value;
43    }
44}
Note: See TracBrowser for help on using the repository browser.