Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 175 lines (156 sloc) 6.036 kb
9a58d11 initial checkin of new interop work
Shane Caraveo authored
1 <?php
2 //
3 // +----------------------------------------------------------------------+
4 // | PHP Version 4 |
5 // +----------------------------------------------------------------------+
1aed544 @mj * Update copyright year to 2003.
mj authored
6 // | Copyright (c) 1997-2003 The PHP Group |
9a58d11 initial checkin of new interop work
Shane Caraveo authored
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$
20 //
a8f0987 Fix CS.
Jan Schneider authored
21
9a58d11 initial checkin of new interop work
Shane Caraveo authored
22 require_once 'SOAP/Value.php';
23
24 class SOAPStruct {
a8f0987 Fix CS.
Jan Schneider authored
25
9a58d11 initial checkin of new interop work
Shane Caraveo authored
26 var $varString;
27 var $varInt;
28 var $varFloat;
a8f0987 Fix CS.
Jan Schneider authored
29
30 function SOAPStruct($s = null, $i = null, $f = null)
31 {
9a58d11 initial checkin of new interop work
Shane Caraveo authored
32 $this->varString = $s;
33 $this->varInt = $i;
34 $this->varFloat = $f;
35 }
36
a8f0987 Fix CS.
Jan Schneider authored
37 function __to_soap($name = 'inputStruct', $header = false,
38 $mustUnderstand = 0,
39 $actor = 'http://schemas.xmlsoap.org/soap/actor/next')
9a58d11 initial checkin of new interop work
Shane Caraveo authored
40 {
a8f0987 Fix CS.
Jan Schneider authored
41 $inner = array(new SOAP_Value('varString', 'string', $this->varString),
42 new SOAP_Value('varInt', 'int', $this->varInt),
43 new SOAP_Value('varFloat', 'float', $this->varFloat));
c94e6b6 more interop work
Shane Caraveo authored
44 if ($header) {
a8f0987 Fix CS.
Jan Schneider authored
45 return new SOAP_Header($name,
46 '{http://soapinterop.org/xsd}SOAPStruct',
47 $inner,
48 $mustUnderstand,
49 $actor);
c94e6b6 more interop work
Shane Caraveo authored
50 }
a8f0987 Fix CS.
Jan Schneider authored
51 return new SOAP_Value($name,
52 '{http://soapinterop.org/xsd}SOAPStruct',
53 $inner);
9a58d11 initial checkin of new interop work
Shane Caraveo authored
54 }
a8f0987 Fix CS.
Jan Schneider authored
55
9a58d11 initial checkin of new interop work
Shane Caraveo authored
56 }
57
58 class SOAPStructStruct {
59 var $varString;
60 var $varInt;
61 var $varFloat;
62 var $varStruct;
c94e6b6 more interop work
Shane Caraveo authored
63 function SOAPStructStruct($s=NULL, $i=NULL, $f=NULL, $ss=NULL) {
9a58d11 initial checkin of new interop work
Shane Caraveo authored
64 // XXX unfortunately, a copy of $ss will occure here
65 // ze2 can fix this I think
66 $this->varString = $s;
67 $this->varInt = $i;
68 $this->varFloat = $f;
69 $this->varStruct = $ss;
70 }
71
2fd728b Fix references.
Jan Schneider authored
72 function __to_soap($name = 'inputStruct')
9a58d11 initial checkin of new interop work
Shane Caraveo authored
73 {
2fd728b Fix references.
Jan Schneider authored
74 $v[] = new SOAP_Value('varString','string',$this->varString);
75 $v[] = new SOAP_Value('varInt','int',$this->varInt);
76 $v[] = new SOAP_Value('varFloat','float',$this->varFloat);
77 $v[] = $this->varStruct->__to_soap('varStruct');
8e5deed sigh...fix my reference stupidity
Shane Caraveo authored
78 return new SOAP_Value($name,'{http://soapinterop.org/xsd}SOAPStructStruct',$v);
9a58d11 initial checkin of new interop work
Shane Caraveo authored
79 }
80 }
81
82 class SOAPArrayStruct {
83 var $varString;
84 var $varInt;
85 var $varFloat;
86 var $varArray;
c94e6b6 more interop work
Shane Caraveo authored
87 function SOAPArrayStruct($s=NULL, $i=NULL, $f=NULL, $ss=NULL) {
9a58d11 initial checkin of new interop work
Shane Caraveo authored
88 // XXX unfortunately, a copy of $ss will occure here
89 // ze2 can fix this I think
90 $this->varString = $s;
91 $this->varInt = $i;
92 $this->varFloat = $f;
93 $this->varArray = $ss;
94 }
95
2fd728b Fix references.
Jan Schneider authored
96 function __to_soap($name = 'inputStruct')
9a58d11 initial checkin of new interop work
Shane Caraveo authored
97 {
98 $ar = array();
99 $c = count($this->varArray);
100 for ($i=0; $i<$c; $i++) {
2fd728b Fix references.
Jan Schneider authored
101 $ar[] = new SOAP_Value('item','string',$this->varArray[$i]);
9a58d11 initial checkin of new interop work
Shane Caraveo authored
102 }
2fd728b Fix references.
Jan Schneider authored
103 $v[] = new SOAP_Value('varString','string',$this->varString);
104 $v[] = new SOAP_Value('varInt','int',$this->varInt);
105 $v[] = new SOAP_Value('varFloat','float',$this->varFloat);
106 $v[] = new SOAP_Value('varArray',false,$ar);
8e5deed sigh...fix my reference stupidity
Shane Caraveo authored
107
108 return new SOAP_Value($name,'{http://soapinterop.org/xsd}SOAPArrayStruct',$v);
9a58d11 initial checkin of new interop work
Shane Caraveo authored
109 }
110 }
111
c94e6b6 more interop work
Shane Caraveo authored
112 class Person {
9a58d11 initial checkin of new interop work
Shane Caraveo authored
113 var $Age;
114 var $ID;
115 var $Name;
116 var $Male;
c94e6b6 more interop work
Shane Caraveo authored
117 function Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) {
9a58d11 initial checkin of new interop work
Shane Caraveo authored
118 $this->Age = $a;
119 $this->ID = $i;
120 $this->Name = $n;
121 $this->Male = $m;
122 }
123
c94e6b6 more interop work
Shane Caraveo authored
124 function __set_attribute($key, $value)
125 {
126 $this->$key = $value;
9a58d11 initial checkin of new interop work
Shane Caraveo authored
127 }
c94e6b6 more interop work
Shane Caraveo authored
128
2fd728b Fix references.
Jan Schneider authored
129 function __to_soap($name = 'x_Person',$ns = 'http://soapinterop.org/xsd', $compound2=false)
c94e6b6 more interop work
Shane Caraveo authored
130 {
8e5deed sigh...fix my reference stupidity
Shane Caraveo authored
131 if (!$compound2) {
2fd728b Fix references.
Jan Schneider authored
132 $v[] = new SOAP_Value("\{$ns}Age",'double',$this->Age);
133 $v[] = new SOAP_Value("\{$ns}ID",'float',$this->ID);
c94e6b6 more interop work
Shane Caraveo authored
134 return new SOAP_Value("\{$ns}$name",'Person',
8e5deed sigh...fix my reference stupidity
Shane Caraveo authored
135 $v,array('Name'=>$this->Name,'Male'=>$this->Male));
136 } else
2fd728b Fix references.
Jan Schneider authored
137 $v[] = new SOAP_Value("\{$ns}Name",'string',$this->Name);
138 $v[] = new SOAP_Value("\{$ns}Male",'boolean',$this->Male);
8e5deed sigh...fix my reference stupidity
Shane Caraveo authored
139 return new SOAP_Value("\{$ns}$name",'Person',$v);
c94e6b6 more interop work
Shane Caraveo authored
140 }
9a58d11 initial checkin of new interop work
Shane Caraveo authored
141 }
142
a29bc3b add Round 3 Group D Interop test support
Shane Caraveo authored
143 class x_Person extends Person {
144 function x_Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) {
145 $parent->Person($a,$i,$n,$m);
146 }
147 }
148
9a58d11 initial checkin of new interop work
Shane Caraveo authored
149 class Employee {
150 var $ID;
151 var $salary;
152 var $person; // class person2
c94e6b6 more interop work
Shane Caraveo authored
153 function Employee($person=NULL,$id=NULL,$salary=NULL) {
9a58d11 initial checkin of new interop work
Shane Caraveo authored
154 $this->person = $person;
155 $this->ID = $id;
156 $this->salary = $salary;
157 }
c94e6b6 more interop work
Shane Caraveo authored
158
2fd728b Fix references.
Jan Schneider authored
159 function __to_soap($name = 'x_Employee', $ns='http://soapinterop.org/employee')
c94e6b6 more interop work
Shane Caraveo authored
160 {
2fd728b Fix references.
Jan Schneider authored
161 $person = $this->person->__to_soap('person','http://soapinterop.org/person',true);
c94e6b6 more interop work
Shane Caraveo authored
162 $person->namespace = $ns;
2fd728b Fix references.
Jan Schneider authored
163 $va[] = $person;
164 $va[] = new SOAP_Value("\{$ns}salary",'double',$this->salary);
165 $va[] = new SOAP_Value("\{$ns}ID",'int',$this->ID);
3414fd9 client run now accepts arguments to customize settings (interop_client_r...
Shane Caraveo authored
166 return new SOAP_Value("\{$ns}$name",'Employee',$va);
c94e6b6 more interop work
Shane Caraveo authored
167 }
9a58d11 initial checkin of new interop work
Shane Caraveo authored
168 }
169
a29bc3b add Round 3 Group D Interop test support
Shane Caraveo authored
170 class x_Employee extends Employee {
171 function x_Employee($person=NULL,$id=NULL,$salary=NULL) {
172 $parent->Employee($person,$id,$salary);
173 }
174 }
Something went wrong with that request. Please try again.