channel_advisor 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/README +46 -0
  2. data/lib/channel_advisor/admin_service/client.rb +63 -0
  3. data/lib/channel_advisor/admin_service/mapping_registry.rb +206 -0
  4. data/lib/channel_advisor/admin_service/types.rb +175 -0
  5. data/lib/channel_advisor/admin_service.rb +14 -0
  6. data/lib/channel_advisor/auth_handler.rb +21 -0
  7. data/lib/channel_advisor/cart_service/client.rb +79 -0
  8. data/lib/channel_advisor/cart_service/mapping_registry.rb +344 -0
  9. data/lib/channel_advisor/cart_service/types.rb +386 -0
  10. data/lib/channel_advisor/cart_service.rb +14 -0
  11. data/lib/channel_advisor/errors.rb +13 -0
  12. data/lib/channel_advisor/inventory_service/client.rb +223 -0
  13. data/lib/channel_advisor/inventory_service/mapping_registry.rb +1765 -0
  14. data/lib/channel_advisor/inventory_service/types.rb +1708 -0
  15. data/lib/channel_advisor/inventory_service.rb +14 -0
  16. data/lib/channel_advisor/listing_service/client.rb +55 -0
  17. data/lib/channel_advisor/listing_service/mapping_registry.rb +153 -0
  18. data/lib/channel_advisor/listing_service/types.rb +125 -0
  19. data/lib/channel_advisor/listing_service.rb +14 -0
  20. data/lib/channel_advisor/marketplace_ad_service/client.rb +71 -0
  21. data/lib/channel_advisor/marketplace_ad_service/mapping_registry.rb +334 -0
  22. data/lib/channel_advisor/marketplace_ad_service/types.rb +317 -0
  23. data/lib/channel_advisor/marketplace_ad_service.rb +14 -0
  24. data/lib/channel_advisor/message_code.rb +30 -0
  25. data/lib/channel_advisor/order_service/client.rb +111 -0
  26. data/lib/channel_advisor/order_service/mapping_registry.rb +1696 -0
  27. data/lib/channel_advisor/order_service/types.rb +1781 -0
  28. data/lib/channel_advisor/order_service.rb +14 -0
  29. data/lib/channel_advisor/service_proxy.rb +62 -0
  30. data/lib/channel_advisor/shared_requires.rb +11 -0
  31. data/lib/channel_advisor/shipping_service/client.rb +79 -0
  32. data/lib/channel_advisor/shipping_service/mapping_registry.rb +500 -0
  33. data/lib/channel_advisor/shipping_service/types.rb +431 -0
  34. data/lib/channel_advisor/shipping_service.rb +14 -0
  35. data/lib/channel_advisor/store_service/client.rb +55 -0
  36. data/lib/channel_advisor/store_service/mapping_registry.rb +250 -0
  37. data/lib/channel_advisor/store_service/types.rb +180 -0
  38. data/lib/channel_advisor/store_service.rb +14 -0
  39. data/lib/channel_advisor/tax_service/client.rb +55 -0
  40. data/lib/channel_advisor/tax_service/mapping_registry.rb +233 -0
  41. data/lib/channel_advisor/tax_service/types.rb +221 -0
  42. data/lib/channel_advisor/tax_service.rb +14 -0
  43. data/lib/channel_advisor.rb +4 -0
  44. data/spec/integration/inventory_sync_spec.rb +55 -0
  45. data/spec/lib/channel_advisor/admin_service_spec.rb +12 -0
  46. data/spec/lib/channel_advisor/auth_handler_spec.rb +46 -0
  47. data/spec/lib/channel_advisor/cart_service_spec.rb +12 -0
  48. data/spec/lib/channel_advisor/errors_spec.rb +23 -0
  49. data/spec/lib/channel_advisor/inventory_service_spec.rb +12 -0
  50. data/spec/lib/channel_advisor/marketplace_ad_service_spec.rb +12 -0
  51. data/spec/lib/channel_advisor/message_code_spec.rb +40 -0
  52. data/spec/lib/channel_advisor/order_service_spec.rb +12 -0
  53. data/spec/lib/channel_advisor/service_proxy_spec.rb +130 -0
  54. data/spec/lib/channel_advisor/shipping_service_spec.rb +12 -0
  55. data/spec/lib/channel_advisor/store_service_spec.rb +12 -0
  56. data/spec/lib/channel_advisor/tax_service_spec.rb +12 -0
  57. data/spec/spec.opts +2 -0
  58. data/spec/spec_helper.rb +4 -0
  59. metadata +170 -0
@@ -0,0 +1,14 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'shared_requires.rb'))
2
+ ['types.rb', 'mapping_registry.rb', 'client.rb'].each do |required|
3
+ require File.expand_path(File.join(File.dirname(__FILE__), 'inventory_service', required))
4
+ end
5
+
6
+ module ChannelAdvisor
7
+ class InventoryService
8
+ include ChannelAdvisor::ServiceProxy
9
+ define_service_methods(
10
+ ChannelAdvisor::InventoryServiceSOAP,
11
+ ChannelAdvisor::InventoryServiceSOAP::InventoryServiceSoap
12
+ )
13
+ end
14
+ end
@@ -0,0 +1,55 @@
1
+ module ChannelAdvisor::ListingServiceSOAP
2
+
3
+ class ListingServiceSoap < ::SOAP::RPC::Driver
4
+ DefaultEndpointUrl = "https://api.channeladvisor.com/ChannelAdvisorAPI/v1/ListingService.asmx"
5
+
6
+ Methods = [
7
+ [ "http://api.channeladvisor.com/webservices/WithdrawListings",
8
+ "withdrawListings",
9
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "WithdrawListings"]],
10
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "WithdrawListingsResponse"]] ],
11
+ { :request_style => :document, :request_use => :literal,
12
+ :response_style => :document, :response_use => :literal,
13
+ :faults => {} }
14
+ ],
15
+ [ "http://api.channeladvisor.com/webservices/Ping",
16
+ "ping",
17
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "Ping"]],
18
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "PingResponse"]] ],
19
+ { :request_style => :document, :request_use => :literal,
20
+ :response_style => :document, :response_use => :literal,
21
+ :faults => {} }
22
+ ]
23
+ ]
24
+
25
+ def initialize(endpoint_url = nil)
26
+ endpoint_url ||= DefaultEndpointUrl
27
+ super(endpoint_url, nil)
28
+ self.mapping_registry = DefaultMappingRegistry::EncodedRegistry
29
+ self.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry
30
+ init_methods
31
+ end
32
+
33
+ private
34
+
35
+ def init_methods
36
+ Methods.each do |definitions|
37
+ opt = definitions.last
38
+ if opt[:request_style] == :document
39
+ add_document_operation(*definitions)
40
+ else
41
+ add_rpc_operation(*definitions)
42
+ qname = definitions[0]
43
+ name = definitions[2]
44
+ if qname.name != name and qname.name.capitalize == name.capitalize
45
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
46
+ __send__(name, *arg)
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+
55
+ end
@@ -0,0 +1,153 @@
1
+ module ChannelAdvisor; module ListingServiceSOAP
2
+
3
+ module DefaultMappingRegistry
4
+ EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new
5
+ LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new
6
+ NsWebservices = "http://api.channeladvisor.com/webservices/"
7
+
8
+ EncodedRegistry.register(
9
+ :class => ChannelAdvisor::ListingServiceSOAP::ArrayOfString,
10
+ :schema_type => XSD::QName.new(NsWebservices, "ArrayOfString"),
11
+ :schema_element => [
12
+ ["string", "SOAP::SOAPString[]", [0, nil]]
13
+ ]
14
+ )
15
+
16
+ EncodedRegistry.register(
17
+ :class => ChannelAdvisor::ListingServiceSOAP::APIResultOfInt32,
18
+ :schema_type => XSD::QName.new(NsWebservices, "APIResultOfInt32"),
19
+ :schema_element => [
20
+ ["status", ["ChannelAdvisor::ListingServiceSOAP::ResultStatus", XSD::QName.new(NsWebservices, "Status")]],
21
+ ["messageCode", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "MessageCode")]],
22
+ ["message", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Message")], [0, 1]],
23
+ ["data", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Data")], [0, 1]],
24
+ ["resultData", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "ResultData")]]
25
+ ]
26
+ )
27
+
28
+ EncodedRegistry.register(
29
+ :class => ChannelAdvisor::ListingServiceSOAP::APICredentials,
30
+ :schema_type => XSD::QName.new(NsWebservices, "APICredentials"),
31
+ :schema_element => [
32
+ ["developerKey", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "DeveloperKey")], [0, 1]],
33
+ ["password", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Password")], [0, 1]]
34
+ ]
35
+ )
36
+
37
+ EncodedRegistry.register(
38
+ :class => ChannelAdvisor::ListingServiceSOAP::APIResultOfString,
39
+ :schema_type => XSD::QName.new(NsWebservices, "APIResultOfString"),
40
+ :schema_element => [
41
+ ["status", ["ChannelAdvisor::ListingServiceSOAP::ResultStatus", XSD::QName.new(NsWebservices, "Status")]],
42
+ ["messageCode", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "MessageCode")]],
43
+ ["message", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Message")], [0, 1]],
44
+ ["data", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Data")], [0, 1]],
45
+ ["resultData", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "ResultData")], [0, 1]]
46
+ ]
47
+ )
48
+
49
+ EncodedRegistry.register(
50
+ :class => ChannelAdvisor::ListingServiceSOAP::WithdrawReason,
51
+ :schema_type => XSD::QName.new(NsWebservices, "WithdrawReason")
52
+ )
53
+
54
+ EncodedRegistry.register(
55
+ :class => ChannelAdvisor::ListingServiceSOAP::ResultStatus,
56
+ :schema_type => XSD::QName.new(NsWebservices, "ResultStatus")
57
+ )
58
+
59
+ LiteralRegistry.register(
60
+ :class => ChannelAdvisor::ListingServiceSOAP::ArrayOfString,
61
+ :schema_type => XSD::QName.new(NsWebservices, "ArrayOfString"),
62
+ :schema_element => [
63
+ ["string", "SOAP::SOAPString[]", [0, nil]]
64
+ ]
65
+ )
66
+
67
+ LiteralRegistry.register(
68
+ :class => ChannelAdvisor::ListingServiceSOAP::APIResultOfInt32,
69
+ :schema_type => XSD::QName.new(NsWebservices, "APIResultOfInt32"),
70
+ :schema_element => [
71
+ ["status", ["ChannelAdvisor::ListingServiceSOAP::ResultStatus", XSD::QName.new(NsWebservices, "Status")]],
72
+ ["messageCode", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "MessageCode")]],
73
+ ["message", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Message")], [0, 1]],
74
+ ["data", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Data")], [0, 1]],
75
+ ["resultData", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "ResultData")]]
76
+ ]
77
+ )
78
+
79
+ LiteralRegistry.register(
80
+ :class => ChannelAdvisor::ListingServiceSOAP::APICredentials,
81
+ :schema_type => XSD::QName.new(NsWebservices, "APICredentials"),
82
+ :schema_element => [
83
+ ["developerKey", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "DeveloperKey")], [0, 1]],
84
+ ["password", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Password")], [0, 1]]
85
+ ]
86
+ )
87
+
88
+ LiteralRegistry.register(
89
+ :class => ChannelAdvisor::ListingServiceSOAP::APIResultOfString,
90
+ :schema_type => XSD::QName.new(NsWebservices, "APIResultOfString"),
91
+ :schema_element => [
92
+ ["status", ["ChannelAdvisor::ListingServiceSOAP::ResultStatus", XSD::QName.new(NsWebservices, "Status")]],
93
+ ["messageCode", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "MessageCode")]],
94
+ ["message", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Message")], [0, 1]],
95
+ ["data", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Data")], [0, 1]],
96
+ ["resultData", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "ResultData")], [0, 1]]
97
+ ]
98
+ )
99
+
100
+ LiteralRegistry.register(
101
+ :class => ChannelAdvisor::ListingServiceSOAP::WithdrawReason,
102
+ :schema_type => XSD::QName.new(NsWebservices, "WithdrawReason")
103
+ )
104
+
105
+ LiteralRegistry.register(
106
+ :class => ChannelAdvisor::ListingServiceSOAP::ResultStatus,
107
+ :schema_type => XSD::QName.new(NsWebservices, "ResultStatus")
108
+ )
109
+
110
+ LiteralRegistry.register(
111
+ :class => ChannelAdvisor::ListingServiceSOAP::WithdrawListings,
112
+ :schema_name => XSD::QName.new(NsWebservices, "WithdrawListings"),
113
+ :schema_element => [
114
+ ["accountID", "SOAP::SOAPString", [0, 1]],
115
+ ["skuList", "ChannelAdvisor::ListingServiceSOAP::ArrayOfString", [0, 1]],
116
+ ["listingIDList", "ChannelAdvisor::ListingServiceSOAP::ArrayOfString", [0, 1]],
117
+ ["withdrawReason", "ChannelAdvisor::ListingServiceSOAP::WithdrawReason"]
118
+ ]
119
+ )
120
+
121
+ LiteralRegistry.register(
122
+ :class => ChannelAdvisor::ListingServiceSOAP::WithdrawListingsResponse,
123
+ :schema_name => XSD::QName.new(NsWebservices, "WithdrawListingsResponse"),
124
+ :schema_element => [
125
+ ["withdrawListingsResult", ["ChannelAdvisor::ListingServiceSOAP::APIResultOfInt32", XSD::QName.new(NsWebservices, "WithdrawListingsResult")], [0, 1]]
126
+ ]
127
+ )
128
+
129
+ LiteralRegistry.register(
130
+ :class => ChannelAdvisor::ListingServiceSOAP::APICredentials,
131
+ :schema_name => XSD::QName.new(NsWebservices, "APICredentials"),
132
+ :schema_element => [
133
+ ["developerKey", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "DeveloperKey")], [0, 1]],
134
+ ["password", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Password")], [0, 1]]
135
+ ]
136
+ )
137
+
138
+ LiteralRegistry.register(
139
+ :class => ChannelAdvisor::ListingServiceSOAP::Ping,
140
+ :schema_name => XSD::QName.new(NsWebservices, "Ping"),
141
+ :schema_element => []
142
+ )
143
+
144
+ LiteralRegistry.register(
145
+ :class => ChannelAdvisor::ListingServiceSOAP::PingResponse,
146
+ :schema_name => XSD::QName.new(NsWebservices, "PingResponse"),
147
+ :schema_element => [
148
+ ["pingResult", ["ChannelAdvisor::ListingServiceSOAP::APIResultOfString", XSD::QName.new(NsWebservices, "PingResult")], [0, 1]]
149
+ ]
150
+ )
151
+ end
152
+
153
+ end; end
@@ -0,0 +1,125 @@
1
+ module ChannelAdvisor; module ListingServiceSOAP
2
+
3
+
4
+ # {http://api.channeladvisor.com/webservices/}ArrayOfString
5
+ class ArrayOfString < ::Array
6
+ end
7
+
8
+ # {http://api.channeladvisor.com/webservices/}APIResultOfInt32
9
+ # status - ChannelAdvisor::ListingServiceSOAP::ResultStatus
10
+ # messageCode - SOAP::SOAPInt
11
+ # message - SOAP::SOAPString
12
+ # data - SOAP::SOAPString
13
+ # resultData - SOAP::SOAPInt
14
+ class APIResultOfInt32
15
+ attr_accessor :status
16
+ attr_accessor :messageCode
17
+ attr_accessor :message
18
+ attr_accessor :data
19
+ attr_accessor :resultData
20
+
21
+ def initialize(status = nil, messageCode = nil, message = nil, data = nil, resultData = nil)
22
+ @status = status
23
+ @messageCode = messageCode
24
+ @message = message
25
+ @data = data
26
+ @resultData = resultData
27
+ end
28
+ end
29
+
30
+ # {http://api.channeladvisor.com/webservices/}APICredentials
31
+ # developerKey - SOAP::SOAPString
32
+ # password - SOAP::SOAPString
33
+ class APICredentials
34
+ attr_accessor :developerKey
35
+ attr_accessor :password
36
+
37
+ def initialize(developerKey = nil, password = nil)
38
+ @developerKey = developerKey
39
+ @password = password
40
+ end
41
+ end
42
+
43
+ # {http://api.channeladvisor.com/webservices/}APIResultOfString
44
+ # status - ChannelAdvisor::ListingServiceSOAP::ResultStatus
45
+ # messageCode - SOAP::SOAPInt
46
+ # message - SOAP::SOAPString
47
+ # data - SOAP::SOAPString
48
+ # resultData - SOAP::SOAPString
49
+ class APIResultOfString
50
+ attr_accessor :status
51
+ attr_accessor :messageCode
52
+ attr_accessor :message
53
+ attr_accessor :data
54
+ attr_accessor :resultData
55
+
56
+ def initialize(status = nil, messageCode = nil, message = nil, data = nil, resultData = nil)
57
+ @status = status
58
+ @messageCode = messageCode
59
+ @message = message
60
+ @data = data
61
+ @resultData = resultData
62
+ end
63
+ end
64
+
65
+ # {http://api.channeladvisor.com/webservices/}WithdrawReason
66
+ class WithdrawReason < ::String
67
+ ErrorInMinimumBidOrReserve = WithdrawReason.new("ErrorInMinimumBidOrReserve")
68
+ ErrorInTheListing = WithdrawReason.new("ErrorInTheListing")
69
+ ItemNoLongerAvailableForSale = WithdrawReason.new("ItemNoLongerAvailableForSale")
70
+ ItemWasLostOrBroken = WithdrawReason.new("ItemWasLostOrBroken")
71
+ end
72
+
73
+ # {http://api.channeladvisor.com/webservices/}ResultStatus
74
+ class ResultStatus < ::String
75
+ Failure = ResultStatus.new("Failure")
76
+ Success = ResultStatus.new("Success")
77
+ end
78
+
79
+ # {http://api.channeladvisor.com/webservices/}WithdrawListings
80
+ # accountID - SOAP::SOAPString
81
+ # skuList - ChannelAdvisor::ListingServiceSOAP::ArrayOfString
82
+ # listingIDList - ChannelAdvisor::ListingServiceSOAP::ArrayOfString
83
+ # withdrawReason - ChannelAdvisor::ListingServiceSOAP::WithdrawReason
84
+ class WithdrawListings
85
+ attr_accessor :accountID
86
+ attr_accessor :skuList
87
+ attr_accessor :listingIDList
88
+ attr_accessor :withdrawReason
89
+
90
+ def initialize(accountID = nil, skuList = nil, listingIDList = nil, withdrawReason = nil)
91
+ @accountID = accountID
92
+ @skuList = skuList
93
+ @listingIDList = listingIDList
94
+ @withdrawReason = withdrawReason
95
+ end
96
+ end
97
+
98
+ # {http://api.channeladvisor.com/webservices/}WithdrawListingsResponse
99
+ # withdrawListingsResult - ChannelAdvisor::ListingServiceSOAP::APIResultOfInt32
100
+ class WithdrawListingsResponse
101
+ attr_accessor :withdrawListingsResult
102
+
103
+ def initialize(withdrawListingsResult = nil)
104
+ @withdrawListingsResult = withdrawListingsResult
105
+ end
106
+ end
107
+
108
+ # {http://api.channeladvisor.com/webservices/}Ping
109
+ class Ping
110
+ def initialize
111
+ end
112
+ end
113
+
114
+ # {http://api.channeladvisor.com/webservices/}PingResponse
115
+ # pingResult - ChannelAdvisor::ListingServiceSOAP::APIResultOfString
116
+ class PingResponse
117
+ attr_accessor :pingResult
118
+
119
+ def initialize(pingResult = nil)
120
+ @pingResult = pingResult
121
+ end
122
+ end
123
+
124
+
125
+ end; end
@@ -0,0 +1,14 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'shared_requires.rb'))
2
+ ['types.rb', 'mapping_registry.rb', 'client.rb'].each do |required|
3
+ require File.expand_path(File.join(File.dirname(__FILE__), 'listing_service', required))
4
+ end
5
+
6
+ module ChannelAdvisor
7
+ class ListingService
8
+ include ChannelAdvisor::ServiceProxy
9
+ define_service_methods(
10
+ ChannelAdvisor::ListingServiceSOAP,
11
+ ChannelAdvisor::ListingServiceSOAP::ListingServiceSoap
12
+ )
13
+ end
14
+ end
@@ -0,0 +1,71 @@
1
+ module ChannelAdvisor::MarketplaceAdServiceSOAP
2
+
3
+ class MarketplaceAdServiceSoap < ::SOAP::RPC::Driver
4
+ DefaultEndpointUrl = "https://api.channeladvisor.com/ChannelAdvisorAPI/v1/MarketplaceAdService.asmx"
5
+
6
+ Methods = [
7
+ [ "http://api.channeladvisor.com/webservices/AddMarketplaceAd",
8
+ "addMarketplaceAd",
9
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "AddMarketplaceAd"]],
10
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "AddMarketplaceAdResponse"]] ],
11
+ { :request_style => :document, :request_use => :literal,
12
+ :response_style => :document, :response_use => :literal,
13
+ :faults => {} }
14
+ ],
15
+ [ "http://api.channeladvisor.com/webservices/AddMarketplaceAdForSkuList",
16
+ "addMarketplaceAdForSkuList",
17
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "AddMarketplaceAdForSkuList"]],
18
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "AddMarketplaceAdForSkuListResponse"]] ],
19
+ { :request_style => :document, :request_use => :literal,
20
+ :response_style => :document, :response_use => :literal,
21
+ :faults => {} }
22
+ ],
23
+ [ "http://api.channeladvisor.com/webservices/DeleteMarketplaceAd",
24
+ "deleteMarketplaceAd",
25
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "DeleteMarketplaceAd"]],
26
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "DeleteMarketplaceAdResponse"]] ],
27
+ { :request_style => :document, :request_use => :literal,
28
+ :response_style => :document, :response_use => :literal,
29
+ :faults => {} }
30
+ ],
31
+ [ "http://api.channeladvisor.com/webservices/Ping",
32
+ "ping",
33
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "Ping"]],
34
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "PingResponse"]] ],
35
+ { :request_style => :document, :request_use => :literal,
36
+ :response_style => :document, :response_use => :literal,
37
+ :faults => {} }
38
+ ]
39
+ ]
40
+
41
+ def initialize(endpoint_url = nil)
42
+ endpoint_url ||= DefaultEndpointUrl
43
+ super(endpoint_url, nil)
44
+ self.mapping_registry = DefaultMappingRegistry::EncodedRegistry
45
+ self.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry
46
+ init_methods
47
+ end
48
+
49
+ private
50
+
51
+ def init_methods
52
+ Methods.each do |definitions|
53
+ opt = definitions.last
54
+ if opt[:request_style] == :document
55
+ add_document_operation(*definitions)
56
+ else
57
+ add_rpc_operation(*definitions)
58
+ qname = definitions[0]
59
+ name = definitions[2]
60
+ if qname.name != name and qname.name.capitalize == name.capitalize
61
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
62
+ __send__(name, *arg)
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+
70
+
71
+ end