sekken 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.travis.yml +11 -0
- data/.yardopts +6 -0
- data/CONTRIBUTING.md +46 -0
- data/Gemfile +27 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +21 -0
- data/donate.png +0 -0
- data/lib/sekken.rb +75 -0
- data/lib/sekken/envelope.rb +92 -0
- data/lib/sekken/errors.rb +9 -0
- data/lib/sekken/example_message.rb +41 -0
- data/lib/sekken/httpclient.rb +35 -0
- data/lib/sekken/importer.rb +77 -0
- data/lib/sekken/message.rb +135 -0
- data/lib/sekken/operation.rb +100 -0
- data/lib/sekken/resolver.rb +20 -0
- data/lib/sekken/response.rb +50 -0
- data/lib/sekken/version.rb +5 -0
- data/lib/sekken/wsdl.rb +86 -0
- data/lib/sekken/wsdl/binding.rb +64 -0
- data/lib/sekken/wsdl/binding_operation.rb +85 -0
- data/lib/sekken/wsdl/document.rb +83 -0
- data/lib/sekken/wsdl/document_collection.rb +61 -0
- data/lib/sekken/wsdl/input_output.rb +84 -0
- data/lib/sekken/wsdl/message.rb +38 -0
- data/lib/sekken/wsdl/operation.rb +47 -0
- data/lib/sekken/wsdl/port.rb +29 -0
- data/lib/sekken/wsdl/port_type.rb +38 -0
- data/lib/sekken/wsdl/port_type_operation.rb +42 -0
- data/lib/sekken/wsdl/service.rb +55 -0
- data/lib/sekken/xml/attribute.rb +13 -0
- data/lib/sekken/xml/element.rb +82 -0
- data/lib/sekken/xml/element_builder.rb +220 -0
- data/lib/sekken/xs/schema.rb +57 -0
- data/lib/sekken/xs/schema_collection.rb +49 -0
- data/lib/sekken/xs/types.rb +272 -0
- data/sekken.gemspec +42 -0
- data/spec/fixtures/response/another_soap_fault.xml +14 -0
- data/spec/fixtures/response/authentication.xml +14 -0
- data/spec/fixtures/response/header.xml +13 -0
- data/spec/fixtures/response/list.xml +18 -0
- data/spec/fixtures/response/multi_ref.xml +39 -0
- data/spec/fixtures/response/soap_fault.xml +8 -0
- data/spec/fixtures/response/soap_fault12.xml +18 -0
- data/spec/fixtures/response/taxcloud.xml +1 -0
- data/spec/fixtures/wsdl/amazon.wsdl +1920 -0
- data/spec/fixtures/wsdl/arrays_with_attributes.wsdl +117 -0
- data/spec/fixtures/wsdl/authentication.wsdl +63 -0
- data/spec/fixtures/wsdl/awse.wsdl +1510 -0
- data/spec/fixtures/wsdl/betfair.wsdl +2981 -0
- data/spec/fixtures/wsdl/blz_service.wsdl +88 -0
- data/spec/fixtures/wsdl/bookt/bookt.wsdl +11 -0
- data/spec/fixtures/wsdl/bookt/bookt0.xsd +433 -0
- data/spec/fixtures/wsdl/bookt/bookt1.xsd +42 -0
- data/spec/fixtures/wsdl/bookt/bookt10.xsd +38 -0
- data/spec/fixtures/wsdl/bookt/bookt11.xsd +17 -0
- data/spec/fixtures/wsdl/bookt/bookt12.xsd +18 -0
- data/spec/fixtures/wsdl/bookt/bookt13.xsd +22 -0
- data/spec/fixtures/wsdl/bookt/bookt14.xsd +27 -0
- data/spec/fixtures/wsdl/bookt/bookt15.xsd +28 -0
- data/spec/fixtures/wsdl/bookt/bookt2.wsdl +243 -0
- data/spec/fixtures/wsdl/bookt/bookt2.xsd +81 -0
- data/spec/fixtures/wsdl/bookt/bookt3.wsdl +286 -0
- data/spec/fixtures/wsdl/bookt/bookt3.xsd +61 -0
- data/spec/fixtures/wsdl/bookt/bookt4.xsd +35 -0
- data/spec/fixtures/wsdl/bookt/bookt5.xsd +22 -0
- data/spec/fixtures/wsdl/bookt/bookt6.xsd +26 -0
- data/spec/fixtures/wsdl/bookt/bookt7.xsd +18 -0
- data/spec/fixtures/wsdl/bookt/bookt8.xsd +22 -0
- data/spec/fixtures/wsdl/bookt/bookt9.xsd +29 -0
- data/spec/fixtures/wsdl/bronto.wsdl +3285 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange.wsdl +104 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange0.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange1.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange2.wsdl +119 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange2.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange3.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange4.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange5.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange6.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange7.xsd +1 -0
- data/spec/fixtures/wsdl/bydexchange/bydexchange8.xsd +1 -0
- data/spec/fixtures/wsdl/crowd.wsdl +2437 -0
- data/spec/fixtures/wsdl/data_exchange.wsdl +98 -0
- data/spec/fixtures/wsdl/document_literal_wrapped.wsdl +153 -0
- data/spec/fixtures/wsdl/economic.wsdl +65660 -0
- data/spec/fixtures/wsdl/edialog.wsdl +13148 -0
- data/spec/fixtures/wsdl/email_verification.wsdl +394 -0
- data/spec/fixtures/wsdl/equifax.wsdl +794 -0
- data/spec/fixtures/wsdl/geotrust.wsdl +156 -0
- data/spec/fixtures/wsdl/interhome.wsdl +2137 -0
- data/spec/fixtures/wsdl/iws.wsdl +695 -0
- data/spec/fixtures/wsdl/jetairways.wsdl +156 -0
- data/spec/fixtures/wsdl/jira.wsdl +3890 -0
- data/spec/fixtures/wsdl/juniper.wsdl +215 -0
- data/spec/fixtures/wsdl/namespaced_actions.wsdl +307 -0
- data/spec/fixtures/wsdl/oracle.wsdl +3629 -0
- data/spec/fixtures/wsdl/ratp.wsdl +955 -0
- data/spec/fixtures/wsdl/rio2/rio2.wsdl +74 -0
- data/spec/fixtures/wsdl/rio2/rio2_0.wsdl +55 -0
- data/spec/fixtures/wsdl/rio2/rio2_0.xsd +58 -0
- data/spec/fixtures/wsdl/rio2/rio2_1.xsd +41 -0
- data/spec/fixtures/wsdl/rio2/rio2_2.xsd +222 -0
- data/spec/fixtures/wsdl/rio2/rio2_3.xsd +10 -0
- data/spec/fixtures/wsdl/rpc_literal.wsdl +105 -0
- data/spec/fixtures/wsdl/spyne.wsdl +70 -0
- data/spec/fixtures/wsdl/stockquote.wsdl +124 -0
- data/spec/fixtures/wsdl/taxcloud.wsdl +934 -0
- data/spec/fixtures/wsdl/team_software/team_software.wsdl +542 -0
- data/spec/fixtures/wsdl/team_software/team_software0.xsd +448 -0
- data/spec/fixtures/wsdl/team_software/team_software1.xsd +41 -0
- data/spec/fixtures/wsdl/team_software/team_software2.xsd +258 -0
- data/spec/fixtures/wsdl/team_software/team_software3.xsd +14 -0
- data/spec/fixtures/wsdl/telefonkatalogen.wsdl +45 -0
- data/spec/fixtures/wsdl/temperature.wsdl +136 -0
- data/spec/fixtures/wsdl/wasmuth/wasmuth.wsdl +157 -0
- data/spec/fixtures/wsdl/wasmuth/wasmuth1.xsd +210 -0
- data/spec/fixtures/wsdl/wasmuth/wasmuth2.xsd +549 -0
- data/spec/fixtures/wsdl/xignite.wsdl +3470 -0
- data/spec/fixtures/wsdl/yahoo.wsdl +2425 -0
- data/spec/fixtures/wsdl/zanox_export_service.xml +520 -0
- data/spec/integration/amazon_spec.rb +51 -0
- data/spec/integration/authentication_spec.rb +38 -0
- data/spec/integration/awse_spec.rb +95 -0
- data/spec/integration/betfair_spec.rb +179 -0
- data/spec/integration/blz_service_spec.rb +46 -0
- data/spec/integration/bookt_spec.rb +59 -0
- data/spec/integration/bronto_spec.rb +178 -0
- data/spec/integration/bydexchange_spec.rb +40 -0
- data/spec/integration/crowd_spec.rb +44 -0
- data/spec/integration/data_exchange_spec.rb +27 -0
- data/spec/integration/document_literal_spec.rb +104 -0
- data/spec/integration/economic_spec.rb +64 -0
- data/spec/integration/email_verification_spec.rb +82 -0
- data/spec/integration/equifax_spec.rb +216 -0
- data/spec/integration/geotrust_spec.rb +17 -0
- data/spec/integration/interhome_spec.rb +156 -0
- data/spec/integration/iws_spec.rb +27 -0
- data/spec/integration/jetairways_spec.rb +142 -0
- data/spec/integration/jira_spec.rb +27 -0
- data/spec/integration/juniper_spec.rb +20 -0
- data/spec/integration/namespaced_actions_spec.rb +37 -0
- data/spec/integration/oracle_spec.rb +61 -0
- data/spec/integration/ratp_spec.rb +178 -0
- data/spec/integration/rio2_spec.rb +56 -0
- data/spec/integration/rpc_literal_spec.rb +101 -0
- data/spec/integration/spyne_spec.rb +60 -0
- data/spec/integration/stockquote_spec.rb +46 -0
- data/spec/integration/taxcloud_spec.rb +45 -0
- data/spec/integration/team_software_spec.rb +51 -0
- data/spec/integration/telefonkatalogen_spec.rb +42 -0
- data/spec/integration/temperature_spec.rb +71 -0
- data/spec/integration/wasmuth_spec.rb +47 -0
- data/spec/integration/xignite_spec.rb +112 -0
- data/spec/integration/yahoo_spec.rb +116 -0
- data/spec/sekken/httpclient_spec.rb +41 -0
- data/spec/sekken/operation/build_spec.rb +308 -0
- data/spec/sekken/operation/document_literal_spec.rb +53 -0
- data/spec/sekken/operation/example_body_spec.rb +95 -0
- data/spec/sekken/operation/rpc_literal_spec.rb +50 -0
- data/spec/sekken/operation_spec.rb +169 -0
- data/spec/sekken/resolver_spec.rb +38 -0
- data/spec/sekken/response_spec.rb +17 -0
- data/spec/sekken/wsdl/document_spec.rb +191 -0
- data/spec/sekken/wsdl_spec.rb +46 -0
- data/spec/sekken/xs/complex_type_spec.rb +197 -0
- data/spec/sekken/xs/element_spec.rb +82 -0
- data/spec/sekken/xs/simple_type_spec.rb +39 -0
- data/spec/sekken_spec.rb +128 -0
- data/spec/spec_helper.rb +37 -0
- data/spec/support/fixture.rb +19 -0
- data/spec/support/http_mock.rb +43 -0
- metadata +344 -0
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'sekken/xs/types'
|
2
|
+
|
3
|
+
class Sekken
|
4
|
+
class XS
|
5
|
+
class Schema
|
6
|
+
|
7
|
+
def initialize(schema, schemas)
|
8
|
+
@schema = schema
|
9
|
+
@schemas = schemas
|
10
|
+
|
11
|
+
@target_namespace = @schema['targetNamespace']
|
12
|
+
@element_form_default = @schema['elementFormDefault'] || 'unqualified'
|
13
|
+
|
14
|
+
@attributes = {}
|
15
|
+
@attribute_groups = {}
|
16
|
+
@elements = {}
|
17
|
+
@complex_types = {}
|
18
|
+
@simple_types = {}
|
19
|
+
@imports = {}
|
20
|
+
|
21
|
+
parse
|
22
|
+
end
|
23
|
+
|
24
|
+
attr_accessor :target_namespace, :element_form_default, :imports,
|
25
|
+
:attributes, :attribute_groups, :elements, :complex_types, :simple_types
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def parse
|
30
|
+
schema = {
|
31
|
+
:target_namespace => @target_namespace,
|
32
|
+
:element_form_default => @element_form_default
|
33
|
+
}
|
34
|
+
|
35
|
+
@schema.element_children.each do |node|
|
36
|
+
case node.name
|
37
|
+
when 'attribute' then store_element(@attributes, node, schema)
|
38
|
+
when 'attributeGroup' then store_element(@attribute_groups, node, schema)
|
39
|
+
when 'element' then store_element(@elements, node, schema)
|
40
|
+
when 'complexType' then store_element(@complex_types, node, schema)
|
41
|
+
when 'simpleType' then store_element(@simple_types, node, schema)
|
42
|
+
when 'import' then store_import(node)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def store_element(collection, node, schema)
|
48
|
+
collection[node['name']] = XS.build(node, @schemas, schema)
|
49
|
+
end
|
50
|
+
|
51
|
+
def store_import(node)
|
52
|
+
@imports[node['namespace']] = node['schemaLocation']
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class Sekken
|
2
|
+
class XS
|
3
|
+
class SchemaCollection
|
4
|
+
include Enumerable
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
@schemas = []
|
8
|
+
end
|
9
|
+
|
10
|
+
def <<(schema)
|
11
|
+
@schemas << schema
|
12
|
+
end
|
13
|
+
|
14
|
+
def push(schemas)
|
15
|
+
@schemas += schemas
|
16
|
+
end
|
17
|
+
|
18
|
+
def each(&block)
|
19
|
+
@schemas.each(&block)
|
20
|
+
end
|
21
|
+
|
22
|
+
def attribute(namespace, name)
|
23
|
+
find_by_namespace(namespace).attributes[name]
|
24
|
+
end
|
25
|
+
|
26
|
+
def attribute_group(namespace, name)
|
27
|
+
find_by_namespace(namespace).attribute_groups[name]
|
28
|
+
end
|
29
|
+
|
30
|
+
def element(namespace, name)
|
31
|
+
find_by_namespace(namespace).elements[name]
|
32
|
+
end
|
33
|
+
|
34
|
+
def complex_type(namespace, name)
|
35
|
+
find_by_namespace(namespace).complex_types[name]
|
36
|
+
end
|
37
|
+
|
38
|
+
def simple_type(namespace, name)
|
39
|
+
find_by_namespace(namespace).simple_types[name]
|
40
|
+
end
|
41
|
+
|
42
|
+
# TODO: store by namespace instead?
|
43
|
+
def find_by_namespace(namespace)
|
44
|
+
find { |schema| schema.target_namespace == namespace }
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,272 @@
|
|
1
|
+
class Sekken
|
2
|
+
class XS
|
3
|
+
|
4
|
+
class BaseType
|
5
|
+
|
6
|
+
def initialize(node, schemas, schema = {})
|
7
|
+
@node = node
|
8
|
+
@schemas = schemas
|
9
|
+
@schema = schema
|
10
|
+
end
|
11
|
+
|
12
|
+
attr_reader :node
|
13
|
+
|
14
|
+
def [](key)
|
15
|
+
@node[key]
|
16
|
+
end
|
17
|
+
|
18
|
+
def empty?
|
19
|
+
children.empty? || children.first.empty?
|
20
|
+
end
|
21
|
+
|
22
|
+
def children
|
23
|
+
@children ||= @node.element_children.map { |child| XS.build(child, @schemas, @schema) }
|
24
|
+
end
|
25
|
+
|
26
|
+
def collect_child_elements(memo = [])
|
27
|
+
children.each do |child|
|
28
|
+
if child.kind_of? Element
|
29
|
+
memo << child
|
30
|
+
else
|
31
|
+
memo = child.collect_child_elements(memo)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
memo
|
36
|
+
end
|
37
|
+
|
38
|
+
def collect_attributes(memo = [])
|
39
|
+
children.each do |child|
|
40
|
+
if child.kind_of? Attribute
|
41
|
+
memo << child
|
42
|
+
else
|
43
|
+
memo = child.collect_attributes(memo)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
memo
|
48
|
+
end
|
49
|
+
|
50
|
+
def inspect
|
51
|
+
attributes = @node.attributes.
|
52
|
+
inject({}) { |memo, (k, attr)| memo[k.to_s] = attr.value; memo }.
|
53
|
+
map { |i| "%s=\"%s\"" % i }.
|
54
|
+
join(' ')
|
55
|
+
"<%s %s>" % [self.class, attributes]
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
class PrimaryType < BaseType
|
61
|
+
|
62
|
+
def initialize(node, schemas, schema = {})
|
63
|
+
super
|
64
|
+
|
65
|
+
@namespace = schema[:target_namespace]
|
66
|
+
@element_form_default = schema[:element_form_default]
|
67
|
+
|
68
|
+
@name = node['name']
|
69
|
+
# Because you've overriden the form method, you don't need to set
|
70
|
+
# unqualified as the default when no form is specified.
|
71
|
+
#@form = node['form'] || 'unqualified'
|
72
|
+
@form = node['form']
|
73
|
+
|
74
|
+
@namespaces = node.namespaces
|
75
|
+
end
|
76
|
+
|
77
|
+
attr_reader :name, :form, :namespace, :namespaces
|
78
|
+
|
79
|
+
def form
|
80
|
+
if @form
|
81
|
+
@form
|
82
|
+
elsif @element_form_default == 'qualified'
|
83
|
+
'qualified'
|
84
|
+
else
|
85
|
+
'unqualified'
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
class SimpleType < PrimaryType
|
92
|
+
|
93
|
+
def base
|
94
|
+
child = @node.element_children.first
|
95
|
+
local = child.name.split(':').last
|
96
|
+
|
97
|
+
child['base'] if local == 'restriction'
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
class Element < PrimaryType
|
103
|
+
|
104
|
+
def initialize(node, schemas, schema = {})
|
105
|
+
super
|
106
|
+
|
107
|
+
@type = node['type']
|
108
|
+
@ref = node['ref']
|
109
|
+
end
|
110
|
+
|
111
|
+
attr_reader :type, :ref
|
112
|
+
|
113
|
+
def inline_type
|
114
|
+
children.first
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
class ComplexType < PrimaryType
|
120
|
+
|
121
|
+
alias_method :elements, :collect_child_elements
|
122
|
+
alias_method :attributes, :collect_attributes
|
123
|
+
|
124
|
+
def id
|
125
|
+
[namespace, name].join(':')
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
|
130
|
+
class Extension < BaseType
|
131
|
+
|
132
|
+
def collect_child_elements(memo = [])
|
133
|
+
if @node['base']
|
134
|
+
local, nsid = @node['base'].split(':').reverse
|
135
|
+
namespace = @node.namespaces["xmlns:#{nsid}"]
|
136
|
+
|
137
|
+
if complex_type = @schemas.complex_type(namespace, local)
|
138
|
+
memo += complex_type.elements
|
139
|
+
|
140
|
+
# TODO: can we find a testcase for this?
|
141
|
+
else #if simple_type = @schemas.simple_type(namespace, local)
|
142
|
+
raise 'simple type extension?!'
|
143
|
+
#memo << simple_type
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
super
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
|
152
|
+
class AnyType < BaseType; end
|
153
|
+
class ComplexContent < BaseType; end
|
154
|
+
class Restriction < BaseType; end
|
155
|
+
class All < BaseType; end
|
156
|
+
class Sequence < BaseType; end
|
157
|
+
class Choice < BaseType; end
|
158
|
+
class Enumeration < BaseType; end
|
159
|
+
|
160
|
+
class Attribute < BaseType
|
161
|
+
|
162
|
+
def initialize(node, schemas, schema = {})
|
163
|
+
super
|
164
|
+
|
165
|
+
@name = node['name']
|
166
|
+
@type = node['type']
|
167
|
+
@ref = node['ref']
|
168
|
+
|
169
|
+
@use = node['use'] || 'optional'
|
170
|
+
@default = node['default']
|
171
|
+
@fixed = node['fixed']
|
172
|
+
|
173
|
+
@namespaces = node.namespaces
|
174
|
+
end
|
175
|
+
|
176
|
+
attr_reader :name, :type, :ref, :namespaces,
|
177
|
+
:use, :default, :fixed
|
178
|
+
|
179
|
+
def inline_type
|
180
|
+
children.first
|
181
|
+
end
|
182
|
+
|
183
|
+
# stop searching for child elements
|
184
|
+
def collect_child_elements(memo = [])
|
185
|
+
memo
|
186
|
+
end
|
187
|
+
|
188
|
+
end
|
189
|
+
|
190
|
+
class AttributeGroup < BaseType
|
191
|
+
|
192
|
+
alias_method :attributes, :collect_attributes
|
193
|
+
|
194
|
+
def collect_attributes(memo = [])
|
195
|
+
if @node['ref']
|
196
|
+
local, nsid = @node['ref'].split(':').reverse
|
197
|
+
namespace = @node.namespaces["xmlns:#{nsid}"]
|
198
|
+
|
199
|
+
attribute_group = @schemas.attribute_group(namespace, local)
|
200
|
+
memo += attribute_group.attributes
|
201
|
+
else
|
202
|
+
super
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
class SimpleContent < BaseType
|
208
|
+
|
209
|
+
# stop searching for attributes
|
210
|
+
def collect_attributes(memo = [])
|
211
|
+
memo
|
212
|
+
end
|
213
|
+
|
214
|
+
# stop searching for child elements
|
215
|
+
def collect_child_elements(memo = [])
|
216
|
+
memo
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
220
|
+
|
221
|
+
class Annotation < BaseType
|
222
|
+
|
223
|
+
# stop searching for attributes
|
224
|
+
def collect_attributes(memo = [])
|
225
|
+
memo
|
226
|
+
end
|
227
|
+
|
228
|
+
# stop searching for child elements
|
229
|
+
def collect_child_elements(memo = [])
|
230
|
+
memo
|
231
|
+
end
|
232
|
+
|
233
|
+
end
|
234
|
+
|
235
|
+
TYPE_MAPPING = {
|
236
|
+
'attribute' => Attribute,
|
237
|
+
'attributeGroup' => AttributeGroup,
|
238
|
+
'element' => Element,
|
239
|
+
'complexType' => ComplexType,
|
240
|
+
'simpleType' => SimpleType,
|
241
|
+
'simpleContent' => SimpleContent,
|
242
|
+
'complexContent' => ComplexContent,
|
243
|
+
'extension' => Extension,
|
244
|
+
'restriction' => Restriction,
|
245
|
+
'all' => All,
|
246
|
+
'sequence' => Sequence,
|
247
|
+
'choice' => Choice,
|
248
|
+
'enumeration' => Enumeration,
|
249
|
+
'annotation' => Annotation
|
250
|
+
}
|
251
|
+
|
252
|
+
def self.build(node, schemas, schema = {})
|
253
|
+
type_class(node).new(node, schemas, schema)
|
254
|
+
end
|
255
|
+
|
256
|
+
def self.type_class(node)
|
257
|
+
type = node.name.split(':').last
|
258
|
+
|
259
|
+
if TYPE_MAPPING.include? type
|
260
|
+
TYPE_MAPPING[type]
|
261
|
+
else
|
262
|
+
logger.debug("No type mapping for #{type.inspect}. ")
|
263
|
+
AnyType
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
def self.logger
|
268
|
+
@logger ||= Logging.logger[self]
|
269
|
+
end
|
270
|
+
|
271
|
+
end
|
272
|
+
end
|
data/sekken.gemspec
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$:.unshift lib unless $:.include? lib
|
4
|
+
|
5
|
+
require 'sekken/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'sekken'
|
9
|
+
s.version = Sekken::VERSION
|
10
|
+
s.authors = ['Daniel Harrington', 'Tim Jarratt']
|
11
|
+
s.email = 'tjarratt@gmail.com'
|
12
|
+
s.homepage = 'http://savonrb.com'
|
13
|
+
s.summary = 'Next-Gen SOAP client'
|
14
|
+
s.description = 'Sekken is an experimental SOAP client for the Ruby community.'
|
15
|
+
|
16
|
+
s.rubyforge_project = s.name
|
17
|
+
s.license = 'MIT'
|
18
|
+
|
19
|
+
# TODO: get rid of Nori.
|
20
|
+
s.add_dependency 'nori', '~> 2.2.0'
|
21
|
+
|
22
|
+
s.add_dependency 'nokogiri', '>= 1.4.0'
|
23
|
+
s.add_dependency 'builder', '>= 3.0.0'
|
24
|
+
s.add_dependency 'httpclient', '~> 2.3'
|
25
|
+
s.add_dependency 'logging', '~> 1.8'
|
26
|
+
|
27
|
+
s.add_development_dependency 'rake', '~> 10.1'
|
28
|
+
s.add_development_dependency 'rspec', '~> 2.14'
|
29
|
+
s.add_development_dependency 'mocha', '~> 0.14'
|
30
|
+
s.add_development_dependency 'equivalent-xml', '~> 0.3'
|
31
|
+
|
32
|
+
ignores = File.readlines('.gitignore').grep(/\S+/).map(&:chomp)
|
33
|
+
dotfiles = %w[.gitignore .travis.yml .yardopts]
|
34
|
+
|
35
|
+
all_files_without_ignores = Dir['**/*'].reject { |f|
|
36
|
+
File.directory?(f) || ignores.any? { |i| File.fnmatch(i, f) }
|
37
|
+
}
|
38
|
+
|
39
|
+
s.files = (all_files_without_ignores + dotfiles).sort
|
40
|
+
|
41
|
+
s.require_path = 'lib'
|
42
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
|
2
|
+
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
|
3
|
+
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
|
4
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
5
|
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
6
|
+
<SOAP-ENV:Body>
|
7
|
+
<SOAP-ENV:Fault>
|
8
|
+
<faultcode>ERR_NO_SESSION</faultcode>
|
9
|
+
<faultfactor>doGetItemsInfo - Wrong session</faultfactor>
|
10
|
+
<faultstring>Wrong session message</faultstring>
|
11
|
+
<detail><soapVal><ERRNO xsi:type="xsd:string">80:1289245853:55</ERRNO></soapVal></detail>
|
12
|
+
</SOAP-ENV:Fault>
|
13
|
+
</SOAP-ENV:Body>
|
14
|
+
</SOAP-ENV:Envelope>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
|
2
|
+
<soap:Body>
|
3
|
+
<ns2:authenticateResponse xmlns:ns2="http://v1_0.ws.user.example.com">
|
4
|
+
<return>
|
5
|
+
<authenticationValue>
|
6
|
+
<token>a68d1d6379b62ff339a0e0c69ed4d9cf</token>
|
7
|
+
<tokenHash>AAAJxA;cIedoT;mY10ExZwG6JuKgp2OYKxow==</tokenHash>
|
8
|
+
<client>radclient</client>
|
9
|
+
</authenticationValue>
|
10
|
+
<success>true</success>
|
11
|
+
</return>
|
12
|
+
</ns2:authenticateResponse>
|
13
|
+
</soap:Body>
|
14
|
+
</soap:Envelope>
|