soap-lc 0.0.2 → 0.0.3
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/.gitignore +22 -0
- data/{COPYING → LICENSE} +0 -0
- data/{README → README.rdoc} +19 -13
- data/Rakefile +32 -0
- data/lib/soap/lc.rb +14 -1
- data/lib/soap/lc/request.rb +10 -5
- data/lib/soap/lc/version.rb +1 -1
- data/lib/soap/lc/wsdl.rb +5 -0
- data/lib/soap/lc/wsdl/binding.rb +12 -0
- data/lib/soap/lc/xsd/convert.rb +35 -0
- data/lib/soap/lc/xsd/element.rb +1 -1
- data/soap-lc.gemspec +72 -0
- data/{examples/t_010.rb → tests/t_000.rb} +0 -0
- metadata +25 -48
- data/AUTHORS +0 -1
- data/examples/HelloService.wsdl +0 -49
- data/examples/StockQuote.wsdl +0 -64
- data/examples/t_000.rb +0 -21
- data/examples/t_001.rb +0 -51
- data/examples/t_002.rb +0 -34
- data/examples/t_00X.rb +0 -18
- data/setup.rb +0 -1585
data/.gitignore
ADDED
data/{COPYING → LICENSE}
RENAMED
File without changes
|
data/{README → README.rdoc}
RENAMED
@@ -1,10 +1,8 @@
|
|
1
1
|
= SOAP Lite Client
|
2
2
|
|
3
|
-
Copyright (C) 2007
|
3
|
+
Copyright (C) 2007-2010 Grégoire Lejeune
|
4
4
|
|
5
|
-
* http://
|
6
|
-
* http://rubyforge.org/projects/soap-lc/
|
7
|
-
* http://greg.rubyfr.net
|
5
|
+
* http://algorithmique.net
|
8
6
|
|
9
7
|
== DESCRIPTION:
|
10
8
|
|
@@ -12,6 +10,14 @@ SOAP Lite Client provides support for developing clients interfaces from WSDL fi
|
|
12
10
|
|
13
11
|
== FEATURES/PROBLEMS:
|
14
12
|
|
13
|
+
=== 0.0.3:
|
14
|
+
* Use jeweler
|
15
|
+
|
16
|
+
=== 0.0.2:
|
17
|
+
* Extract Core extensions
|
18
|
+
* Format response
|
19
|
+
* Add binding support
|
20
|
+
|
15
21
|
=== 0.0.1:
|
16
22
|
* Initial release. So...
|
17
23
|
|
@@ -20,16 +26,16 @@ SOAP Lite Client provides support for developing clients interfaces from WSDL fi
|
|
20
26
|
|
21
27
|
== SYNOPSIS:
|
22
28
|
|
23
|
-
|
29
|
+
require 'soap/lc'
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
wsdl = "http://localhost:3000/simple/wsdl"
|
32
|
+
s = SOAP::LC.new( ).wsdl( wsdl ).call( "HelloWorld", { :from => "Greg" } )
|
33
|
+
r = s.result
|
34
|
+
puts r.to_h
|
35
|
+
|
36
|
+
# Or
|
37
|
+
|
38
|
+
r = SOAP::LC["http://localhost:3000/wsdl"].HelloWorld( :from => "greg" ).result
|
33
39
|
|
34
40
|
== REQUIREMENTS:
|
35
41
|
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'lib/soap/lc/version'
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'jeweler'
|
7
|
+
Jeweler::Tasks.new do |gem|
|
8
|
+
gem.name = "soap-lc"
|
9
|
+
gem.summary = %Q{SOAP Lite Client provides support for developing clients interfaces from WSDL files.}
|
10
|
+
gem.description = gem.summary
|
11
|
+
gem.email = "gregoire.lejeune@free.fr"
|
12
|
+
gem.homepage = "http://github.com/glejeune/soap-lc"
|
13
|
+
gem.authors = ["Grégoire Lejeune"]
|
14
|
+
gem.version = SOAP::LC::VERSION
|
15
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
|
+
|
17
|
+
gem.add_dependency('activesupport')
|
18
|
+
end
|
19
|
+
Jeweler::GemcutterTasks.new
|
20
|
+
rescue LoadError
|
21
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
22
|
+
end
|
23
|
+
|
24
|
+
require 'rake/rdoctask'
|
25
|
+
Rake::RDocTask.new do |rdoc|
|
26
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
27
|
+
|
28
|
+
rdoc.rdoc_dir = 'rdoc'
|
29
|
+
rdoc.title = "soap-lc #{version}"
|
30
|
+
rdoc.rdoc_files.include('README*')
|
31
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
32
|
+
end
|
data/lib/soap/lc.rb
CHANGED
@@ -9,6 +9,19 @@ module SOAP
|
|
9
9
|
def initialize( ) #:nodoc:
|
10
10
|
end
|
11
11
|
|
12
|
+
# Set the WSDL URL and return a SOAP::WSDL object
|
13
|
+
#
|
14
|
+
# Parameters :
|
15
|
+
# +uri+ : path to the WSDL
|
16
|
+
# +binding+ : binding name (optional)
|
17
|
+
#
|
18
|
+
# Example :
|
19
|
+
# s = WSDL::LC.new().wsdl( "http://my.wsdl.com", "HelloService" )
|
20
|
+
# # => #<SOAP::WSDL:0xNNNNNN>
|
21
|
+
def wsdl( uri, binding = nil )
|
22
|
+
SOAP::WSDL.new( uri, binding )
|
23
|
+
end
|
24
|
+
|
12
25
|
# Set the WSDL URL and return a SOAP::WSDL object
|
13
26
|
#
|
14
27
|
# Parameters :
|
@@ -19,7 +32,7 @@ module SOAP
|
|
19
32
|
# s = WSDL::LC.wsdl( "http://my.wsdl.com", "HelloService" )
|
20
33
|
# # => #<SOAP::WSDL:0xNNNNNN>
|
21
34
|
def self.wsdl( uri, binding = nil )
|
22
|
-
|
35
|
+
SOAP::WSDL.new( uri, binding )
|
23
36
|
end
|
24
37
|
|
25
38
|
# Create a new SOAP Lite client and set the WSDL URL
|
data/lib/soap/lc/request.rb
CHANGED
@@ -42,9 +42,9 @@ module SOAP
|
|
42
42
|
# </SOAP-ENV:Envelope>'
|
43
43
|
# r = SOAP::Request.request( e, "http://localhost:3000/hello/wsdl", "SOAPAction" => "my.soap.action" )
|
44
44
|
def self.request( envelope, uri, headers = {} )
|
45
|
-
|
46
|
-
|
47
|
-
return
|
45
|
+
req = new( nil, nil )
|
46
|
+
req.r( envelope, uri, headers )
|
47
|
+
return req
|
48
48
|
end
|
49
49
|
def r( envelope, uri, headers ) #:nodoc:
|
50
50
|
@request = {
|
@@ -58,6 +58,11 @@ module SOAP
|
|
58
58
|
}
|
59
59
|
end
|
60
60
|
|
61
|
+
# Return available SOAP actions
|
62
|
+
def operations
|
63
|
+
@wsdl.bindings.getOperations( @binding )
|
64
|
+
end
|
65
|
+
|
61
66
|
# Call a method for the current Request
|
62
67
|
#
|
63
68
|
# Example:
|
@@ -188,7 +193,7 @@ module SOAP
|
|
188
193
|
end
|
189
194
|
|
190
195
|
private
|
191
|
-
def make_header( e, h = {} )
|
196
|
+
def make_header( e, h = {} ) #:nodoc:
|
192
197
|
{
|
193
198
|
'User-Agent' => "SOAP::LC (#{SOAP::LC::VERSION}); Ruby (#{VERSION})",
|
194
199
|
'Content-Type' => 'text/xml', #'application/soap+xml; charset=utf-8',
|
@@ -196,7 +201,7 @@ module SOAP
|
|
196
201
|
}.merge( h )
|
197
202
|
end
|
198
203
|
|
199
|
-
def soap_envelop( &b )
|
204
|
+
def soap_envelop( &b ) #:nodoc:
|
200
205
|
"<SOAP-ENV:Envelope
|
201
206
|
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"
|
202
207
|
xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"
|
data/lib/soap/lc/version.rb
CHANGED
data/lib/soap/lc/wsdl.rb
CHANGED
@@ -20,6 +20,11 @@ module SOAP
|
|
20
20
|
return request( @binding ).call( id.id2name, args[0] )
|
21
21
|
end
|
22
22
|
|
23
|
+
# Return available SOAP operations
|
24
|
+
def operations
|
25
|
+
return request( @binding ).operations
|
26
|
+
end
|
27
|
+
|
23
28
|
# Call a method for the current WSDL and get the corresponding SOAP::Request
|
24
29
|
#
|
25
30
|
# Example:
|
data/lib/soap/lc/wsdl/binding.rb
CHANGED
@@ -12,6 +12,18 @@ module SOAP
|
|
12
12
|
end
|
13
13
|
return r
|
14
14
|
end
|
15
|
+
|
16
|
+
def getOperations( binding = nil )
|
17
|
+
r = []
|
18
|
+
if binding.nil?
|
19
|
+
self.each do |binding_name, binding|
|
20
|
+
r = r + binding.operations.keys
|
21
|
+
end
|
22
|
+
else
|
23
|
+
r = r + self[binding].operations.keys
|
24
|
+
end
|
25
|
+
return r
|
26
|
+
end
|
15
27
|
end
|
16
28
|
|
17
29
|
class Binding
|
data/lib/soap/lc/xsd/convert.rb
CHANGED
@@ -32,74 +32,109 @@ module SOAP
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def xsd_duration( x )
|
35
|
+
x
|
35
36
|
end
|
36
37
|
def xsd_dateTime( x )
|
38
|
+
x
|
37
39
|
end
|
38
40
|
def xsd_time( x )
|
41
|
+
x
|
39
42
|
end
|
40
43
|
def xsd_date( x )
|
44
|
+
x
|
41
45
|
end
|
42
46
|
def xsd_gYearMonth( x )
|
47
|
+
x
|
43
48
|
end
|
44
49
|
def xsd_gYear( x )
|
50
|
+
x
|
45
51
|
end
|
46
52
|
def xsd_gMonthDay( x )
|
53
|
+
x
|
47
54
|
end
|
48
55
|
def xsd_gDay( x )
|
56
|
+
x
|
49
57
|
end
|
50
58
|
def xsd_gMonth( x )
|
59
|
+
x
|
51
60
|
end
|
52
61
|
def xsd_base64Binary( x )
|
62
|
+
x
|
53
63
|
end
|
54
64
|
def xsd_hexBinary( x )
|
65
|
+
x
|
55
66
|
end
|
56
67
|
def xsd_anyURI( x )
|
68
|
+
x
|
57
69
|
end
|
58
70
|
def xsd_QName( x )
|
71
|
+
x
|
59
72
|
end
|
60
73
|
def xsd_NOTATION( x )
|
74
|
+
x
|
61
75
|
end
|
62
76
|
def xsd_token( x )
|
77
|
+
x
|
63
78
|
end
|
64
79
|
def xsd_language( x )
|
80
|
+
x
|
65
81
|
end
|
66
82
|
def xsd_Name( x )
|
83
|
+
x
|
67
84
|
end
|
68
85
|
def xsd_NMTOKEN( x )
|
86
|
+
x
|
69
87
|
end
|
70
88
|
def xsd_NCName( x )
|
89
|
+
x
|
71
90
|
end
|
72
91
|
def xsd_NMTOKENS( x )
|
92
|
+
x
|
73
93
|
end
|
74
94
|
def xsd_ID( x )
|
95
|
+
x
|
75
96
|
end
|
76
97
|
def xsd_IDREF( x )
|
98
|
+
x
|
77
99
|
end
|
78
100
|
def xsd_ENTITY( x )
|
101
|
+
x
|
79
102
|
end
|
80
103
|
def xsd_IDREFS( x )
|
104
|
+
x
|
81
105
|
end
|
82
106
|
def xsd_ENTITIES( x )
|
107
|
+
x
|
83
108
|
end
|
84
109
|
def xsd_nonPositiveInteger( x )
|
110
|
+
x
|
85
111
|
end
|
86
112
|
def xsd_nonNegativeInteger( x )
|
113
|
+
x
|
87
114
|
end
|
88
115
|
def xsd_negativeInteger( x )
|
116
|
+
x
|
89
117
|
end
|
90
118
|
def xsd_unsignedLong( x )
|
119
|
+
x
|
91
120
|
end
|
92
121
|
def xsd_positiveInteger( x )
|
122
|
+
x
|
93
123
|
end
|
94
124
|
def xsd_short( x )
|
125
|
+
x
|
95
126
|
end
|
96
127
|
def xsd_unsignedInt( x )
|
128
|
+
x
|
97
129
|
end
|
98
130
|
def xsd_byte( x )
|
131
|
+
x
|
99
132
|
end
|
100
133
|
def xsd_unsignedShort( x )
|
134
|
+
x
|
101
135
|
end
|
102
136
|
def xsd_unsignedByte( x )
|
137
|
+
x
|
103
138
|
end
|
104
139
|
end
|
105
140
|
end
|
data/lib/soap/lc/xsd/element.rb
CHANGED
@@ -130,7 +130,7 @@ module SOAP
|
|
130
130
|
when :simpleType
|
131
131
|
# **************************** TODO ************************************
|
132
132
|
when :complexType
|
133
|
-
# **************************** TO
|
133
|
+
# **************************** NEED TO BE VERIFIED ************************************
|
134
134
|
r = self[:complexType].responseToHash( xml, types )
|
135
135
|
else
|
136
136
|
xml.each { |e|
|
data/soap-lc.gemspec
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{soap-lc}
|
8
|
+
s.version = "0.0.3"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Gr\303\251goire Lejeune"]
|
12
|
+
s.date = %q{2010-02-10}
|
13
|
+
s.description = %q{SOAP Lite Client provides support for developing clients interfaces from WSDL files.}
|
14
|
+
s.email = %q{gregoire.lejeune@free.fr}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".gitignore",
|
21
|
+
"LICENSE",
|
22
|
+
"README.rdoc",
|
23
|
+
"Rakefile",
|
24
|
+
"examples/mono/NumberService.asmx",
|
25
|
+
"examples/mono/README.txt",
|
26
|
+
"examples/mono/index.html",
|
27
|
+
"lib/soap/lc.rb",
|
28
|
+
"lib/soap/lc/core_ext.rb",
|
29
|
+
"lib/soap/lc/error.rb",
|
30
|
+
"lib/soap/lc/request.rb",
|
31
|
+
"lib/soap/lc/response.rb",
|
32
|
+
"lib/soap/lc/version.rb",
|
33
|
+
"lib/soap/lc/wsdl.rb",
|
34
|
+
"lib/soap/lc/wsdl/binding.rb",
|
35
|
+
"lib/soap/lc/wsdl/message.rb",
|
36
|
+
"lib/soap/lc/wsdl/parser.rb",
|
37
|
+
"lib/soap/lc/wsdl/portType.rb",
|
38
|
+
"lib/soap/lc/wsdl/service.rb",
|
39
|
+
"lib/soap/lc/xsd.rb",
|
40
|
+
"lib/soap/lc/xsd/complextype.rb",
|
41
|
+
"lib/soap/lc/xsd/convert.rb",
|
42
|
+
"lib/soap/lc/xsd/element.rb",
|
43
|
+
"lib/soap/lc/xsd/enumeration.rb",
|
44
|
+
"lib/soap/lc/xsd/restriction.rb",
|
45
|
+
"lib/soap/lc/xsd/sequence.rb",
|
46
|
+
"lib/soap/lc/xsd/simpletype.rb",
|
47
|
+
"soap-lc.gemspec",
|
48
|
+
"tests/t_000.rb"
|
49
|
+
]
|
50
|
+
s.homepage = %q{http://github.com/glejeune/soap-lc}
|
51
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
52
|
+
s.require_paths = ["lib"]
|
53
|
+
s.rubygems_version = %q{1.3.5}
|
54
|
+
s.summary = %q{SOAP Lite Client provides support for developing clients interfaces from WSDL files.}
|
55
|
+
s.test_files = [
|
56
|
+
"examples/NEVER_COMMIT/t_000.rb"
|
57
|
+
]
|
58
|
+
|
59
|
+
if s.respond_to? :specification_version then
|
60
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
61
|
+
s.specification_version = 3
|
62
|
+
|
63
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
64
|
+
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
65
|
+
else
|
66
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
67
|
+
end
|
68
|
+
else
|
69
|
+
s.add_dependency(%q<activesupport>, [">= 0"])
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soap-lc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Gr\xC3\xA9goire Lejeune"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-02-10 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -29,33 +29,29 @@ executables: []
|
|
29
29
|
extensions: []
|
30
30
|
|
31
31
|
extra_rdoc_files:
|
32
|
-
-
|
33
|
-
-
|
34
|
-
- COPYING
|
35
|
-
- lib/soap/lc.rb
|
36
|
-
- lib/soap/lc/wsdl.rb
|
37
|
-
- lib/soap/lc/request.rb
|
38
|
-
- lib/soap/lc/response.rb
|
32
|
+
- LICENSE
|
33
|
+
- README.rdoc
|
39
34
|
files:
|
40
|
-
-
|
41
|
-
-
|
42
|
-
-
|
43
|
-
-
|
44
|
-
-
|
45
|
-
-
|
35
|
+
- .gitignore
|
36
|
+
- LICENSE
|
37
|
+
- README.rdoc
|
38
|
+
- Rakefile
|
39
|
+
- examples/mono/NumberService.asmx
|
40
|
+
- examples/mono/README.txt
|
41
|
+
- examples/mono/index.html
|
42
|
+
- lib/soap/lc.rb
|
46
43
|
- lib/soap/lc/core_ext.rb
|
47
44
|
- lib/soap/lc/error.rb
|
48
45
|
- lib/soap/lc/request.rb
|
49
46
|
- lib/soap/lc/response.rb
|
50
47
|
- lib/soap/lc/version.rb
|
51
|
-
- lib/soap/lc/wsdl
|
48
|
+
- lib/soap/lc/wsdl.rb
|
52
49
|
- lib/soap/lc/wsdl/binding.rb
|
53
50
|
- lib/soap/lc/wsdl/message.rb
|
54
51
|
- lib/soap/lc/wsdl/parser.rb
|
55
52
|
- lib/soap/lc/wsdl/portType.rb
|
56
53
|
- lib/soap/lc/wsdl/service.rb
|
57
|
-
- lib/soap/lc/
|
58
|
-
- lib/soap/lc/xsd
|
54
|
+
- lib/soap/lc/xsd.rb
|
59
55
|
- lib/soap/lc/xsd/complextype.rb
|
60
56
|
- lib/soap/lc/xsd/convert.rb
|
61
57
|
- lib/soap/lc/xsd/element.rb
|
@@ -63,41 +59,22 @@ files:
|
|
63
59
|
- lib/soap/lc/xsd/restriction.rb
|
64
60
|
- lib/soap/lc/xsd/sequence.rb
|
65
61
|
- lib/soap/lc/xsd/simpletype.rb
|
66
|
-
-
|
67
|
-
-
|
68
|
-
- examples/HelloService.wsdl
|
69
|
-
- examples/mono
|
70
|
-
- examples/mono/index.html
|
71
|
-
- examples/mono/NumberService.asmx
|
72
|
-
- examples/mono/README.txt
|
73
|
-
- examples/StockQuote.wsdl
|
74
|
-
- examples/t_000.rb
|
75
|
-
- examples/t_001.rb
|
76
|
-
- examples/t_002.rb
|
77
|
-
- examples/t_00X.rb
|
78
|
-
- examples/t_010.rb
|
62
|
+
- soap-lc.gemspec
|
63
|
+
- tests/t_000.rb
|
79
64
|
has_rdoc: true
|
80
|
-
homepage: http://
|
65
|
+
homepage: http://github.com/glejeune/soap-lc
|
66
|
+
licenses: []
|
67
|
+
|
81
68
|
post_install_message:
|
82
69
|
rdoc_options:
|
83
|
-
- --
|
84
|
-
- --title
|
85
|
-
- SOAP Lite Client, the Documentation
|
86
|
-
- --opname
|
87
|
-
- index.html
|
88
|
-
- --line-numbers
|
89
|
-
- --main
|
90
|
-
- README
|
91
|
-
- --inline-source
|
92
|
-
- --exclude
|
93
|
-
- ^(examples|extras|test|lib)\/
|
70
|
+
- --charset=UTF-8
|
94
71
|
require_paths:
|
95
72
|
- lib
|
96
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
97
74
|
requirements:
|
98
75
|
- - ">="
|
99
76
|
- !ruby/object:Gem::Version
|
100
|
-
version:
|
77
|
+
version: "0"
|
101
78
|
version:
|
102
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
80
|
requirements:
|
@@ -108,9 +85,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
85
|
requirements: []
|
109
86
|
|
110
87
|
rubyforge_project:
|
111
|
-
rubygems_version: 1.3.
|
88
|
+
rubygems_version: 1.3.5
|
112
89
|
signing_key:
|
113
|
-
specification_version:
|
90
|
+
specification_version: 3
|
114
91
|
summary: SOAP Lite Client provides support for developing clients interfaces from WSDL files.
|
115
|
-
test_files:
|
116
|
-
|
92
|
+
test_files:
|
93
|
+
- examples/NEVER_COMMIT/t_000.rb
|