g4s_client 0.1.2 → 0.1.4
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/.gitignore +1 -0
- data/g4s_client.gemspec +4 -4
- data/lib/g4s/g4s.rb +30 -20
- data/lib/g4s/g4si_auth_header.rb +21 -0
- data/lib/g4s/shipping/IPSShippingClient.rb +3 -0
- data/lib/g4s/shipping/default.rb +507 -504
- data/lib/g4s/shipping/defaultDriver.rb +61 -50
- data/lib/g4s/tracking/IPSTrackingClient.rb +5 -1
- data/lib/g4s/tracking/default.rb +813 -808
- data/lib/g4s/tracking/defaultDriver.rb +77 -67
- data/lib/g4s/tracking/defaultMappingRegistry.rb +4 -1
- data/lib/g4s/utilities/IPSUtilitiesClient.rb +3 -1
- data/lib/g4s/utilities/default.rb +401 -397
- data/lib/g4s/utilities/defaultDriver.rb +214 -203
- data/lib/g4s/utilities/defaultMappingRegistry.rb +3 -1
- data/lib/g4s_client.rb +85 -0
- data/lib/version.rb +5 -0
- metadata +11 -10
- data/lib/g4s/version.rb +0 -3
@@ -1,79 +1,89 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
#puts "REQUIRING: #{Dir[__FILE__]}"
|
2
|
+
|
3
|
+
require 'g4s/tracking/default'
|
4
|
+
require 'g4s/tracking/defaultMappingRegistry'
|
3
5
|
require 'soap/rpc/driver'
|
4
6
|
|
5
|
-
class
|
6
|
-
|
7
|
+
class Tracking
|
8
|
+
class IPSTrackingSoap < ::SOAP::RPC::Driver
|
9
|
+
DefaultEndpointUrl = "https://ws.g4si.com/IPStracking.asmx"
|
7
10
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
11
|
+
Methods = [
|
12
|
+
[ "http://tempuri.org/GetShipmentInfoByTrackingNumber",
|
13
|
+
"getShipmentInfoByTrackingNumber",
|
14
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentInfoByTrackingNumber"]],
|
15
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentInfoByTrackingNumberResponse"]] ],
|
16
|
+
{ :request_style => :document, :request_use => :literal,
|
17
|
+
:response_style => :document, :response_use => :literal,
|
18
|
+
:faults => {} }
|
19
|
+
],
|
20
|
+
[ "http://tempuri.org/GetShipmentTrackingList",
|
21
|
+
"getShipmentTrackingList",
|
22
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentTrackingList"]],
|
23
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentTrackingListResponse"]] ],
|
24
|
+
{ :request_style => :document, :request_use => :literal,
|
25
|
+
:response_style => :document, :response_use => :literal,
|
26
|
+
:faults => {} }
|
27
|
+
],
|
28
|
+
[ "http://tempuri.org/GetShipmentStatusListForSearchRequest",
|
29
|
+
"getShipmentStatusListForSearchRequest",
|
30
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentStatusListForSearchRequest"]],
|
31
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentStatusListForSearchRequestResponse"]] ],
|
32
|
+
{ :request_style => :document, :request_use => :literal,
|
33
|
+
:response_style => :document, :response_use => :literal,
|
34
|
+
:faults => {} }
|
35
|
+
],
|
36
|
+
[ "http://tempuri.org/GetShipmentExceptionsForSearchRequest",
|
37
|
+
"getShipmentExceptionsForSearchRequest",
|
38
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentExceptionsForSearchRequest"]],
|
39
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentExceptionsForSearchRequestResponse"]] ],
|
40
|
+
{ :request_style => :document, :request_use => :literal,
|
41
|
+
:response_style => :document, :response_use => :literal,
|
42
|
+
:faults => {} }
|
43
|
+
],
|
44
|
+
[ "http://tempuri.org/GetShipmentStatus",
|
45
|
+
"getShipmentStatus",
|
46
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentStatus"]],
|
47
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentStatusResponse"]] ],
|
48
|
+
{ :request_style => :document, :request_use => :literal,
|
49
|
+
:response_style => :document, :response_use => :literal,
|
50
|
+
:faults => {} }
|
51
|
+
]
|
48
52
|
]
|
49
|
-
]
|
50
53
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
54
|
+
def initialize(endpoint_url = nil)
|
55
|
+
endpoint_url ||= DefaultEndpointUrl
|
56
|
+
super(endpoint_url, nil)
|
57
|
+
self.mapping_registry = DefaultMappingRegistry::EncodedRegistry
|
58
|
+
self.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry
|
59
|
+
init_methods
|
60
|
+
end
|
58
61
|
|
59
|
-
private
|
62
|
+
private
|
60
63
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
64
|
+
def init_methods
|
65
|
+
Methods.each do |definitions|
|
66
|
+
opt = definitions.last
|
67
|
+
|
68
|
+
# TURNS OFF n1 NAMESPACE:
|
69
|
+
opt.merge!({
|
70
|
+
:elementformdefault => true,
|
71
|
+
:attributeformdefault => true
|
72
|
+
})
|
73
|
+
|
74
|
+
if opt[:request_style] == :document
|
75
|
+
add_document_operation(*definitions)
|
76
|
+
else
|
77
|
+
add_rpc_operation(*definitions)
|
78
|
+
qname = definitions[0]
|
79
|
+
name = definitions[2]
|
80
|
+
if qname.name != name and qname.name.capitalize == name.capitalize
|
81
|
+
::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
|
82
|
+
__send__(name, *arg)
|
83
|
+
end
|
73
84
|
end
|
74
85
|
end
|
75
86
|
end
|
76
87
|
end
|
77
88
|
end
|
78
|
-
end
|
79
|
-
|
89
|
+
end
|