g4s_client 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/.gitignore +1 -0
- data/Gemfile +4 -0
- data/README +0 -0
- data/Rakefile +2 -0
- data/g4s_client.gemspec +36 -0
- data/lib/g4s/g4s.rb +29 -0
- data/lib/g4s/shipping/IPSShippingClient.rb +89 -0
- data/lib/g4s/shipping/default.rb +533 -0
- data/lib/g4s/shipping/defaultDriver.rb +63 -0
- data/lib/g4s/shipping/defaultMappingRegistry.rb +581 -0
- data/lib/g4s/tracking/IPSTrackingClient.rb +137 -0
- data/lib/g4s/tracking/default.rb +831 -0
- data/lib/g4s/tracking/defaultDriver.rb +79 -0
- data/lib/g4s/tracking/defaultMappingRegistry.rb +872 -0
- data/lib/g4s/utilities/IPSUtilitiesClient.rb +545 -0
- data/lib/g4s/utilities/default.rb +517 -0
- data/lib/g4s/utilities/defaultDriver.rb +215 -0
- data/lib/g4s/utilities/defaultMappingRegistry.rb +510 -0
- data/lib/g4s/version.rb +3 -0
- data/notes.txt +18 -0
- metadata +87 -0
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'default.rb'
|
2
|
+
require 'defaultMappingRegistry.rb'
|
3
|
+
require 'soap/rpc/driver'
|
4
|
+
|
5
|
+
class IPSTrackingSoap < ::SOAP::RPC::Driver
|
6
|
+
DefaultEndpointUrl = "https://ws.g4si.com/IPStracking.asmx"
|
7
|
+
|
8
|
+
Methods = [
|
9
|
+
[ "http://tempuri.org/GetShipmentInfoByTrackingNumber",
|
10
|
+
"getShipmentInfoByTrackingNumber",
|
11
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentInfoByTrackingNumber"]],
|
12
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentInfoByTrackingNumberResponse"]] ],
|
13
|
+
{ :request_style => :document, :request_use => :literal,
|
14
|
+
:response_style => :document, :response_use => :literal,
|
15
|
+
:faults => {} }
|
16
|
+
],
|
17
|
+
[ "http://tempuri.org/GetShipmentTrackingList",
|
18
|
+
"getShipmentTrackingList",
|
19
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentTrackingList"]],
|
20
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentTrackingListResponse"]] ],
|
21
|
+
{ :request_style => :document, :request_use => :literal,
|
22
|
+
:response_style => :document, :response_use => :literal,
|
23
|
+
:faults => {} }
|
24
|
+
],
|
25
|
+
[ "http://tempuri.org/GetShipmentStatusListForSearchRequest",
|
26
|
+
"getShipmentStatusListForSearchRequest",
|
27
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentStatusListForSearchRequest"]],
|
28
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentStatusListForSearchRequestResponse"]] ],
|
29
|
+
{ :request_style => :document, :request_use => :literal,
|
30
|
+
:response_style => :document, :response_use => :literal,
|
31
|
+
:faults => {} }
|
32
|
+
],
|
33
|
+
[ "http://tempuri.org/GetShipmentExceptionsForSearchRequest",
|
34
|
+
"getShipmentExceptionsForSearchRequest",
|
35
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentExceptionsForSearchRequest"]],
|
36
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentExceptionsForSearchRequestResponse"]] ],
|
37
|
+
{ :request_style => :document, :request_use => :literal,
|
38
|
+
:response_style => :document, :response_use => :literal,
|
39
|
+
:faults => {} }
|
40
|
+
],
|
41
|
+
[ "http://tempuri.org/GetShipmentStatus",
|
42
|
+
"getShipmentStatus",
|
43
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentStatus"]],
|
44
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://tempuri.org/", "GetShipmentStatusResponse"]] ],
|
45
|
+
{ :request_style => :document, :request_use => :literal,
|
46
|
+
:response_style => :document, :response_use => :literal,
|
47
|
+
:faults => {} }
|
48
|
+
]
|
49
|
+
]
|
50
|
+
|
51
|
+
def initialize(endpoint_url = nil)
|
52
|
+
endpoint_url ||= DefaultEndpointUrl
|
53
|
+
super(endpoint_url, nil)
|
54
|
+
self.mapping_registry = DefaultMappingRegistry::EncodedRegistry
|
55
|
+
self.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry
|
56
|
+
init_methods
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def init_methods
|
62
|
+
Methods.each do |definitions|
|
63
|
+
opt = definitions.last
|
64
|
+
if opt[:request_style] == :document
|
65
|
+
add_document_operation(*definitions)
|
66
|
+
else
|
67
|
+
add_rpc_operation(*definitions)
|
68
|
+
qname = definitions[0]
|
69
|
+
name = definitions[2]
|
70
|
+
if qname.name != name and qname.name.capitalize == name.capitalize
|
71
|
+
::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
|
72
|
+
__send__(name, *arg)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|