savon 2.10.0 → 2.10.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 041367085f94b9a23b1dc4725ce5e776c1efdaca
4
- data.tar.gz: 3920e53e9e6246063ab38a64aa7d26f31adc3dbd
3
+ metadata.gz: 18f0b7e0ce70c3e4875a47aec303544e0bddd385
4
+ data.tar.gz: baff63ce5ef87a00e0b3737c69a31f86fdfa1694
5
5
  SHA512:
6
- metadata.gz: 952a31b9b054f74ee5e152b3a85628b6a511e4ea5b134f0098b886940b27f23c2e23eb685241e6a79057ddfa9837dfc800adec5a8bf5e249f2d979fa2e296506
7
- data.tar.gz: 02d114680d544563398f70e74d1b46f5c4c3b7a0643ab165fc354cbb84d24a5472be5a156fc55ab07014a721ef97db523b9485ac42c544d517bba0e4e9ac5c83
6
+ metadata.gz: 45cdba7801e11d255ebf71aa73a7fc8f56249b9a4e58362957326b99e1fedc7b6ef53c1ed543228626d56316fedfc94c151e6596cd09b84d832ab0834f5500de
7
+ data.tar.gz: 1f8fdf10425799438c3be1619311360406756ffad3aa22007196227050f766ad2b021abbbc6a457e845c5e05ef157ab89c623612639189ff11d5db3bc16f0073
@@ -1,3 +1,7 @@
1
+ * 2.10.1 (2015-03-15)
2
+
3
+ * Feature: [#673](https://github.com/savonrb/savon/pull/673) Adds an :unwrap option that is passed to Gyoku.
4
+
1
5
  * 2.10.0 (2015-03-02)
2
6
 
3
7
  * Fix: This reverts a purported "fix" to operation names.
@@ -0,0 +1,126 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+ <wsdl:definitions name="NotificationBrokerService"
3
+ targetNamespace="http://docs.oasis-open.org/wsn/brw-2"
4
+ xmlns:tns="http://docs.oasis-open.org/wsn/brw-2"
5
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
6
+ xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
7
+ xmlns:ns1="http://docs.oasis-open.org/wsn/brw-2">
8
+
9
+ <wsdl:import namespace="http://docs.oasis-open.org/wsn/brw-2" location="http://docs.oasis-open.org/wsn/brw-2.wsdl"/>
10
+
11
+ <wsdl:binding name="NotificationBrokerSoapBinding" type="ns1:NotificationBroker">
12
+ <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
13
+ <wsdl:operation name="Notify">
14
+ <soap12:operation soapAction="" soapActionRequired="false" style="document"/>
15
+ <wsdl:input name="Notify">
16
+ <soap12:body use="literal"/>
17
+ </wsdl:input>
18
+ </wsdl:operation>
19
+ <wsdl:operation name="GetCurrentMessage">
20
+ <soap12:operation soapAction="" soapActionRequired="false" style="document"/>
21
+ <wsdl:input name="GetCurrentMessageRequest">
22
+ <soap12:body use="literal"/>
23
+ </wsdl:input>
24
+ <wsdl:output name="GetCurrentMessageResponse">
25
+ <soap12:body use="literal"/>
26
+ </wsdl:output>
27
+ <wsdl:fault name="TopicNotSupportedFault">
28
+ <soap12:fault name="TopicNotSupportedFault" use="literal"/>
29
+ </wsdl:fault>
30
+ <wsdl:fault name="TopicExpressionDialectUnknownFault">
31
+ <soap12:fault name="TopicExpressionDialectUnknownFault" use="literal"/>
32
+ </wsdl:fault>
33
+ <wsdl:fault name="MultipleTopicsSpecifiedFault">
34
+ <soap12:fault name="MultipleTopicsSpecifiedFault" use="literal"/>
35
+ </wsdl:fault>
36
+ <wsdl:fault name="InvalidTopicExpressionFault">
37
+ <soap12:fault name="InvalidTopicExpressionFault" use="literal"/>
38
+ </wsdl:fault>
39
+ <wsdl:fault name="ResourceUnknownFault">
40
+ <soap12:fault name="ResourceUnknownFault" use="literal"/>
41
+ </wsdl:fault>
42
+ <wsdl:fault name="NoCurrentMessageOnTopicFault">
43
+ <soap12:fault name="NoCurrentMessageOnTopicFault" use="literal"/>
44
+ </wsdl:fault>
45
+ </wsdl:operation>
46
+ <wsdl:operation name="RegisterPublisher">
47
+ <soap12:operation soapAction="" soapActionRequired="false" style="document"/>
48
+ <wsdl:input name="RegisterPublisherRequest">
49
+ <soap12:body use="literal"/>
50
+ </wsdl:input>
51
+ <wsdl:output name="RegisterPublisherResponse">
52
+ <soap12:body use="literal"/>
53
+ </wsdl:output>
54
+ <wsdl:fault name="TopicNotSupportedFault">
55
+ <soap12:fault name="TopicNotSupportedFault" use="literal"/>
56
+ </wsdl:fault>
57
+ <wsdl:fault name="PublisherRegistrationFailedFault">
58
+ <soap12:fault name="PublisherRegistrationFailedFault" use="literal"/>
59
+ </wsdl:fault>
60
+ <wsdl:fault name="UnacceptableInitialTerminationTimeFault">
61
+ <soap12:fault name="UnacceptableInitialTerminationTimeFault" use="literal"/>
62
+ </wsdl:fault>
63
+ <wsdl:fault name="InvalidTopicExpressionFault">
64
+ <soap12:fault name="InvalidTopicExpressionFault" use="literal"/>
65
+ </wsdl:fault>
66
+ <wsdl:fault name="ResourceUnknownFault">
67
+ <soap12:fault name="ResourceUnknownFault" use="literal"/>
68
+ </wsdl:fault>
69
+ <wsdl:fault name="PublisherRegistrationRejectedFault">
70
+ <soap12:fault name="PublisherRegistrationRejectedFault" use="literal"/>
71
+ </wsdl:fault>
72
+ </wsdl:operation>
73
+ <wsdl:operation name="Subscribe">
74
+ <soap12:operation soapAction="" soapActionRequired="false" style="document"/>
75
+ <wsdl:input name="SubscribeRequest">
76
+ <soap12:body use="literal"/>
77
+ </wsdl:input>
78
+ <wsdl:output name="SubscribeResponse">
79
+ <soap12:body use="literal"/>
80
+ </wsdl:output>
81
+ <wsdl:fault name="TopicNotSupportedFault">
82
+ <soap12:fault name="TopicNotSupportedFault" use="literal"/>
83
+ </wsdl:fault>
84
+ <wsdl:fault name="InvalidFilterFault">
85
+ <soap12:fault name="InvalidFilterFault" use="literal"/>
86
+ </wsdl:fault>
87
+ <wsdl:fault name="TopicExpressionDialectUnknownFault">
88
+ <soap12:fault name="TopicExpressionDialectUnknownFault" use="literal"/>
89
+ </wsdl:fault>
90
+ <wsdl:fault name="UnacceptableInitialTerminationTimeFault">
91
+ <soap12:fault name="UnacceptableInitialTerminationTimeFault" use="literal"/>
92
+ </wsdl:fault>
93
+ <wsdl:fault name="SubscribeCreationFailedFault">
94
+ <soap12:fault name="SubscribeCreationFailedFault" use="literal"/>
95
+ </wsdl:fault>
96
+ <wsdl:fault name="InvalidMessageContentExpressionFault">
97
+ <soap12:fault name="InvalidMessageContentExpressionFault" use="literal"/>
98
+ </wsdl:fault>
99
+ <wsdl:fault name="InvalidTopicExpressionFault">
100
+ <soap12:fault name="InvalidTopicExpressionFault" use="literal"/>
101
+ </wsdl:fault>
102
+ <wsdl:fault name="UnrecognizedPolicyRequestFault">
103
+ <soap12:fault name="UnrecognizedPolicyRequestFault" use="literal"/>
104
+ </wsdl:fault>
105
+ <wsdl:fault name="ResourceUnknownFault">
106
+ <soap12:fault name="ResourceUnknownFault" use="literal"/>
107
+ </wsdl:fault>
108
+ <wsdl:fault name="UnsupportedPolicyRequestFault">
109
+ <soap12:fault name="UnsupportedPolicyRequestFault" use="literal"/>
110
+ </wsdl:fault>
111
+ <wsdl:fault name="NotifyMessageNotSupportedFault">
112
+ <soap12:fault name="NotifyMessageNotSupportedFault" use="literal"/>
113
+ </wsdl:fault>
114
+ <wsdl:fault name="InvalidProducerPropertiesExpressionFault">
115
+ <soap12:fault name="InvalidProducerPropertiesExpressionFault" use="literal"/>
116
+ </wsdl:fault>
117
+ </wsdl:operation>
118
+ </wsdl:binding>
119
+
120
+ <wsdl:service name="NotificationBrokerService">
121
+ <wsdl:port binding="tns:NotificationBrokerSoapBinding" name="NotificationBrokerPort">
122
+ <soap12:address location="http://192.70.89.113:9000/wsn/NotificationBroker"/>
123
+ </wsdl:port>
124
+ </wsdl:service>
125
+
126
+ </wsdl:definitions>
@@ -166,7 +166,7 @@ module Savon
166
166
  element_form_default = @globals[:element_form_default] || @wsdl.element_form_default
167
167
  # TODO: clean this up! [dh, 2012-12-17]
168
168
  Message.new(message_tag, namespace_identifier, @types, @used_namespaces, @locals[:message],
169
- element_form_default, @globals[:convert_request_keys_to])
169
+ element_form_default, @globals[:convert_request_keys_to], @globals[:unwrap])
170
170
  end
171
171
 
172
172
  def namespace_identifier
@@ -4,7 +4,7 @@ require "gyoku"
4
4
  module Savon
5
5
  class Message
6
6
 
7
- def initialize(message_tag, namespace_identifier, types, used_namespaces, message, element_form_default, key_converter)
7
+ def initialize(message_tag, namespace_identifier, types, used_namespaces, message, element_form_default, key_converter, unwrap)
8
8
  @message_tag = message_tag
9
9
  @namespace_identifier = namespace_identifier
10
10
  @types = types
@@ -13,6 +13,7 @@ module Savon
13
13
  @message = message
14
14
  @element_form_default = element_form_default
15
15
  @key_converter = key_converter
16
+ @unwrap = unwrap
16
17
  end
17
18
 
18
19
  def to_s
@@ -25,7 +26,8 @@ module Savon
25
26
  gyoku_options = {
26
27
  :element_form_default => @element_form_default,
27
28
  :namespace => @namespace_identifier,
28
- :key_converter => @key_converter
29
+ :key_converter => @key_converter,
30
+ :unwrap => @unwrap
29
31
  }
30
32
 
31
33
  Gyoku.xml(@message, gyoku_options)
@@ -89,6 +89,7 @@ module Savon
89
89
  :use_wsa_headers => false,
90
90
  :no_message_tag => false,
91
91
  :follow_redirects => false,
92
+ :unwrap => false
92
93
  }
93
94
 
94
95
  options = defaults.merge(options)
@@ -287,6 +288,12 @@ module Savon
287
288
  @options[:convert_request_keys_to] = converter
288
289
  end
289
290
 
291
+ # Tell Gyoku to unwrap Array of Hashes
292
+ # Accepts a boolean, default to false
293
+ def unwrap(unwrap)
294
+ @options[:unwrap] = unwrap
295
+ end
296
+
290
297
  # Tell Nori how to convert XML tags from the SOAP response into Hash keys.
291
298
  # Accepts a lambda or a block which receives an XML tag and returns a Hash key.
292
299
  # Defaults to convert tags to snakecase Symbols.
@@ -1,3 +1,3 @@
1
1
  module Savon
2
- VERSION = '2.10.0'
2
+ VERSION = '2.10.1'
3
3
  end
data/test.rb ADDED
@@ -0,0 +1,64 @@
1
+ require 'savon'
2
+
3
+ class MyConfig
4
+ def wsdl; "NotificationBroker.wsdl"; end
5
+ def base; "base"; end
6
+ end
7
+
8
+
9
+ # Main module
10
+ module Surv
11
+ class Client
12
+ attr_accessor :topics
13
+ attr_reader :client, :config
14
+
15
+ def initialize(config)
16
+ @topics = Hash.new
17
+
18
+ #$stderr.puts("Entry point is #{config.proto}://#{config.site}:#{config.port}/#{config.entry}.")
19
+
20
+ client = Savon.client(wsdl: config.wsdl,
21
+ strip_namespaces: false,
22
+ log_level: :info,
23
+ convert_request_keys_to: :camelcase,
24
+ #pretty_print_xml: true,
25
+ )
26
+
27
+ #$stderr.puts("Entry point: #{client.wsdl.endpoint}")
28
+ $stderr.puts("Init done.")
29
+ $stderr.puts("Available methods: #{client.operations}")
30
+ @client = client
31
+ @config = config
32
+ end
33
+
34
+ def subscribe(topic, callback="callback")
35
+ my_topic = "#{@config.base}/#{callback}"
36
+ message = {
37
+ ConsumerReference: {
38
+ Address: my_topic,
39
+ },
40
+ Filter: {
41
+ TopicExpression: topic,
42
+ },
43
+ }
44
+
45
+ $stderr.puts(message)
46
+ $stderr.puts(" Subscribing #{my_topic} for #{topic}")
47
+
48
+ # @topics[callback] = Topic.new(callback)
49
+ # @topics[callback].bytes = 0
50
+ # @topics[callback].pkts = 0
51
+
52
+ begin
53
+ resp = client.call(:subscribe, message: message)
54
+ rescue Savon::Error => error
55
+ $stderr.puts("Error: #{error.http.code} #{error}")
56
+ else
57
+ puts "ZOMG request was successful??? #{resp}"
58
+ end
59
+ end
60
+ end
61
+ end
62
+
63
+
64
+ Surv::Client.new(MyConfig.new).subscribe('AsterixJSONGzipped')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: savon
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.0
4
+ version: 2.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Harrington
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-03 00:00:00.000000000 Z
11
+ date: 2015-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nori
@@ -219,6 +219,7 @@ files:
219
219
  - CONTRIBUTING.md
220
220
  - Gemfile
221
221
  - LICENSE
222
+ - NotificationBroker.wsdl
222
223
  - README.md
223
224
  - Rakefile
224
225
  - donate.png
@@ -303,6 +304,7 @@ files:
303
304
  - spec/support/fixture.rb
304
305
  - spec/support/integration.rb
305
306
  - spec/support/stdout.rb
307
+ - test.rb
306
308
  homepage: http://savonrb.com
307
309
  licenses:
308
310
  - MIT