troelskn-handsoap 0.2.1 → 0.2.2
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/VERSION.yml +1 -1
- data/lib/handsoap/service.rb +31 -22
- data/lib/handsoap.rb +0 -8
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/handsoap/service.rb
CHANGED
@@ -14,8 +14,17 @@ module Utf8StringPatch
|
|
14
14
|
self.serialize('UTF-8').gsub('<', '<').gsub('>', '>').gsub('"', '"').gsub(''', "'").gsub('&', '&')
|
15
15
|
end
|
16
16
|
end
|
17
|
-
|
18
|
-
Nokogiri
|
17
|
+
|
18
|
+
module Nokogiri
|
19
|
+
module XML
|
20
|
+
class Text
|
21
|
+
include Utf8StringPatch
|
22
|
+
end
|
23
|
+
class Nodeset
|
24
|
+
include Utf8StringPatch
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
19
28
|
|
20
29
|
module Handsoap
|
21
30
|
|
@@ -143,25 +152,25 @@ module Handsoap
|
|
143
152
|
super
|
144
153
|
end
|
145
154
|
end
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
155
|
+
def invoke(action, options = { :soap_action => :auto }, &block)
|
156
|
+
if action
|
157
|
+
if options.kind_of? String
|
158
|
+
options = { :soap_action => options }
|
159
|
+
end
|
160
|
+
if options[:soap_action] == :auto
|
161
|
+
options[:soap_action] = action.gsub(/^.+:/, "")
|
162
|
+
elsif options[:soap_action] == :none
|
163
|
+
options[:soap_action] = nil
|
164
|
+
end
|
165
|
+
doc = make_envelope do |body|
|
166
|
+
body.add action
|
167
|
+
end
|
168
|
+
if block_given?
|
169
|
+
yield doc.find(action)
|
170
|
+
end
|
171
|
+
dispatch(doc, options[:soap_action])
|
172
|
+
end
|
173
|
+
end
|
165
174
|
def on_before_dispatch
|
166
175
|
end
|
167
176
|
def on_fault(fault)
|
@@ -228,7 +237,7 @@ module Handsoap
|
|
228
237
|
headers = {
|
229
238
|
"Content-Type" => "#{self.class.request_content_type};charset=UTF-8"
|
230
239
|
}
|
231
|
-
|
240
|
+
headers["SOAPAction"] = action unless action.nil?
|
232
241
|
body = doc.to_s
|
233
242
|
debug do |logger|
|
234
243
|
logger.puts "==============="
|
data/lib/handsoap.rb
CHANGED