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
@@ -0,0 +1,130 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'wsdl/soap/wsdl2ruby'
|
3
|
+
require 'soap/rpc/standaloneServer'
|
4
|
+
require 'soap/wsdlDriver'
|
5
|
+
require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb')
|
6
|
+
|
7
|
+
|
8
|
+
if defined?(HTTPClient)
|
9
|
+
|
10
|
+
module WSDL; module Anonymous
|
11
|
+
|
12
|
+
|
13
|
+
class TestAnonymous < Test::Unit::TestCase
|
14
|
+
class Server < ::SOAP::RPC::StandaloneServer
|
15
|
+
Namespace = 'urn:lp'
|
16
|
+
|
17
|
+
def on_init
|
18
|
+
add_document_method(
|
19
|
+
self,
|
20
|
+
Namespace + ':login',
|
21
|
+
'login',
|
22
|
+
XSD::QName.new(Namespace, 'login'),
|
23
|
+
XSD::QName.new(Namespace, 'loginResponse')
|
24
|
+
)
|
25
|
+
add_document_method(
|
26
|
+
self,
|
27
|
+
Namespace + ':echo',
|
28
|
+
'echo',
|
29
|
+
XSD::QName.new(Namespace, 'Pack'),
|
30
|
+
XSD::QName.new(Namespace, 'Envelope')
|
31
|
+
)
|
32
|
+
self.literal_mapping_registry = LpMappingRegistry::LiteralRegistry
|
33
|
+
end
|
34
|
+
|
35
|
+
def login(arg)
|
36
|
+
req = arg.loginRequest
|
37
|
+
sess = [req.username, req.password, req.timezone].join
|
38
|
+
LoginResponse.new(LoginResponse::LoginResult.new(sess))
|
39
|
+
end
|
40
|
+
|
41
|
+
def echo(pack)
|
42
|
+
raise unless pack.class == Pack
|
43
|
+
raise unless pack.header.class == Pack::Header
|
44
|
+
Envelope.new(Envelope::Header.new(pack.header.header1))
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
DIR = File.dirname(File.expand_path(__FILE__))
|
49
|
+
Port = 17171
|
50
|
+
|
51
|
+
def setup
|
52
|
+
setup_clientdef
|
53
|
+
setup_server
|
54
|
+
@client = nil
|
55
|
+
end
|
56
|
+
|
57
|
+
def teardown
|
58
|
+
teardown_server if @server
|
59
|
+
unless $DEBUG
|
60
|
+
File.unlink(pathname('lp.rb'))
|
61
|
+
File.unlink(pathname('lpMappingRegistry.rb'))
|
62
|
+
File.unlink(pathname('lpDriver.rb'))
|
63
|
+
end
|
64
|
+
@client.reset_stream if @client
|
65
|
+
end
|
66
|
+
|
67
|
+
def setup_server
|
68
|
+
@server = Server.new('Test', "urn:lp", '0.0.0.0', Port)
|
69
|
+
@server.level = Logger::Severity::ERROR
|
70
|
+
@server_thread = TestUtil.start_server_thread(@server)
|
71
|
+
end
|
72
|
+
|
73
|
+
def setup_clientdef
|
74
|
+
gen = WSDL::SOAP::WSDL2Ruby.new
|
75
|
+
gen.location = pathname("lp.wsdl")
|
76
|
+
gen.basedir = DIR
|
77
|
+
gen.logger.level = Logger::FATAL
|
78
|
+
gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '')
|
79
|
+
gen.opt['classdef'] = nil
|
80
|
+
gen.opt['mapping_registry'] = nil
|
81
|
+
gen.opt['driver'] = nil
|
82
|
+
gen.opt['force'] = true
|
83
|
+
gen.run
|
84
|
+
TestUtil.require(DIR, 'lpDriver.rb', 'lpMappingRegistry.rb', 'lp.rb')
|
85
|
+
end
|
86
|
+
|
87
|
+
def teardown_server
|
88
|
+
@server.shutdown
|
89
|
+
@server_thread.kill
|
90
|
+
@server_thread.join
|
91
|
+
end
|
92
|
+
|
93
|
+
def pathname(filename)
|
94
|
+
File.join(DIR, filename)
|
95
|
+
end
|
96
|
+
|
97
|
+
def compare(expected, actual)
|
98
|
+
TestUtil.filecompare(pathname(expected), pathname(actual))
|
99
|
+
end
|
100
|
+
|
101
|
+
def test_stubgeneration
|
102
|
+
compare("expectedClassDef.rb", "lp.rb")
|
103
|
+
compare("expectedMappingRegistry.rb", "lpMappingRegistry.rb")
|
104
|
+
compare("expectedDriver.rb", "lpDriver.rb")
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_stub
|
108
|
+
@client = Lp_porttype.new("http://localhost:#{Port}/")
|
109
|
+
@client.wiredump_dev = STDERR if $DEBUG
|
110
|
+
request = Login.new(Login::LoginRequest.new("username", "password", "tz"))
|
111
|
+
response = @client.login(request)
|
112
|
+
assert_equal(LoginResponse::LoginResult, response.loginResult.class)
|
113
|
+
assert_equal("usernamepasswordtz", response.loginResult.sessionID)
|
114
|
+
end
|
115
|
+
|
116
|
+
def test_anonymous_mapping
|
117
|
+
@client = Lp_porttype.new("http://localhost:#{Port}/")
|
118
|
+
@client.wiredump_dev = STDERR if $DEBUG
|
119
|
+
request = Pack.new(Pack::Header.new("pack_header"))
|
120
|
+
response = @client.echo(request)
|
121
|
+
assert_equal(Envelope, response.class)
|
122
|
+
assert_equal(Envelope::Header, response.header.class)
|
123
|
+
assert_equal("pack_header", response.header.header2)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
|
128
|
+
end; end
|
129
|
+
|
130
|
+
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
require 'echo.rb'
|
2
2
|
require 'echoMappingRegistry.rb'
|
3
|
+
require 'soap/rpc/driver'
|
3
4
|
|
4
5
|
module WSDL::Any
|
5
|
-
require 'soap/rpc/driver'
|
6
6
|
|
7
7
|
class Echo_port_type < ::SOAP::RPC::Driver
|
8
8
|
DefaultEndpointUrl = "http://localhost:10080"
|
9
|
+
NsEcho = "urn:example.com:echo"
|
9
10
|
|
10
11
|
Methods = [
|
11
12
|
[ "urn:example.com:echo",
|
@@ -16,7 +17,7 @@ class Echo_port_type < ::SOAP::RPC::Driver
|
|
16
17
|
:response_style => :document, :response_use => :literal,
|
17
18
|
:faults => {} }
|
18
19
|
],
|
19
|
-
[ XSD::QName.new(
|
20
|
+
[ XSD::QName.new(NsEcho, "echoAny"),
|
20
21
|
"urn:example.com:echoAny",
|
21
22
|
"echoAny",
|
22
23
|
[ ["retval", "echoany_return", [nil]] ],
|
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'xsd/qname'
|
2
2
|
|
3
|
-
module WSDL
|
3
|
+
module WSDL; module Any
|
4
4
|
|
5
5
|
|
6
6
|
# {urn:example.com:echo-type}foo.bar
|
7
|
+
# before - SOAP::SOAPString
|
8
|
+
# after - SOAP::SOAPString
|
7
9
|
class FooBar
|
8
10
|
attr_accessor :before
|
9
11
|
attr_reader :__xmlele_any
|
@@ -21,7 +23,25 @@ class FooBar
|
|
21
23
|
end
|
22
24
|
|
23
25
|
# {urn:example.com:echo-type}setOutputAndCompleteRequest
|
26
|
+
# taskId - SOAP::SOAPString
|
27
|
+
# data - WSDL::Any::SetOutputAndCompleteRequest::C_Data
|
28
|
+
# participantToken - SOAP::SOAPString
|
24
29
|
class SetOutputAndCompleteRequest
|
30
|
+
|
31
|
+
# inner class for member: data
|
32
|
+
# {}data
|
33
|
+
class C_Data
|
34
|
+
attr_reader :__xmlele_any
|
35
|
+
|
36
|
+
def set_any(elements)
|
37
|
+
@__xmlele_any = elements
|
38
|
+
end
|
39
|
+
|
40
|
+
def initialize
|
41
|
+
@__xmlele_any = nil
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
25
45
|
attr_accessor :taskId
|
26
46
|
attr_accessor :data
|
27
47
|
attr_accessor :participantToken
|
@@ -34,4 +54,4 @@ class SetOutputAndCompleteRequest
|
|
34
54
|
end
|
35
55
|
|
36
56
|
|
37
|
-
end
|
57
|
+
end; end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'echo.rb'
|
2
|
+
require 'soap/mapping'
|
3
|
+
|
4
|
+
module WSDL; module Any
|
5
|
+
|
6
|
+
module EchoMappingRegistry
|
7
|
+
EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new
|
8
|
+
LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new
|
9
|
+
NsEchoType = "urn:example.com:echo-type"
|
10
|
+
NsXMLSchema = "http://www.w3.org/2001/XMLSchema"
|
11
|
+
|
12
|
+
EncodedRegistry.register(
|
13
|
+
:class => WSDL::Any::FooBar,
|
14
|
+
:schema_type => XSD::QName.new(NsEchoType, "foo.bar"),
|
15
|
+
:schema_element => [
|
16
|
+
["before", ["SOAP::SOAPString", XSD::QName.new(nil, "before")]],
|
17
|
+
["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]],
|
18
|
+
["after", ["SOAP::SOAPString", XSD::QName.new(nil, "after")]]
|
19
|
+
]
|
20
|
+
)
|
21
|
+
|
22
|
+
LiteralRegistry.register(
|
23
|
+
:class => WSDL::Any::FooBar,
|
24
|
+
:schema_type => XSD::QName.new(NsEchoType, "foo.bar"),
|
25
|
+
:schema_element => [
|
26
|
+
["before", ["SOAP::SOAPString", XSD::QName.new(nil, "before")]],
|
27
|
+
["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]],
|
28
|
+
["after", ["SOAP::SOAPString", XSD::QName.new(nil, "after")]]
|
29
|
+
]
|
30
|
+
)
|
31
|
+
|
32
|
+
LiteralRegistry.register(
|
33
|
+
:class => WSDL::Any::FooBar,
|
34
|
+
:schema_name => XSD::QName.new(NsEchoType, "foo.bar"),
|
35
|
+
:schema_element => [
|
36
|
+
["before", ["SOAP::SOAPString", XSD::QName.new(nil, "before")]],
|
37
|
+
["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]],
|
38
|
+
["after", ["SOAP::SOAPString", XSD::QName.new(nil, "after")]]
|
39
|
+
]
|
40
|
+
)
|
41
|
+
|
42
|
+
LiteralRegistry.register(
|
43
|
+
:class => WSDL::Any::SetOutputAndCompleteRequest,
|
44
|
+
:schema_name => XSD::QName.new(NsEchoType, "setOutputAndCompleteRequest"),
|
45
|
+
:schema_element => [
|
46
|
+
["taskId", ["SOAP::SOAPString", XSD::QName.new(nil, "taskId")]],
|
47
|
+
["data", ["WSDL::Any::SetOutputAndCompleteRequest::C_Data", XSD::QName.new(nil, "data")]],
|
48
|
+
["participantToken", ["SOAP::SOAPString", XSD::QName.new(nil, "participantToken")]]
|
49
|
+
]
|
50
|
+
)
|
51
|
+
|
52
|
+
LiteralRegistry.register(
|
53
|
+
:class => WSDL::Any::SetOutputAndCompleteRequest::C_Data,
|
54
|
+
:schema_name => XSD::QName.new(nil, "data"),
|
55
|
+
:is_anonymous => true,
|
56
|
+
:schema_qualified => false,
|
57
|
+
:schema_element => [
|
58
|
+
["any", [nil, XSD::QName.new(NsXMLSchema, "anyType")]]
|
59
|
+
]
|
60
|
+
)
|
61
|
+
end
|
62
|
+
|
63
|
+
end; end
|
@@ -6,6 +6,8 @@ require 'soap/rpc/standaloneServer'
|
|
6
6
|
module WSDL; module Any
|
7
7
|
|
8
8
|
class Echo_port_type
|
9
|
+
NsEcho = "urn:example.com:echo"
|
10
|
+
|
9
11
|
Methods = [
|
10
12
|
[ "urn:example.com:echo",
|
11
13
|
"echo",
|
@@ -15,7 +17,7 @@ class Echo_port_type
|
|
15
17
|
:response_style => :document, :response_use => :literal,
|
16
18
|
:faults => {} }
|
17
19
|
],
|
18
|
-
[ XSD::QName.new(
|
20
|
+
[ XSD::QName.new(NsEcho, "echoAny"),
|
19
21
|
"urn:example.com:echoAny",
|
20
22
|
"echoAny",
|
21
23
|
[ ["retval", "echoany_return", [nil]] ],
|
data/test/wsdl/any/test_any.rb
CHANGED
@@ -73,7 +73,7 @@ class TestAny < Test::Unit::TestCase
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def teardown
|
76
|
-
teardown_server
|
76
|
+
teardown_server if @server
|
77
77
|
unless $DEBUG
|
78
78
|
File.unlink(pathname('echo.rb')) if File.exist?(pathname('echo.rb'))
|
79
79
|
File.unlink(pathname('echoMappingRegistry.rb')) if File.exist?(pathname('echoMappingRegistry.rb'))
|
@@ -132,14 +132,9 @@ class TestAny < Test::Unit::TestCase
|
|
132
132
|
gen.run
|
133
133
|
end
|
134
134
|
compare("expectedEcho.rb", "echo.rb")
|
135
|
+
compare("expectedMappingRegistry.rb", "echoMappingRegistry.rb")
|
135
136
|
compare("expectedDriver.rb", "echoDriver.rb")
|
136
137
|
compare("expectedService.rb", "echo_service.rb")
|
137
|
-
|
138
|
-
File.unlink(pathname("echo_service.rb"))
|
139
|
-
File.unlink(pathname("echo.rb"))
|
140
|
-
File.unlink(pathname("echo_serviceClient.rb"))
|
141
|
-
File.unlink(pathname("echoDriver.rb"))
|
142
|
-
File.unlink(pathname("echoServant.rb"))
|
143
138
|
end
|
144
139
|
|
145
140
|
def compare(expected, actual)
|
@@ -21,6 +21,12 @@
|
|
21
21
|
<element maxOccurs="unbounded" minOccurs="0" name="Item" type="typens:Item"/>
|
22
22
|
</sequence>
|
23
23
|
</complexType>
|
24
|
+
|
25
|
+
<complexType name="MeetingInfo">
|
26
|
+
<sequence>
|
27
|
+
<element name="meetingId" type="xsd:long"/>
|
28
|
+
</sequence>
|
29
|
+
</complexType>
|
24
30
|
</schema>
|
25
31
|
</wsdl:types>
|
26
32
|
|
@@ -30,11 +36,21 @@
|
|
30
36
|
<wsdl:part name="list" type="typens:ItemList"/>
|
31
37
|
</wsdl:message>
|
32
38
|
|
39
|
+
<wsdl:message name="getMeetingInfoRequest"/>
|
40
|
+
|
41
|
+
<wsdl:message name="getMeetingInfoResponse">
|
42
|
+
<wsdl:part name="getMeetingInfoReturn" type="typens:MeetingInfo"/>
|
43
|
+
</wsdl:message>
|
44
|
+
|
33
45
|
<wsdl:portType name="ItemListPortType">
|
34
46
|
<wsdl:operation name="listItem">
|
35
47
|
<wsdl:input message="tns:listItemRequest" name="listItemRequest"/>
|
36
48
|
<wsdl:output message="tns:listItemResponse" name="listItemResponse"/>
|
37
49
|
</wsdl:operation>
|
50
|
+
<wsdl:operation name="getMeetingInfo">
|
51
|
+
<wsdl:input name="getMeetingInfoRequest" message="tns:getMeetingInfoRequest"/>
|
52
|
+
<wsdl:output name="getMeetingInfoResponse" message="tns:getMeetingInfoResponse"/>
|
53
|
+
</wsdl:operation>
|
38
54
|
</wsdl:portType>
|
39
55
|
|
40
56
|
<wsdl:binding name="ItemListBinding" type="tns:ItemListPortType">
|
@@ -42,12 +58,23 @@
|
|
42
58
|
<wsdl:operation name="listItem">
|
43
59
|
<soap:operation soapAction=""/>
|
44
60
|
<wsdl:input name="listItemRequest">
|
45
|
-
|
46
|
-
|
61
|
+
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
62
|
+
namespace="urn:jp.gr.jin.rrr.example.itemList" use="encoded"/>
|
47
63
|
</wsdl:input>
|
48
64
|
<wsdl:output name="listItemResponse">
|
49
|
-
|
50
|
-
|
65
|
+
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
66
|
+
namespace="urn:jp.gr.jin.rrr.example.itemList" use="encoded"/>
|
67
|
+
</wsdl:output>
|
68
|
+
</wsdl:operation>
|
69
|
+
<wsdl:operation name="getMeetingInfo">
|
70
|
+
<soap:operation soapAction=""/>
|
71
|
+
<wsdl:input name="getMeetingInfoRequest">
|
72
|
+
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
73
|
+
namespace="urn:jp.gr.jin.rrr.example.itemList"/>
|
74
|
+
</wsdl:input>
|
75
|
+
<wsdl:output name="getMeetingInfoResponse">
|
76
|
+
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
77
|
+
namespace="urn:jp.gr.jin.rrr.example.itemList"/>
|
51
78
|
</wsdl:output>
|
52
79
|
</wsdl:operation>
|
53
80
|
</wsdl:binding>
|
@@ -3,13 +3,17 @@ require 'soap/processor'
|
|
3
3
|
require 'soap/mapping'
|
4
4
|
require 'soap/rpc/element'
|
5
5
|
require 'wsdl/importer'
|
6
|
-
require '
|
6
|
+
require 'wsdl/soap/wsdl2ruby'
|
7
|
+
require File.join(File.dirname(File.expand_path(__FILE__)), '..', '..', 'testutil.rb')
|
7
8
|
|
8
9
|
|
9
10
|
module WSDL
|
11
|
+
module AxisArray
|
10
12
|
|
11
13
|
|
12
14
|
class TestAxisArray < Test::Unit::TestCase
|
15
|
+
DIR = File.dirname(File.expand_path(__FILE__))
|
16
|
+
|
13
17
|
def setup
|
14
18
|
@xml =<<__EOX__
|
15
19
|
<?xml version="1.0" encoding="UTF-8"?>
|
@@ -35,11 +39,35 @@ class TestAxisArray < Test::Unit::TestCase
|
|
35
39
|
</soapenv:Body>
|
36
40
|
</soapenv:Envelope>
|
37
41
|
__EOX__
|
42
|
+
setup_classdef
|
43
|
+
end
|
44
|
+
|
45
|
+
def teardown
|
46
|
+
unless $DEBUG
|
47
|
+
File.unlink(pathname('itemList.rb'))
|
48
|
+
File.unlink(pathname('itemListMappingRegistry.rb'))
|
49
|
+
File.unlink(pathname('itemListDriver.rb'))
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def setup_classdef
|
54
|
+
gen = WSDL::SOAP::WSDL2Ruby.new
|
55
|
+
gen.location = pathname("axisArray.wsdl")
|
56
|
+
gen.basedir = DIR
|
57
|
+
gen.logger.level = Logger::FATAL
|
58
|
+
gen.opt['classdef'] = nil
|
59
|
+
gen.opt['mapping_registry'] = nil
|
60
|
+
gen.opt['module_path'] = self.class.to_s.sub(/::[^:]+$/, '')
|
61
|
+
gen.opt['driver'] = nil
|
62
|
+
gen.opt['force'] = true
|
63
|
+
gen.run
|
64
|
+
TestUtil.require(DIR, 'itemListDriver.rb', 'itemList.rb', 'itemListMappingRegistry.rb')
|
38
65
|
end
|
39
66
|
|
40
67
|
def test_by_stub
|
41
|
-
|
42
|
-
|
68
|
+
driver = ItemListPortType.new
|
69
|
+
driver.test_loopback_response << @xml
|
70
|
+
ary = driver.listItem
|
43
71
|
assert_equal(3, ary.size)
|
44
72
|
assert_equal("name1", ary[0].name)
|
45
73
|
assert_equal("name2", ary[1].name)
|
@@ -63,7 +91,34 @@ __EOX__
|
|
63
91
|
assert_equal("name2", ary[1].name)
|
64
92
|
assert_equal("name3", ary[2].name)
|
65
93
|
end
|
94
|
+
|
95
|
+
XML_LONG = <<__XML__
|
96
|
+
<?xml version="1.0" encoding="utf-8"?>
|
97
|
+
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
98
|
+
<soapenv:Body>
|
99
|
+
<ns1:getMeetingInfoResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:jp.gr.jin.rrr.example.itemList">
|
100
|
+
<getMeetingInfoReturn href="#id0"/>
|
101
|
+
</ns1:getMeetingInfoResponse>
|
102
|
+
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:MeetingInfo" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:long">
|
103
|
+
<meetingId href="#id11"/>
|
104
|
+
</multiRef>
|
105
|
+
<multiRef id="id11" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">105759347</multiRef>
|
106
|
+
</soapenv:Body>
|
107
|
+
</soapenv:Envelope>
|
108
|
+
__XML__
|
109
|
+
|
110
|
+
def test_multiref_long
|
111
|
+
driver = ItemListPortType.new
|
112
|
+
driver.test_loopback_response << XML_LONG
|
113
|
+
ret = driver.getMeetingInfo
|
114
|
+
assert_equal(105759347, ret.meetingId)
|
115
|
+
end
|
116
|
+
|
117
|
+
def pathname(filename)
|
118
|
+
File.join(DIR, filename)
|
119
|
+
end
|
66
120
|
end
|
67
121
|
|
68
122
|
|
69
123
|
end
|
124
|
+
end
|