wasabi 2.4.0 → 2.4.1
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/CHANGELOG.md +5 -0
- data/lib/wasabi/parser.rb +8 -3
- data/lib/wasabi/version.rb +1 -1
- data/spec/fixtures/no_message_parts.wsdl +59 -0
- data/spec/wasabi/parser/no_message_parts_spec.rb +22 -0
- metadata +8 -4
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 2.4.1 (2012-06-18)
|
2
|
+
|
3
|
+
* Fix: [rubiii/savon#296](https://github.com/rubiii/savon/issues/296) fixes an issue where
|
4
|
+
the WSDL message element doesn't have part element.
|
5
|
+
|
1
6
|
## 2.4.0 (2012-06-08)
|
2
7
|
|
3
8
|
* Feature: `Wasabi::Document` now accepts either a URL of a remote document,
|
data/lib/wasabi/parser.rb
CHANGED
@@ -150,14 +150,19 @@ module Wasabi
|
|
150
150
|
|
151
151
|
# Look up the input by walking up to portType, then up to the message.
|
152
152
|
|
153
|
-
binding_input = at_xpath(operation, ".//wsdl:input/@name")
|
154
153
|
binding_type = at_xpath(operation, "../@type").to_s.split(':').last
|
155
154
|
port_type_input = at_xpath(operation, "../../wsdl:portType[@name='#{binding_type}']/wsdl:operation[@name='#{operation_name}']/wsdl:input")
|
156
155
|
|
157
156
|
port_message_ns_id, port_message_type = port_type_input.attribute("message").to_s.split(':')
|
158
157
|
|
159
|
-
|
160
|
-
|
158
|
+
message_ns_id, message_type = nil
|
159
|
+
|
160
|
+
# TODO: Support multiple 'part' elements in the message.
|
161
|
+
if (port_message_part = at_xpath(port_type_input, "../../../wsdl:message[@name='#{port_message_type}']/wsdl:part[1]"))
|
162
|
+
if (port_message_part_element = port_message_part.attribute("element"))
|
163
|
+
message_ns_id, message_type = port_message_part_element.to_s.split(':')
|
164
|
+
end
|
165
|
+
end
|
161
166
|
|
162
167
|
# Fall back to message name in portType input if no 'element' attribute in wsdl:message
|
163
168
|
if message_type
|
data/lib/wasabi/version.rb
CHANGED
@@ -0,0 +1,59 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<definitions
|
3
|
+
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
4
|
+
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
|
5
|
+
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
|
6
|
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
7
|
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
|
8
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
9
|
+
xmlns:s="http://www.w3.org/2001/XMLSchema"
|
10
|
+
xmlns:article="http://example.com/article"
|
11
|
+
xmlns:actions="http://example.com/actions"
|
12
|
+
targetNamespace="http://example.com/actions">
|
13
|
+
<types>
|
14
|
+
<s:schema elementFormDefault="qualified" targetNamespace="http://example.com/actions">
|
15
|
+
<s:element name="Save">
|
16
|
+
<s:complexType>
|
17
|
+
<s:sequence>
|
18
|
+
<s:element name="article" type="article:Article"/>
|
19
|
+
</s:sequence>
|
20
|
+
</s:complexType>
|
21
|
+
</s:element>
|
22
|
+
</s:schema>
|
23
|
+
<s:schema elementFormDefault="qualified" targetNamespace="http://example.com/article">
|
24
|
+
<s:complexType name="Article">
|
25
|
+
<s:sequence>
|
26
|
+
<s:element minOccurs="0" name="Author" type="s:string"/>
|
27
|
+
<s:element minOccurs="0" name="Title" type="s:string"/>
|
28
|
+
</s:sequence>
|
29
|
+
</s:complexType>
|
30
|
+
</s:schema>
|
31
|
+
</types>
|
32
|
+
<message name="SaveSoapIn"/>
|
33
|
+
<message name="SaveSoapOut">
|
34
|
+
<part name="parameters" element="actions:SaveResponse"/>
|
35
|
+
</message>
|
36
|
+
<portType name="ArticleSoap">
|
37
|
+
<operation name="Save">
|
38
|
+
<input message="actions:SaveSoapIn"/>
|
39
|
+
<output message="actions:SaveSoapOut"/>
|
40
|
+
</operation>
|
41
|
+
</portType>
|
42
|
+
<binding name="ArticleSoap" type="actions:ArticleSoap">
|
43
|
+
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
|
44
|
+
<operation name="Save">
|
45
|
+
<soap:operation soapAction="http://example.com/actions.Save" style="document"/>
|
46
|
+
<input>
|
47
|
+
<soap:body use="literal"/>
|
48
|
+
</input>
|
49
|
+
<output>
|
50
|
+
<soap:body use="literal"/>
|
51
|
+
</output>
|
52
|
+
</operation>
|
53
|
+
</binding>
|
54
|
+
<service name="StudyMDL">
|
55
|
+
<port name="StudyMDLSoap" binding="actions:StudyMDLSoap">
|
56
|
+
<soap:address location="http://example.com:1234/soap"/>
|
57
|
+
</port>
|
58
|
+
</service>
|
59
|
+
</definitions>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Wasabi::Parser do
|
4
|
+
context "with: no_message_parts.wsdl" do
|
5
|
+
|
6
|
+
subject do
|
7
|
+
parser = Wasabi::Parser.new Nokogiri::XML(xml)
|
8
|
+
parser.parse
|
9
|
+
parser
|
10
|
+
end
|
11
|
+
|
12
|
+
let(:xml) { fixture(:no_message_parts).read }
|
13
|
+
|
14
|
+
it "falls back to using the message type in the port element" do
|
15
|
+
subject.operations[:save][:input].should == "SaveSoapIn"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "falls back to using the namespace ID in the port element" do
|
19
|
+
subject.operations[:save][:namespace_identifier].should == "actions"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wasabi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 2.4.
|
9
|
+
- 1
|
10
|
+
version: 2.4.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel Harrington
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-06-
|
18
|
+
date: 2012-06-18 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- spec/fixtures/multiple_namespaces.wsdl
|
127
127
|
- spec/fixtures/multiple_types.wsdl
|
128
128
|
- spec/fixtures/namespaced_actions.wsdl
|
129
|
+
- spec/fixtures/no_message_parts.wsdl
|
129
130
|
- spec/fixtures/no_namespace.wsdl
|
130
131
|
- spec/fixtures/soap12.wsdl
|
131
132
|
- spec/fixtures/symbolic_endpoint.wsdl
|
@@ -144,6 +145,7 @@ files:
|
|
144
145
|
- spec/wasabi/document/two_bindings_spec.rb
|
145
146
|
- spec/wasabi/document_spec.rb
|
146
147
|
- spec/wasabi/parser/multiple_namespaces_spec.rb
|
148
|
+
- spec/wasabi/parser/no_message_parts_spec.rb
|
147
149
|
- spec/wasabi/parser/no_namespace_spec.rb
|
148
150
|
- spec/wasabi/parser/no_target_namespace_spec.rb
|
149
151
|
- spec/wasabi/parser/symbolic_endpoint_spec.rb
|
@@ -191,6 +193,7 @@ test_files:
|
|
191
193
|
- spec/fixtures/multiple_namespaces.wsdl
|
192
194
|
- spec/fixtures/multiple_types.wsdl
|
193
195
|
- spec/fixtures/namespaced_actions.wsdl
|
196
|
+
- spec/fixtures/no_message_parts.wsdl
|
194
197
|
- spec/fixtures/no_namespace.wsdl
|
195
198
|
- spec/fixtures/soap12.wsdl
|
196
199
|
- spec/fixtures/symbolic_endpoint.wsdl
|
@@ -209,6 +212,7 @@ test_files:
|
|
209
212
|
- spec/wasabi/document/two_bindings_spec.rb
|
210
213
|
- spec/wasabi/document_spec.rb
|
211
214
|
- spec/wasabi/parser/multiple_namespaces_spec.rb
|
215
|
+
- spec/wasabi/parser/no_message_parts_spec.rb
|
212
216
|
- spec/wasabi/parser/no_namespace_spec.rb
|
213
217
|
- spec/wasabi/parser/no_target_namespace_spec.rb
|
214
218
|
- spec/wasabi/parser/symbolic_endpoint_spec.rb
|