soap_client 0.2.0 → 0.3.0
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/soap_client/client.rb +18 -11
- data/lib/soap_client/services/build_savon_attrs.rb +15 -0
- data/lib/soap_client/version.rb +1 -1
- data/lib/soap_client.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dac54722a44857206aebfbf763b504a8836592a
|
4
|
+
data.tar.gz: 6b85d4ec4fc05ed41e94cafad39578867902b2ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01b9f4db9cb19eb5e2111b62a37136de857288b259fca3f2a71b911016c652d15ce0410d34b03228c9f6b4bca57004f33629a6e37d51fe70a6370b75e0086c42
|
7
|
+
data.tar.gz: e7db22f841d7bcbc3257f2cdde12edbe2f5210fc6fe27dd246090d5e65124fbde839d8fac2e33cbbe004b0ef651a829ede055aba2f16e047738a5314ed1f8e53
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,11 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## [0.3.0] - 2017-02-13
|
7
|
+
### Added
|
8
|
+
- Log in the info level, the request and response XMLs if logging is enabled
|
9
|
+
- Logger logs to STDOUT by default
|
10
|
+
|
6
11
|
## [0.2.0] - 2016-03-09
|
7
12
|
### Added
|
8
13
|
- `read_timeout` and `open_timeout` to set the timeout values, in seconds, to the SOAP client
|
data/lib/soap_client/client.rb
CHANGED
@@ -6,7 +6,7 @@ module SOAPClient
|
|
6
6
|
attribute :action, Symbol
|
7
7
|
attribute :message, Hash
|
8
8
|
attribute :wsdl, String
|
9
|
-
attribute :logger
|
9
|
+
attribute :logger, Object, lazy: true, default: :default_logger
|
10
10
|
attribute :log, Boolean, default: false
|
11
11
|
attribute :proxy, String
|
12
12
|
attribute :open_timeout, Integer
|
@@ -17,23 +17,30 @@ module SOAPClient
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def call
|
20
|
-
|
20
|
+
if log
|
21
|
+
savon_request = savon_client.build_request(action, message: message)
|
22
|
+
logger.info "Request XML: #{savon_request.body}"
|
23
|
+
end
|
24
|
+
|
25
|
+
savon_response = savon_client.call(action, message: message)
|
26
|
+
|
27
|
+
logger.info("Response XML: #{savon_response.xml}") if log
|
28
|
+
|
29
|
+
savon_response
|
21
30
|
end
|
22
31
|
|
23
32
|
private
|
24
33
|
|
25
34
|
def savon_client
|
26
|
-
@savon_client ||= Savon.client(
|
35
|
+
@savon_client ||= Savon.client(savon_attrs)
|
36
|
+
end
|
37
|
+
|
38
|
+
def savon_attrs
|
39
|
+
BuildSavonAttrs.(attributes)
|
27
40
|
end
|
28
41
|
|
29
|
-
def
|
30
|
-
|
31
|
-
:wsdl,
|
32
|
-
:log,
|
33
|
-
:logger,
|
34
|
-
)
|
35
|
-
attrs[:proxy] = proxy if proxy.present?
|
36
|
-
attrs
|
42
|
+
def default_logger
|
43
|
+
Logger.new(STDOUT)
|
37
44
|
end
|
38
45
|
|
39
46
|
end
|
data/lib/soap_client/version.rb
CHANGED
data/lib/soap_client.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soap_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- bin/setup
|
115
115
|
- lib/soap_client.rb
|
116
116
|
- lib/soap_client/client.rb
|
117
|
+
- lib/soap_client/services/build_savon_attrs.rb
|
117
118
|
- lib/soap_client/version.rb
|
118
119
|
- soap_client.gemspec
|
119
120
|
homepage: https://github.com/imacchiato/soap_client
|
@@ -137,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
138
|
version: '0'
|
138
139
|
requirements: []
|
139
140
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.5.1
|
141
142
|
signing_key:
|
142
143
|
specification_version: 4
|
143
144
|
summary: Wrapper around SOAP clients (starts with Savon).
|