soap4r 1.5.7 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/wsdl2ruby.rb +8 -2
- data/lib/soap/baseData.rb +93 -43
- data/lib/soap/element.rb +11 -8
- data/lib/soap/encodingstyle/handler.rb +15 -4
- data/lib/soap/encodingstyle/literalHandler.rb +18 -24
- data/lib/soap/encodingstyle/soapHandler.rb +34 -77
- data/lib/soap/generator.rb +74 -48
- data/lib/soap/header/handler.rb +1 -1
- data/lib/soap/header/mappinghandler.rb +47 -0
- data/lib/soap/mapping/encodedregistry.rb +19 -13
- data/lib/soap/mapping/factory.rb +19 -3
- data/lib/soap/mapping/literalregistry.rb +47 -35
- data/lib/soap/mapping/mapping.rb +92 -24
- data/lib/soap/mapping/registry.rb +34 -18
- data/lib/soap/mapping/schemadefinition.rb +8 -1
- data/lib/soap/mapping/typeMap.rb +18 -0
- data/lib/soap/mapping/wsdlencodedregistry.rb +8 -50
- data/lib/soap/mapping/wsdlliteralregistry.rb +45 -39
- data/lib/soap/nestedexception.rb +42 -0
- data/lib/soap/netHttpClient.rb +1 -0
- data/lib/soap/ns.rb +34 -0
- data/lib/soap/parser.rb +32 -29
- data/lib/soap/processor.rb +1 -1
- data/lib/soap/rpc/driver.rb +1 -0
- data/lib/soap/rpc/element.rb +18 -6
- data/lib/soap/rpc/httpserver.rb +38 -24
- data/lib/soap/rpc/proxy.rb +14 -11
- data/lib/soap/rpc/router.rb +4 -1
- data/lib/soap/soap.rb +7 -6
- data/lib/soap/wsdlDriver.rb +29 -8
- data/lib/tags +5690 -0
- data/lib/wsdl/definitions.rb +26 -40
- data/lib/wsdl/info.rb +11 -0
- data/lib/wsdl/parser.rb +2 -2
- data/lib/wsdl/soap/cgiStubCreator.rb +10 -5
- data/lib/wsdl/soap/classDefCreator.rb +140 -113
- data/lib/wsdl/soap/classDefCreatorSupport.rb +94 -12
- data/lib/wsdl/soap/classNameCreator.rb +54 -0
- data/lib/wsdl/soap/clientSkeltonCreator.rb +6 -5
- data/lib/wsdl/soap/complexType.rb +10 -1
- data/lib/wsdl/soap/definitions.rb +4 -0
- data/lib/wsdl/soap/driverCreator.rb +14 -6
- data/lib/wsdl/soap/element.rb +4 -0
- data/lib/wsdl/soap/encodedMappingRegistryCreator.rb +11 -55
- data/lib/wsdl/soap/literalMappingRegistryCreator.rb +28 -126
- data/lib/wsdl/soap/mappingRegistryCreator.rb +9 -3
- data/lib/wsdl/soap/mappingRegistryCreatorSupport.rb +209 -94
- data/lib/wsdl/soap/methodDefCreator.rb +12 -16
- data/lib/wsdl/soap/servantSkeltonCreator.rb +3 -2
- data/lib/wsdl/soap/servletStubCreator.rb +107 -0
- data/lib/wsdl/soap/standaloneServerStubCreator.rb +10 -5
- data/lib/wsdl/soap/wsdl2ruby.rb +28 -13
- data/lib/wsdl/wsdl.rb +2 -1
- data/lib/wsdl/xmlSchema/anyAttribute.rb +48 -0
- data/lib/wsdl/xmlSchema/attributeGroup.rb +86 -0
- data/lib/wsdl/xmlSchema/choice.rb +4 -1
- data/lib/wsdl/xmlSchema/complexContent.rb +1 -1
- data/lib/wsdl/xmlSchema/complexExtension.rb +9 -1
- data/lib/wsdl/xmlSchema/complexRestriction.rb +8 -0
- data/lib/wsdl/xmlSchema/complexType.rb +38 -5
- data/lib/wsdl/xmlSchema/data.rb +30 -7
- data/lib/wsdl/xmlSchema/element.rb +10 -2
- data/lib/wsdl/xmlSchema/fractiondigits.rb +37 -0
- data/lib/wsdl/xmlSchema/group.rb +118 -0
- data/lib/wsdl/xmlSchema/import.rb +11 -23
- data/lib/wsdl/xmlSchema/importHandler.rb +45 -0
- data/lib/wsdl/xmlSchema/include.rb +11 -17
- data/lib/wsdl/xmlSchema/length.rb +3 -1
- data/lib/wsdl/xmlSchema/maxexclusive.rb +37 -0
- data/lib/wsdl/xmlSchema/maxinclusive.rb +37 -0
- data/lib/wsdl/xmlSchema/maxlength.rb +3 -1
- data/lib/wsdl/xmlSchema/minexclusive.rb +37 -0
- data/lib/wsdl/xmlSchema/mininclusive.rb +37 -0
- data/lib/wsdl/xmlSchema/minlength.rb +3 -1
- data/lib/wsdl/xmlSchema/schema.rb +34 -0
- data/lib/wsdl/xmlSchema/sequence.rb +4 -1
- data/lib/wsdl/xmlSchema/simpleExtension.rb +8 -0
- data/lib/wsdl/xmlSchema/simpleRestriction.rb +49 -8
- data/lib/wsdl/xmlSchema/totaldigits.rb +37 -0
- data/lib/wsdl/xmlSchema/whitespace.rb +37 -0
- data/lib/wsdl/xmlSchema/xsd2ruby.rb +13 -4
- data/lib/xsd/charset.rb +8 -6
- data/lib/xsd/codegen/classdef.rb +5 -0
- data/lib/xsd/codegen/moduledef.rb +17 -0
- data/lib/xsd/datatypes.rb +165 -20
- data/lib/xsd/mapping.rb +13 -5
- data/lib/xsd/namedelements.rb +8 -0
- data/lib/xsd/ns.rb +50 -14
- data/lib/xsd/qname.rb +3 -2
- data/lib/xsd/xmlparser.rb +4 -3
- data/test/soap/asp.net/test_aspdotnet.rb +1 -1
- data/test/soap/auth/test_basic.rb +4 -3
- data/test/soap/auth/test_digest.rb +4 -3
- data/test/soap/calc/test_calc.rb +6 -4
- data/test/soap/calc/test_calc2.rb +6 -4
- data/test/soap/calc/test_calc_cgi.rb +6 -4
- data/test/soap/fault/test_customfault.rb +6 -4
- data/test/soap/fault/test_soaparray.rb +35 -0
- data/test/soap/filter/test_filter.rb +2 -2
- data/test/soap/header/test_authheader.rb +2 -2
- data/test/soap/header/test_authheader_cgi.rb +3 -3
- data/test/soap/header/test_simplehandler.rb +2 -2
- data/test/soap/helloworld/test_helloworld.rb +6 -4
- data/test/soap/ssl/test_ssl.rb +1 -1
- data/test/soap/struct/test_struct.rb +2 -2
- data/test/soap/swa/test_file.rb +6 -4
- data/test/soap/test_basetype.rb +4 -4
- data/test/soap/test_cookie.rb +2 -2
- data/test/soap/test_custom_ns.rb +50 -8
- data/test/soap/test_custommap.rb +6 -4
- data/test/soap/test_empty.rb +6 -4
- data/test/soap/test_envelopenamespace.rb +2 -2
- data/test/soap/test_extraattr.rb +6 -7
- data/test/soap/test_generator.rb +27 -0
- data/test/soap/test_mapping.rb +10 -0
- data/test/soap/test_nestedexception.rb +56 -0
- data/test/soap/test_nil.rb +6 -4
- data/test/soap/test_no_indent.rb +6 -4
- data/test/soap/test_response_as_xml.rb +2 -2
- data/test/soap/test_streamhandler.rb +6 -3
- data/test/soap/test_styleuse.rb +2 -2
- data/test/soap/wsdlDriver/test_calc.rb +2 -2
- data/test/soap/wsdlDriver/test_document.rb +2 -2
- data/test/soap/wsdlDriver/test_simpletype.rb +2 -2
- data/test/wsdl/abstract/test_abstract.rb +1 -1
- data/test/wsdl/anonymous/expectedClassDef.rb +128 -0
- data/test/wsdl/anonymous/expectedDriver.rb +59 -0
- data/test/wsdl/anonymous/expectedMappingRegistry.rb +176 -0
- data/test/wsdl/anonymous/lp.wsdl +147 -0
- data/test/wsdl/anonymous/test_anonymous.rb +130 -0
- data/test/wsdl/any/expectedDriver.rb +3 -2
- data/test/wsdl/any/expectedEcho.rb +22 -2
- data/test/wsdl/any/expectedMappingRegistry.rb +63 -0
- data/test/wsdl/any/expectedService.rb +3 -1
- data/test/wsdl/any/test_any.rb +2 -7
- data/test/wsdl/axisArray/axisArray.wsdl +31 -4
- data/test/wsdl/axisArray/test_axisarray.rb +58 -3
- data/test/wsdl/choice/choice.wsdl +39 -0
- data/test/wsdl/choice/test_choice.rb +134 -7
- data/test/wsdl/complexcontent/test_echo.rb +1 -1
- data/test/wsdl/datetime/test_datetime.rb +2 -2
- data/test/wsdl/document/array/double.wsdl +45 -6
- data/test/wsdl/document/array/test_array.rb +68 -1
- data/test/wsdl/document/document.wsdl +2 -0
- data/test/wsdl/document/test_nosoapaction.rb +1 -1
- data/test/wsdl/document/test_number.rb +1 -1
- data/test/wsdl/document/test_rpc.rb +78 -9
- data/test/wsdl/fault/test_fault.rb +1 -1
- data/test/wsdl/fault/test_multifault.rb +1 -1
- data/test/wsdl/group/expectedClassdef.rb +58 -0
- data/test/wsdl/group/expectedDriver.rb +51 -0
- data/test/wsdl/group/expectedMappingRegistry.rb +67 -0
- data/test/wsdl/group/group.wsdl +88 -0
- data/test/wsdl/group/test_rpc.rb +145 -0
- data/test/wsdl/list/test_list.rb +1 -1
- data/test/wsdl/map/test_map.rb +2 -2
- data/test/wsdl/marshal/person_org.rb +5 -0
- data/test/wsdl/multiplefault.wsdl +11 -4
- data/test/wsdl/oneway/test_oneway.rb +1 -1
- data/test/wsdl/overload/test_overload.rb +1 -1
- data/test/wsdl/qualified/test_qualified.rb +1 -1
- data/test/wsdl/qualified/test_unqualified.rb +1 -1
- data/test/wsdl/raa/RAAService.rb +62 -57
- data/test/wsdl/raa/expectedClassDef.rb +100 -0
- data/test/wsdl/raa/expectedDriver.rb +96 -0
- data/test/wsdl/raa/expectedMappingRegistry.rb +121 -0
- data/test/wsdl/raa/test_raa.rb +54 -19
- data/test/wsdl/ref/expectedDriver.rb +1 -1
- data/test/wsdl/ref/expectedProduct.rb +101 -16
- data/test/wsdl/ref/test_ref.rb +2 -1
- data/test/wsdl/rpc/test_rpc.rb +1 -2
- data/test/wsdl/rpc/test_rpc_lit.rb +13 -13
- data/test/wsdl/simplecontent/test_simplecontent.rb +5 -5
- data/test/wsdl/simpletype/rpc/expectedDriver.rb +3 -2
- data/test/wsdl/simpletype/rpc/expectedEchoVersion.rb +2 -0
- data/test/wsdl/simpletype/rpc/expectedMappingRegistry.rb +10 -17
- data/test/wsdl/simpletype/rpc/expectedService.rb +4 -2
- data/test/wsdl/simpletype/test_simpletype.rb +2 -2
- data/test/wsdl/soap/test_soapbodyparts.rb +2 -2
- data/test/wsdl/soap/wsdl2ruby/expectedClassdef.rb +2 -0
- data/test/wsdl/soap/wsdl2ruby/expectedDriver.rb +3 -2
- data/test/wsdl/soap/wsdl2ruby/expectedMappingRegistry.rb +5 -9
- data/test/wsdl/soap/wsdl2ruby/expectedService.cgi +4 -2
- data/test/wsdl/soap/wsdl2ruby/expectedService.rb +4 -2
- data/test/wsdl/soap/wsdl2ruby/section/expectedClassdef.rb +6 -0
- data/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb +1 -1
- data/test/wsdl/soaptype/test_soaptype.rb +1 -1
- data/test/wsdl/test_multiplefault.rb +3 -1
- data/test/xsd/codegen/test_classdef.rb +30 -0
- data/test/xsd/test_ns.rb +21 -0
- data/test/xsd/test_xsd.rb +5 -4
- data/test/xsd/xsd2ruby/expected_mysample.rb +13 -2
- data/test/xsd/xsd2ruby/expected_mysample_mapping_registry.rb +5 -11
- data/test/xsd/xsd2ruby/section.xsd +8 -0
- metadata +40 -8
- data/test/wsdl/axisArray/itemList.rb +0 -14
- data/test/wsdl/raa/RAA.rb +0 -120
- data/test/wsdl/raa/RAAServant.rb +0 -107
- data/test/wsdl/raa/server.rb +0 -103
@@ -29,6 +29,16 @@
|
|
29
29
|
</xsd:sequence>
|
30
30
|
</xsd:complexType>
|
31
31
|
|
32
|
+
<xsd:complexType name="emptyArrayAtFirst">
|
33
|
+
<xsd:sequence>
|
34
|
+
<xsd:choice>
|
35
|
+
<xsd:element name="A" maxOccurs="unbounded" type="xsd:string"/>
|
36
|
+
<xsd:element name="B1" type="xsd:string"/>
|
37
|
+
<xsd:element name="B2" type="xsd:string"/>
|
38
|
+
</xsd:choice>
|
39
|
+
</xsd:sequence>
|
40
|
+
</xsd:complexType>
|
41
|
+
|
32
42
|
<xsd:element name="terminalID" minOccurs="1" maxOccurs="1">
|
33
43
|
<xsd:complexType>
|
34
44
|
<xsd:choice>
|
@@ -69,6 +79,14 @@
|
|
69
79
|
</xsd:sequence>
|
70
80
|
</xsd:complexType>
|
71
81
|
</xsd:element>
|
82
|
+
|
83
|
+
<xsd:element name="echoele_complex_emptyArrayAtFirst">
|
84
|
+
<xsd:complexType>
|
85
|
+
<xsd:sequence>
|
86
|
+
<xsd:element name="data" type="tns:emptyArrayAtFirst"/>
|
87
|
+
</xsd:sequence>
|
88
|
+
</xsd:complexType>
|
89
|
+
</xsd:element>
|
72
90
|
</xsd:schema>
|
73
91
|
</types>
|
74
92
|
|
@@ -84,6 +102,12 @@
|
|
84
102
|
<message name="echo_complex_out">
|
85
103
|
<part name="parameters" element="tns:echo_complex_response" />
|
86
104
|
</message>
|
105
|
+
<message name="echo_complex_emptyArrayAtFirst_in">
|
106
|
+
<part name="parameters" element="tns:echoele_complex_emptyArrayAtFirst" />
|
107
|
+
</message>
|
108
|
+
<message name="echo_complex_emptyArrayAtFirst_out">
|
109
|
+
<part name="parameters" element="tns:echoele_complex_emptyArrayAtFirst" />
|
110
|
+
</message>
|
87
111
|
|
88
112
|
<portType name="choice_porttype">
|
89
113
|
<operation name="echo">
|
@@ -95,6 +119,11 @@
|
|
95
119
|
<input message="tns:echo_complex_in" />
|
96
120
|
<output message="tns:echo_complex_out" />
|
97
121
|
</operation>
|
122
|
+
|
123
|
+
<operation name="echo_complex_emptyArrayAtFirst">
|
124
|
+
<input message="tns:echo_complex_emptyArrayAtFirst_in" />
|
125
|
+
<output message="tns:echo_complex_emptyArrayAtFirst_out" />
|
126
|
+
</operation>
|
98
127
|
</portType>
|
99
128
|
|
100
129
|
<binding name="choice_binding" type="tns:choice_porttype">
|
@@ -118,6 +147,16 @@
|
|
118
147
|
<soap:body use="literal" />
|
119
148
|
</output>
|
120
149
|
</operation>
|
150
|
+
|
151
|
+
<operation name="echo_complex_emptyArrayAtFirst">
|
152
|
+
<soap:operation soapAction="urn:choice:echo_complex_emptyArrayAtFirst" style="document" />
|
153
|
+
<input>
|
154
|
+
<soap:body use="literal" />
|
155
|
+
</input>
|
156
|
+
<output>
|
157
|
+
<soap:body use="literal" />
|
158
|
+
</output>
|
159
|
+
</operation>
|
121
160
|
</binding>
|
122
161
|
|
123
162
|
<service name="choice_service">
|
@@ -28,6 +28,13 @@ class TestChoice < Test::Unit::TestCase
|
|
28
28
|
XSD::QName.new(Namespace, 'echoele_complex'),
|
29
29
|
XSD::QName.new(Namespace, 'echo_complex_response')
|
30
30
|
)
|
31
|
+
add_document_method(
|
32
|
+
self,
|
33
|
+
Namespace + ':echo_complex_emptyArrayAtFirst',
|
34
|
+
'echo_complex_emptyArrayAtFirst',
|
35
|
+
XSD::QName.new(Namespace, 'echoele_complex_emptyArrayAtFirst'),
|
36
|
+
XSD::QName.new(Namespace, 'echoele_complex_emptyArrayAtFirst')
|
37
|
+
)
|
31
38
|
@router.literal_mapping_registry = ChoiceMappingRegistry::LiteralRegistry
|
32
39
|
end
|
33
40
|
|
@@ -38,6 +45,10 @@ class TestChoice < Test::Unit::TestCase
|
|
38
45
|
def echo_complex(arg)
|
39
46
|
Echo_complex_response.new(arg.data)
|
40
47
|
end
|
48
|
+
|
49
|
+
def echo_complex_emptyArrayAtFirst(arg)
|
50
|
+
arg
|
51
|
+
end
|
41
52
|
end
|
42
53
|
|
43
54
|
DIR = File.dirname(File.expand_path(__FILE__))
|
@@ -51,7 +62,7 @@ class TestChoice < Test::Unit::TestCase
|
|
51
62
|
end
|
52
63
|
|
53
64
|
def teardown
|
54
|
-
teardown_server
|
65
|
+
teardown_server if @server
|
55
66
|
unless $DEBUG
|
56
67
|
File.unlink(pathname('choice.rb'))
|
57
68
|
File.unlink(pathname('choiceMappingRegistry.rb'))
|
@@ -77,7 +88,7 @@ class TestChoice < Test::Unit::TestCase
|
|
77
88
|
gen.opt['driver'] = nil
|
78
89
|
gen.opt['force'] = true
|
79
90
|
gen.run
|
80
|
-
TestUtil.require(DIR, 'choiceMappingRegistry.rb', 'choice.rb')
|
91
|
+
TestUtil.require(DIR, 'choiceDriver.rb', 'choiceMappingRegistry.rb', 'choice.rb')
|
81
92
|
end
|
82
93
|
|
83
94
|
def teardown_server
|
@@ -129,15 +140,119 @@ class TestChoice < Test::Unit::TestCase
|
|
129
140
|
assert_nil(ret.terminalID.imei)
|
130
141
|
end
|
131
142
|
|
132
|
-
def
|
143
|
+
def test_wsdl_with_map_complex
|
144
|
+
wsdl = File.join(DIR, 'choice.wsdl')
|
145
|
+
@client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
|
146
|
+
@client.endpoint_url = "http://localhost:#{Port}/"
|
147
|
+
@client.wiredump_dev = STDOUT if $DEBUG
|
148
|
+
do_test_with_map_complex(@client)
|
149
|
+
end
|
150
|
+
|
151
|
+
def test_wsdl_with_stub_complex
|
152
|
+
wsdl = File.join(DIR, 'choice.wsdl')
|
153
|
+
@client = ::SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
|
154
|
+
@client.endpoint_url = "http://localhost:#{Port}/"
|
155
|
+
@client.wiredump_dev = STDOUT if $DEBUG
|
156
|
+
@client.literal_mapping_registry = ChoiceMappingRegistry::LiteralRegistry
|
157
|
+
do_test_with_stub_complex(@client)
|
158
|
+
end
|
159
|
+
|
160
|
+
def test_naive_with_map_complex
|
161
|
+
@client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/")
|
162
|
+
@client.add_document_method('echo_complex', 'urn:choice:echo_complex',
|
163
|
+
XSD::QName.new('urn:choice', 'echoele_complex'),
|
164
|
+
XSD::QName.new('urn:choice', 'echo_complex_response'))
|
165
|
+
@client.wiredump_dev = STDOUT if $DEBUG
|
166
|
+
do_test_with_map_complex(@client)
|
167
|
+
end
|
168
|
+
|
169
|
+
def test_naive_with_stub_complex
|
133
170
|
@client = ::SOAP::RPC::Driver.new("http://localhost:#{Port}/")
|
134
171
|
@client.add_document_method('echo_complex', 'urn:choice:echo_complex',
|
135
172
|
XSD::QName.new('urn:choice', 'echoele_complex'),
|
136
173
|
XSD::QName.new('urn:choice', 'echo_complex_response'))
|
137
174
|
@client.wiredump_dev = STDOUT if $DEBUG
|
138
175
|
@client.literal_mapping_registry = ChoiceMappingRegistry::LiteralRegistry
|
176
|
+
do_test_with_stub_complex(@client)
|
177
|
+
end
|
178
|
+
|
179
|
+
def do_test_with_map_complex(client)
|
180
|
+
req = {
|
181
|
+
:data => {
|
182
|
+
:A => "A",
|
183
|
+
:B1 => "B1",
|
184
|
+
:C1 => "C1",
|
185
|
+
:C2 => "C2"
|
186
|
+
}
|
187
|
+
}
|
188
|
+
ret = client.echo_complex(req)
|
189
|
+
assert_equal("A", ret.data["A"])
|
190
|
+
assert_equal("B1", ret.data["B1"])
|
191
|
+
assert_equal(nil, ret.data["B2a"])
|
192
|
+
assert_equal(nil, ret.data["B2b"])
|
193
|
+
assert_equal(nil, ret.data["B3a"])
|
194
|
+
assert_equal(nil, ret.data["B3b"])
|
195
|
+
assert_equal("C1", ret.data["C1"])
|
196
|
+
assert_equal("C2", ret.data["C2"])
|
197
|
+
#
|
198
|
+
req = {
|
199
|
+
:data => {
|
200
|
+
:A => "A",
|
201
|
+
:B2a => "B2a",
|
202
|
+
:B2b => "B2b",
|
203
|
+
:C1 => "C1",
|
204
|
+
:C2 => "C2"
|
205
|
+
}
|
206
|
+
}
|
207
|
+
ret = client.echo_complex(req)
|
208
|
+
assert_equal("A", ret.data["A"])
|
209
|
+
assert_equal(nil, ret.data["B1"])
|
210
|
+
assert_equal("B2a", ret.data["B2a"])
|
211
|
+
assert_equal("B2b", ret.data["B2b"])
|
212
|
+
assert_equal(nil, ret.data["B3a"])
|
213
|
+
assert_equal(nil, ret.data["B3b"])
|
214
|
+
assert_equal("C1", ret.data["C1"])
|
215
|
+
assert_equal("C2", ret.data["C2"])
|
216
|
+
#
|
217
|
+
req = {
|
218
|
+
:data => {
|
219
|
+
:A => "A",
|
220
|
+
:B3a => "B3a",
|
221
|
+
:C1 => "C1",
|
222
|
+
:C2 => "C2"
|
223
|
+
}
|
224
|
+
}
|
225
|
+
ret = client.echo_complex(req)
|
226
|
+
assert_equal("A", ret.data["A"])
|
227
|
+
assert_equal(nil, ret.data["B1"])
|
228
|
+
assert_equal(nil, ret.data["B2a"])
|
229
|
+
assert_equal(nil, ret.data["B2b"])
|
230
|
+
assert_equal("B3a", ret.data["B3a"])
|
231
|
+
assert_equal(nil, ret.data["B3b"])
|
232
|
+
assert_equal("C1", ret.data["C1"])
|
233
|
+
assert_equal("C2", ret.data["C2"])
|
139
234
|
#
|
140
|
-
|
235
|
+
req = {
|
236
|
+
:data => {
|
237
|
+
:A => "A",
|
238
|
+
:B3b => "B3b",
|
239
|
+
:C1 => "C1",
|
240
|
+
:C2 => "C2"
|
241
|
+
}
|
242
|
+
}
|
243
|
+
ret = client.echo_complex(req)
|
244
|
+
assert_equal("A", ret.data["A"])
|
245
|
+
assert_equal(nil, ret.data["B1"])
|
246
|
+
assert_equal(nil, ret.data["B2a"])
|
247
|
+
assert_equal(nil, ret.data["B2b"])
|
248
|
+
assert_equal(nil, ret.data["B3a"])
|
249
|
+
assert_equal("B3b", ret.data["B3b"])
|
250
|
+
assert_equal("C1", ret.data["C1"])
|
251
|
+
assert_equal("C2", ret.data["C2"])
|
252
|
+
end
|
253
|
+
|
254
|
+
def do_test_with_stub_complex(client)
|
255
|
+
ret = client.echo_complex(Echoele_complex.new(Andor.new("A", "B1", nil, nil, nil, nil, "C1", "C2")))
|
141
256
|
assert_equal("A", ret.data.a)
|
142
257
|
assert_equal("B1", ret.data.b1)
|
143
258
|
assert_equal(nil, ret.data.b2a)
|
@@ -147,7 +262,7 @@ class TestChoice < Test::Unit::TestCase
|
|
147
262
|
assert_equal("C1", ret.data.c1)
|
148
263
|
assert_equal("C2", ret.data.c2)
|
149
264
|
#
|
150
|
-
ret =
|
265
|
+
ret = client.echo_complex(Echoele_complex.new(Andor.new("A", nil, "B2a", "B2b", nil, nil, "C1", "C2")))
|
151
266
|
assert_equal("A", ret.data.a)
|
152
267
|
assert_equal(nil, ret.data.b1)
|
153
268
|
assert_equal("B2a", ret.data.b2a)
|
@@ -157,7 +272,7 @@ class TestChoice < Test::Unit::TestCase
|
|
157
272
|
assert_equal("C1", ret.data.c1)
|
158
273
|
assert_equal("C2", ret.data.c2)
|
159
274
|
#
|
160
|
-
ret =
|
275
|
+
ret = client.echo_complex(Echoele_complex.new(Andor.new("A", nil, nil, nil, "B3a", nil, "C1", "C2")))
|
161
276
|
assert_equal("A", ret.data.a)
|
162
277
|
assert_equal(nil, ret.data.b1)
|
163
278
|
assert_equal(nil, ret.data.b2a)
|
@@ -167,7 +282,7 @@ class TestChoice < Test::Unit::TestCase
|
|
167
282
|
assert_equal("C1", ret.data.c1)
|
168
283
|
assert_equal("C2", ret.data.c2)
|
169
284
|
#
|
170
|
-
ret =
|
285
|
+
ret = client.echo_complex(Echoele_complex.new(Andor.new("A", nil, nil, nil, nil, "B3b", "C1", "C2")))
|
171
286
|
assert_equal("A", ret.data.a)
|
172
287
|
assert_equal(nil, ret.data.b1)
|
173
288
|
assert_equal(nil, ret.data.b2a)
|
@@ -177,6 +292,18 @@ class TestChoice < Test::Unit::TestCase
|
|
177
292
|
assert_equal("C1", ret.data.c1)
|
178
293
|
assert_equal("C2", ret.data.c2)
|
179
294
|
end
|
295
|
+
|
296
|
+
def test_stub_emptyArrayAtFirst
|
297
|
+
@client = Choice_porttype.new("http://localhost:#{Port}/")
|
298
|
+
@client.wiredump_dev = STDOUT if $DEBUG
|
299
|
+
#
|
300
|
+
arg = EmptyArrayAtFirst.new
|
301
|
+
arg.b1 = "b1"
|
302
|
+
ret = @client.echo_complex_emptyArrayAtFirst(Echoele_complex_emptyArrayAtFirst.new(arg))
|
303
|
+
assert_nil(ret.data.a)
|
304
|
+
assert_equal("b1", ret.data.b1)
|
305
|
+
assert_nil(ret.data.b2)
|
306
|
+
end
|
180
307
|
end
|
181
308
|
|
182
309
|
|
@@ -7,30 +7,43 @@
|
|
7
7
|
xmlns:tns="http://tempuri.org/"
|
8
8
|
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
|
9
9
|
<wsdl:types>
|
10
|
-
<s:schema elementFormDefault="qualified"
|
11
|
-
|
10
|
+
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
|
11
|
+
|
12
|
+
<s:element name="ArrayOfRecord">
|
13
|
+
<s:complexType>
|
14
|
+
<s:sequence>
|
15
|
+
<s:element maxOccurs="unbounded" name="record" type="tns:report-record"/>
|
16
|
+
</s:sequence>
|
17
|
+
</s:complexType>
|
18
|
+
</s:element>
|
19
|
+
<s:complexType name="report-record">
|
20
|
+
<s:attribute name="a" type="s:string" />
|
21
|
+
<s:attribute name="b" type="s:string" />
|
22
|
+
<s:attribute name="c" type="s:string" />
|
23
|
+
</s:complexType>
|
24
|
+
|
12
25
|
<s:complexType name="ArrayOfDouble">
|
13
26
|
<s:sequence>
|
14
27
|
<s:element minOccurs="0" maxOccurs="unbounded" name="double"
|
15
28
|
type="s:double"/>
|
16
29
|
</s:sequence>
|
17
30
|
</s:complexType>
|
31
|
+
|
18
32
|
<s:element name="echo">
|
19
33
|
<s:complexType>
|
20
34
|
<s:sequence>
|
21
|
-
<s:element
|
22
|
-
type="tns:ArrayOfDouble"/>
|
35
|
+
<s:element nillable="true" maxOccurs="1" name="ary" type="tns:ArrayOfDouble"/>
|
23
36
|
</s:sequence>
|
24
37
|
</s:complexType>
|
25
38
|
</s:element>
|
26
39
|
<s:element name="echoResponse">
|
27
40
|
<s:complexType>
|
28
41
|
<s:sequence>
|
29
|
-
<s:element
|
30
|
-
type="tns:ArrayOfDouble"/>
|
42
|
+
<s:element nillable="true" maxOccurs="1" name="ary" type="tns:ArrayOfDouble"/>
|
31
43
|
</s:sequence>
|
32
44
|
</s:complexType>
|
33
45
|
</s:element>
|
46
|
+
|
34
47
|
<s:element name="ArrayOfDouble" nillable="true" type="tns:ArrayOfDouble"/>
|
35
48
|
|
36
49
|
<s:element name="echo2">
|
@@ -40,6 +53,7 @@
|
|
40
53
|
</s:sequence>
|
41
54
|
</s:complexType>
|
42
55
|
</s:element>
|
56
|
+
|
43
57
|
<s:element name="echo2Response">
|
44
58
|
<s:complexType>
|
45
59
|
<s:sequence>
|
@@ -47,6 +61,7 @@
|
|
47
61
|
</s:sequence>
|
48
62
|
</s:complexType>
|
49
63
|
</s:element>
|
64
|
+
|
50
65
|
<s:element name="ArrayOfComplex">
|
51
66
|
<s:complexType>
|
52
67
|
<s:sequence>
|
@@ -54,6 +69,7 @@
|
|
54
69
|
</s:sequence>
|
55
70
|
</s:complexType>
|
56
71
|
</s:element>
|
72
|
+
|
57
73
|
<s:element name="Complex">
|
58
74
|
<s:complexType>
|
59
75
|
<s:sequence>
|
@@ -77,6 +93,12 @@
|
|
77
93
|
<wsdl:message name="echo2Out">
|
78
94
|
<wsdl:part name="parameters" element="tns:echo2Response"/>
|
79
95
|
</wsdl:message>
|
96
|
+
<wsdl:message name="echo3In">
|
97
|
+
<wsdl:part name="parameters" element="tns:ArrayOfRecord"/>
|
98
|
+
</wsdl:message>
|
99
|
+
<wsdl:message name="echo3Out">
|
100
|
+
<wsdl:part name="parameters" element="tns:ArrayOfRecord"/>
|
101
|
+
</wsdl:message>
|
80
102
|
|
81
103
|
<wsdl:portType name="pricerSoap">
|
82
104
|
<wsdl:operation name="echo">
|
@@ -88,11 +110,17 @@
|
|
88
110
|
<wsdl:input message="tns:echo2In"/>
|
89
111
|
<wsdl:output message="tns:echo2Out"/>
|
90
112
|
</wsdl:operation>
|
113
|
+
|
114
|
+
<wsdl:operation name="echo3">
|
115
|
+
<wsdl:input message="tns:echo3In"/>
|
116
|
+
<wsdl:output message="tns:echo3Out"/>
|
117
|
+
</wsdl:operation>
|
91
118
|
</wsdl:portType>
|
92
119
|
|
93
120
|
<wsdl:binding name="pricerSoap" type="tns:pricerSoap">
|
94
121
|
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
|
95
122
|
style="document"/>
|
123
|
+
|
96
124
|
<wsdl:operation name="echo">
|
97
125
|
<soap:operation soapAction="http://tempuri.org/echo" style="document"/>
|
98
126
|
<wsdl:input>
|
@@ -102,6 +130,7 @@
|
|
102
130
|
<soap:body use="literal"/>
|
103
131
|
</wsdl:output>
|
104
132
|
</wsdl:operation>
|
133
|
+
|
105
134
|
<wsdl:operation name="echo2">
|
106
135
|
<soap:operation soapAction="http://tempuri.org/echo2" style="document"/>
|
107
136
|
<wsdl:input>
|
@@ -111,6 +140,16 @@
|
|
111
140
|
<soap:body use="literal"/>
|
112
141
|
</wsdl:output>
|
113
142
|
</wsdl:operation>
|
143
|
+
|
144
|
+
<wsdl:operation name="echo3">
|
145
|
+
<soap:operation soapAction="http://tempuri.org/echo3" style="document"/>
|
146
|
+
<wsdl:input>
|
147
|
+
<soap:body use="literal"/>
|
148
|
+
</wsdl:input>
|
149
|
+
<wsdl:output>
|
150
|
+
<soap:body use="literal"/>
|
151
|
+
</wsdl:output>
|
152
|
+
</wsdl:operation>
|
114
153
|
</wsdl:binding>
|
115
154
|
|
116
155
|
<wsdl:service name="pricer">
|
@@ -28,6 +28,13 @@ class TestArray < Test::Unit::TestCase
|
|
28
28
|
XSD::QName.new(Namespace, 'echo2'),
|
29
29
|
XSD::QName.new(Namespace, 'echo2Response')
|
30
30
|
)
|
31
|
+
add_document_method(
|
32
|
+
self,
|
33
|
+
Namespace + 'echo3',
|
34
|
+
'echo3',
|
35
|
+
XSD::QName.new(Namespace, 'ArrayOfRecord'),
|
36
|
+
XSD::QName.new(Namespace, 'ArrayOfRecord')
|
37
|
+
)
|
31
38
|
self.literal_mapping_registry = DoubleMappingRegistry::LiteralRegistry
|
32
39
|
end
|
33
40
|
|
@@ -38,6 +45,10 @@ class TestArray < Test::Unit::TestCase
|
|
38
45
|
def echo2(arg)
|
39
46
|
arg
|
40
47
|
end
|
48
|
+
|
49
|
+
def echo3(arg)
|
50
|
+
arg
|
51
|
+
end
|
41
52
|
end
|
42
53
|
|
43
54
|
DIR = File.dirname(File.expand_path(__FILE__))
|
@@ -51,7 +62,7 @@ class TestArray < Test::Unit::TestCase
|
|
51
62
|
end
|
52
63
|
|
53
64
|
def teardown
|
54
|
-
teardown_server
|
65
|
+
teardown_server if @server
|
55
66
|
unless $DEBUG
|
56
67
|
File.unlink(pathname('double.rb'))
|
57
68
|
File.unlink(pathname('doubleMappingRegistry.rb'))
|
@@ -128,6 +139,62 @@ class TestArray < Test::Unit::TestCase
|
|
128
139
|
double = [0.1, 0.2, 0.3]
|
129
140
|
assert_equal(double, @client.echo(:ary => double).ary)
|
130
141
|
end
|
142
|
+
|
143
|
+
def test_stub
|
144
|
+
@client = ::WSDL::Document::PricerSoap.new("http://localhost:#{Port}/")
|
145
|
+
@client.wiredump_dev = STDOUT if $DEBUG
|
146
|
+
double = [0.1, 0.2, 0.3]
|
147
|
+
assert_equal(double, @client.echo(:ary => double).ary)
|
148
|
+
end
|
149
|
+
|
150
|
+
def test_stub_nil
|
151
|
+
@client = ::WSDL::Document::PricerSoap.new("http://localhost:#{Port}/")
|
152
|
+
@client.wiredump_dev = STDOUT if $DEBUG
|
153
|
+
assert_equal(nil, @client.echo(Echo.new).ary)
|
154
|
+
end
|
155
|
+
|
156
|
+
def test_attribute_array
|
157
|
+
@client = ::WSDL::Document::PricerSoap.new("http://localhost:#{Port}/")
|
158
|
+
@client.wiredump_dev = STDOUT if $DEBUG
|
159
|
+
#
|
160
|
+
r1 = ReportRecord.new
|
161
|
+
r1.xmlattr_a = "r1_xmlattr_a"
|
162
|
+
r1.xmlattr_b = "r1_xmlattr_b"
|
163
|
+
r1.xmlattr_c = "r1_xmlattr_c"
|
164
|
+
r2 = ReportRecord.new
|
165
|
+
r2.xmlattr_a = "r2_xmlattr_a"
|
166
|
+
r2.xmlattr_b = "r2_xmlattr_b"
|
167
|
+
r2.xmlattr_c = "r2_xmlattr_c"
|
168
|
+
arg = ArrayOfRecord[r1, r2]
|
169
|
+
ret = @client.echo3(arg)
|
170
|
+
assert_equal(arg.class , ret.class)
|
171
|
+
assert_equal(arg.size , ret.size)
|
172
|
+
assert_equal(2, ret.size)
|
173
|
+
assert_equal(arg[0].class, ret[0].class)
|
174
|
+
assert_equal(arg[0].xmlattr_a, ret[0].xmlattr_a)
|
175
|
+
assert_equal(arg[0].xmlattr_b, ret[0].xmlattr_b)
|
176
|
+
assert_equal(arg[0].xmlattr_c, ret[0].xmlattr_c)
|
177
|
+
assert_equal(arg[1].class, ret[1].class)
|
178
|
+
assert_equal(arg[1].xmlattr_a, ret[1].xmlattr_a)
|
179
|
+
assert_equal(arg[1].xmlattr_b, ret[1].xmlattr_b)
|
180
|
+
assert_equal(arg[1].xmlattr_c, ret[1].xmlattr_c)
|
181
|
+
#
|
182
|
+
arg = ArrayOfRecord[r1]
|
183
|
+
ret = @client.echo3(arg)
|
184
|
+
assert_equal(arg.class , ret.class)
|
185
|
+
assert_equal(arg.size , ret.size)
|
186
|
+
assert_equal(1, ret.size)
|
187
|
+
assert_equal(arg[0].class, ret[0].class)
|
188
|
+
assert_equal(arg[0].xmlattr_a, ret[0].xmlattr_a)
|
189
|
+
assert_equal(arg[0].xmlattr_b, ret[0].xmlattr_b)
|
190
|
+
assert_equal(arg[0].xmlattr_c, ret[0].xmlattr_c)
|
191
|
+
#
|
192
|
+
arg = ArrayOfRecord[]
|
193
|
+
ret = @client.echo3(arg)
|
194
|
+
assert_equal(arg.class , ret.class)
|
195
|
+
assert_equal(arg.size , ret.size)
|
196
|
+
assert_equal(0, ret.size)
|
197
|
+
end
|
131
198
|
end
|
132
199
|
|
133
200
|
|