g4s_client 0.1.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.
@@ -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
+