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

Revision 21299, 1.8 KB checked in by Seasoft, 12 years ago (diff)

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

  • 新しいバージョンの配布ファイルを上書きすることで解決

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

  • 0.11.0 -> 0.12.0
  • 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 *
14 * @category Web Services
15 * @package  SOAP
16 */
17class SOAPStruct
18{
19
20    var $varString;
21    var $varInt;
22    var $varFloat;
23
24    function SOAPStruct($s = null, $i = null, $f = null)
25    {
26        $this->varString = $s;
27        $this->varInt = $i;
28        $this->varFloat = $f;
29    }
30   
31    function &__to_soap($name = 'inputStruct', $header = false,
32                        $mustUnderstand = 0,
33                        $actor = 'http://schemas.xmlsoap.org/soap/actor/next')
34    {
35        $inner = array(
36            new SOAP_Value('varString', 'string', $this->varString),
37            new SOAP_Value('varInt', 'int', $this->varInt),
38            new SOAP_Value('varFloat', 'float', $this->varFloat));
39
40        if ($header) {
41            $value = new SOAP_Header($name,
42                                     '{http://soapinterop.org/xsd}SOAPStruct',
43                                     $inner,
44                                     $mustUnderstand,
45                                     $actor);
46        } else {
47            $value = new SOAP_Value($name,
48                                    '{http://soapinterop.org/xsd}SOAPStruct',
49                                    $inner);
50        }
51
52        return $value;
53    }
54
55}
Note: See TracBrowser for help on using the repository browser.