secondrotation-channel_advisor 0.0.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.
Files changed (40) hide show
  1. data/README +3 -0
  2. data/lib/channel_advisor.rb +8 -0
  3. data/lib/channel_advisor/auth_handler.rb +21 -0
  4. data/lib/channel_advisor/cart_service.rb +4 -0
  5. data/lib/channel_advisor/cart_service/client.rb +79 -0
  6. data/lib/channel_advisor/cart_service/mapping_registry.rb +344 -0
  7. data/lib/channel_advisor/cart_service/types.rb +385 -0
  8. data/lib/channel_advisor/errors.rb +10 -0
  9. data/lib/channel_advisor/inventory_service.rb +42 -0
  10. data/lib/channel_advisor/inventory_service/client.rb +199 -0
  11. data/lib/channel_advisor/inventory_service/mapping_registry.rb +1651 -0
  12. data/lib/channel_advisor/inventory_service/types.rb +1544 -0
  13. data/lib/channel_advisor/marketplace_ad_service.rb +4 -0
  14. data/lib/channel_advisor/marketplace_ad_service/client.rb +71 -0
  15. data/lib/channel_advisor/marketplace_ad_service/mapping_registry.rb +334 -0
  16. data/lib/channel_advisor/marketplace_ad_service/types.rb +317 -0
  17. data/lib/channel_advisor/message_code.rb +30 -0
  18. data/lib/channel_advisor/order_service.rb +4 -0
  19. data/lib/channel_advisor/order_service/client.rb +87 -0
  20. data/lib/channel_advisor/order_service/mapping_registry.rb +1356 -0
  21. data/lib/channel_advisor/order_service/types.rb +1422 -0
  22. data/lib/channel_advisor/shared_requires.rb +10 -0
  23. data/lib/channel_advisor/shipping_service.rb +4 -0
  24. data/lib/channel_advisor/shipping_service/client.rb +71 -0
  25. data/lib/channel_advisor/shipping_service/mapping_registry.rb +309 -0
  26. data/lib/channel_advisor/shipping_service/types.rb +280 -0
  27. data/lib/channel_advisor/store_service.rb +4 -0
  28. data/lib/channel_advisor/store_service/client.rb +55 -0
  29. data/lib/channel_advisor/store_service/mapping_registry.rb +250 -0
  30. data/lib/channel_advisor/store_service/types.rb +180 -0
  31. data/lib/channel_advisor/tax_service.rb +4 -0
  32. data/lib/channel_advisor/tax_service/client.rb +55 -0
  33. data/lib/channel_advisor/tax_service/mapping_registry.rb +233 -0
  34. data/lib/channel_advisor/tax_service/types.rb +221 -0
  35. data/test/lib/channel_advisor/auth_handler_spec.rb +46 -0
  36. data/test/lib/channel_advisor/inventory_service_spec.rb +62 -0
  37. data/test/lib/channel_advisor/message_code_spec.rb +40 -0
  38. data/test/spec.opts +2 -0
  39. data/test/spec_helper.rb +4 -0
  40. metadata +117 -0
@@ -0,0 +1,385 @@
1
+ module ChannelAdvisor; module CartServiceSOAP
2
+
3
+
4
+ # {http://api.channeladvisor.com/webservices/}APIResultOfCart
5
+ # status - ChannelAdvisor::CartServiceSOAP::ResultStatus
6
+ # messageCode - SOAP::SOAPInt
7
+ # message - SOAP::SOAPString
8
+ # data - SOAP::SOAPString
9
+ # resultData - ChannelAdvisor::CartServiceSOAP::Cart
10
+ class APIResultOfCart
11
+ attr_accessor :status
12
+ attr_accessor :messageCode
13
+ attr_accessor :message
14
+ attr_accessor :data
15
+ attr_accessor :resultData
16
+
17
+ def initialize(status = nil, messageCode = nil, message = nil, data = nil, resultData = nil)
18
+ @status = status
19
+ @messageCode = messageCode
20
+ @message = message
21
+ @data = data
22
+ @resultData = resultData
23
+ end
24
+ end
25
+
26
+ # {http://api.channeladvisor.com/webservices/}APICredentials
27
+ # developerKey - SOAP::SOAPString
28
+ # password - SOAP::SOAPString
29
+ class APICredentials
30
+ attr_accessor :developerKey
31
+ attr_accessor :password
32
+
33
+ def initialize(developerKey = nil, password = nil)
34
+ @developerKey = developerKey
35
+ @password = password
36
+ end
37
+ end
38
+
39
+ # {http://api.channeladvisor.com/webservices/}APIResultOfInt32
40
+ # status - ChannelAdvisor::CartServiceSOAP::ResultStatus
41
+ # messageCode - SOAP::SOAPInt
42
+ # message - SOAP::SOAPString
43
+ # data - SOAP::SOAPString
44
+ # resultData - SOAP::SOAPInt
45
+ class APIResultOfInt32
46
+ attr_accessor :status
47
+ attr_accessor :messageCode
48
+ attr_accessor :message
49
+ attr_accessor :data
50
+ attr_accessor :resultData
51
+
52
+ def initialize(status = nil, messageCode = nil, message = nil, data = nil, resultData = nil)
53
+ @status = status
54
+ @messageCode = messageCode
55
+ @message = message
56
+ @data = data
57
+ @resultData = resultData
58
+ end
59
+ end
60
+
61
+ # {http://api.channeladvisor.com/webservices/}ArrayOfCartItemRequest
62
+ class ArrayOfCartItemRequest < ::Array
63
+ end
64
+
65
+ # {http://api.channeladvisor.com/webservices/}APIResultOfString
66
+ # status - ChannelAdvisor::CartServiceSOAP::ResultStatus
67
+ # messageCode - SOAP::SOAPInt
68
+ # message - SOAP::SOAPString
69
+ # data - SOAP::SOAPString
70
+ # resultData - SOAP::SOAPString
71
+ class APIResultOfString
72
+ attr_accessor :status
73
+ attr_accessor :messageCode
74
+ attr_accessor :message
75
+ attr_accessor :data
76
+ attr_accessor :resultData
77
+
78
+ def initialize(status = nil, messageCode = nil, message = nil, data = nil, resultData = nil)
79
+ @status = status
80
+ @messageCode = messageCode
81
+ @message = message
82
+ @data = data
83
+ @resultData = resultData
84
+ end
85
+ end
86
+
87
+ # {http://api.channeladvisor.com/datacontracts/orders}Cart
88
+ # cartID - SOAP::SOAPInt
89
+ # checkoutURL - SOAP::SOAPString
90
+ # lineItemList - ChannelAdvisor::CartServiceSOAP::ArrayOfCartItem
91
+ class Cart
92
+ attr_accessor :cartID
93
+ attr_accessor :checkoutURL
94
+ attr_accessor :lineItemList
95
+
96
+ def initialize(cartID = nil, checkoutURL = nil, lineItemList = nil)
97
+ @cartID = cartID
98
+ @checkoutURL = checkoutURL
99
+ @lineItemList = lineItemList
100
+ end
101
+ end
102
+
103
+ # {http://api.channeladvisor.com/datacontracts/orders}ArrayOfCartItem
104
+ class ArrayOfCartItem < ::Array
105
+ end
106
+
107
+ # {http://api.channeladvisor.com/datacontracts/orders}InventoryItemBase
108
+ # abstract
109
+ # sKU - SOAP::SOAPString
110
+ # title - SOAP::SOAPString
111
+ class InventoryItemBase
112
+ attr_accessor :sKU
113
+ attr_accessor :title
114
+
115
+ def initialize(sKU = nil, title = nil)
116
+ @sKU = sKU
117
+ @title = title
118
+ end
119
+ end
120
+
121
+ # {http://api.channeladvisor.com/datacontracts/orders}CartItem
122
+ # abstract
123
+ # sKU - SOAP::SOAPString
124
+ # title - SOAP::SOAPString
125
+ # lineItemID - SOAP::SOAPInt
126
+ # quantity - SOAP::SOAPInt
127
+ # itemSaleSource - ChannelAdvisor::CartServiceSOAP::SiteToken
128
+ # unitPrice - SOAP::SOAPDecimal
129
+ class CartItem < InventoryItemBase
130
+ attr_accessor :sKU
131
+ attr_accessor :title
132
+ attr_accessor :lineItemID
133
+ attr_accessor :quantity
134
+ attr_accessor :itemSaleSource
135
+ attr_accessor :unitPrice
136
+
137
+ def initialize(sKU = nil, title = nil, lineItemID = nil, quantity = nil, itemSaleSource = nil, unitPrice = nil)
138
+ @sKU = sKU
139
+ @title = title
140
+ @lineItemID = lineItemID
141
+ @quantity = quantity
142
+ @itemSaleSource = itemSaleSource
143
+ @unitPrice = unitPrice
144
+ end
145
+ end
146
+
147
+ # {http://api.channeladvisor.com/datacontracts/orders}CartItemResponse
148
+ # sKU - SOAP::SOAPString
149
+ # title - SOAP::SOAPString
150
+ # lineItemID - SOAP::SOAPInt
151
+ # quantity - SOAP::SOAPInt
152
+ # itemSaleSource - ChannelAdvisor::CartServiceSOAP::SiteToken
153
+ # unitPrice - SOAP::SOAPDecimal
154
+ # currencyCode - SOAP::SOAPString
155
+ # unitWeight - ChannelAdvisor::CartServiceSOAP::ItemWeight
156
+ class CartItemResponse < CartItem
157
+ attr_accessor :sKU
158
+ attr_accessor :title
159
+ attr_accessor :lineItemID
160
+ attr_accessor :quantity
161
+ attr_accessor :itemSaleSource
162
+ attr_accessor :unitPrice
163
+ attr_accessor :currencyCode
164
+ attr_accessor :unitWeight
165
+
166
+ def initialize(sKU = nil, title = nil, lineItemID = nil, quantity = nil, itemSaleSource = nil, unitPrice = nil, currencyCode = nil, unitWeight = nil)
167
+ @sKU = sKU
168
+ @title = title
169
+ @lineItemID = lineItemID
170
+ @quantity = quantity
171
+ @itemSaleSource = itemSaleSource
172
+ @unitPrice = unitPrice
173
+ @currencyCode = currencyCode
174
+ @unitWeight = unitWeight
175
+ end
176
+ end
177
+
178
+ # {http://api.channeladvisor.com/datacontracts/orders}CartItemRequest
179
+ # sKU - SOAP::SOAPString
180
+ # title - SOAP::SOAPString
181
+ # lineItemID - SOAP::SOAPInt
182
+ # quantity - SOAP::SOAPInt
183
+ # itemSaleSource - ChannelAdvisor::CartServiceSOAP::SiteToken
184
+ # unitPrice - SOAP::SOAPDecimal
185
+ # allowNegativeQuantity - SOAP::SOAPBoolean
186
+ class CartItemRequest < CartItem
187
+ attr_accessor :sKU
188
+ attr_accessor :title
189
+ attr_accessor :lineItemID
190
+ attr_accessor :quantity
191
+ attr_accessor :itemSaleSource
192
+ attr_accessor :unitPrice
193
+ attr_accessor :allowNegativeQuantity
194
+
195
+ def initialize(sKU = nil, title = nil, lineItemID = nil, quantity = nil, itemSaleSource = nil, unitPrice = nil, allowNegativeQuantity = nil)
196
+ @sKU = sKU
197
+ @title = title
198
+ @lineItemID = lineItemID
199
+ @quantity = quantity
200
+ @itemSaleSource = itemSaleSource
201
+ @unitPrice = unitPrice
202
+ @allowNegativeQuantity = allowNegativeQuantity
203
+ end
204
+ end
205
+
206
+ # {http://api.channeladvisor.com/datacontracts/orders}ItemWeight
207
+ # xmlattr_UnitOfMeasure - SOAP::SOAPString
208
+ class ItemWeight < ::String
209
+ AttrUnitOfMeasure = XSD::QName.new(nil, "UnitOfMeasure")
210
+
211
+ def __xmlattr
212
+ @__xmlattr ||= {}
213
+ end
214
+
215
+ def xmlattr_UnitOfMeasure
216
+ __xmlattr[AttrUnitOfMeasure]
217
+ end
218
+
219
+ def xmlattr_UnitOfMeasure=(value)
220
+ __xmlattr[AttrUnitOfMeasure] = value
221
+ end
222
+
223
+ def initialize(*arg)
224
+ super
225
+ @__xmlattr = {}
226
+ end
227
+ end
228
+
229
+ # {http://api.channeladvisor.com/webservices/}ResultStatus
230
+ class ResultStatus < ::String
231
+ Failure = ResultStatus.new("Failure")
232
+ Success = ResultStatus.new("Success")
233
+ end
234
+
235
+ # {http://api.channeladvisor.com/datacontracts/orders}SiteToken
236
+ class SiteToken < ::String
237
+ AMAZON_AUCTIONS = SiteToken.new("AMAZON_AUCTIONS")
238
+ AMAZON_MARKETPLACE = SiteToken.new("AMAZON_MARKETPLACE")
239
+ AMAZON_MERCHANTSAT = SiteToken.new("AMAZON_MERCHANTSAT")
240
+ AMAZON_UK = SiteToken.new("AMAZON_UK")
241
+ BUY_DOT_COM = SiteToken.new("BUY_DOT_COM")
242
+ CHANNELADVISOR_STORE = SiteToken.new("CHANNELADVISOR_STORE")
243
+ DEMANDWARE_STORE = SiteToken.new("DEMANDWARE_STORE")
244
+ DIRECT_SALE = SiteToken.new("DIRECT_SALE")
245
+ EBAY_AU = SiteToken.new("EBAY_AU")
246
+ EBAY_CA = SiteToken.new("EBAY_CA")
247
+ EBAY_DE = SiteToken.new("EBAY_DE")
248
+ EBAY_ES = SiteToken.new("EBAY_ES")
249
+ EBAY_FR = SiteToken.new("EBAY_FR")
250
+ EBAY_IE = SiteToken.new("EBAY_IE")
251
+ EBAY_IT = SiteToken.new("EBAY_IT")
252
+ EBAY_MOTORS = SiteToken.new("EBAY_MOTORS")
253
+ EBAY_MOTORS_FIXED_PRICE = SiteToken.new("EBAY_MOTORS_FIXED_PRICE")
254
+ EBAY_STORES = SiteToken.new("EBAY_STORES")
255
+ EBAY_UK = SiteToken.new("EBAY_UK")
256
+ EBAY_US = SiteToken.new("EBAY_US")
257
+ OVERSTOCK = SiteToken.new("OVERSTOCK")
258
+ OVERSTOCK_SHOPPING = SiteToken.new("OVERSTOCK_SHOPPING")
259
+ PIXMANIA = SiteToken.new("PIXMANIA")
260
+ STOREADVISOR_PREMIUM = SiteToken.new("STOREADVISOR_PREMIUM")
261
+ TRADING_POST = SiteToken.new("TRADING_POST")
262
+ UNKNOWN = SiteToken.new("UNKNOWN")
263
+ YAHOO = SiteToken.new("YAHOO")
264
+ YAHOO_STORES = SiteToken.new("YAHOO_STORES")
265
+ end
266
+
267
+ # {http://api.channeladvisor.com/webservices/}GetCart
268
+ # accountID - SOAP::SOAPString
269
+ # cartID - SOAP::SOAPInt
270
+ class GetCart
271
+ attr_accessor :accountID
272
+ attr_accessor :cartID
273
+
274
+ def initialize(accountID = nil, cartID = nil)
275
+ @accountID = accountID
276
+ @cartID = cartID
277
+ end
278
+ end
279
+
280
+ # {http://api.channeladvisor.com/webservices/}GetCartResponse
281
+ # getCartResult - ChannelAdvisor::CartServiceSOAP::APIResultOfCart
282
+ class GetCartResponse
283
+ attr_accessor :getCartResult
284
+
285
+ def initialize(getCartResult = nil)
286
+ @getCartResult = getCartResult
287
+ end
288
+ end
289
+
290
+ # {http://api.channeladvisor.com/webservices/}DeleteCart
291
+ # accountID - SOAP::SOAPString
292
+ # cartID - SOAP::SOAPInt
293
+ class DeleteCart
294
+ attr_accessor :accountID
295
+ attr_accessor :cartID
296
+
297
+ def initialize(accountID = nil, cartID = nil)
298
+ @accountID = accountID
299
+ @cartID = cartID
300
+ end
301
+ end
302
+
303
+ # {http://api.channeladvisor.com/webservices/}DeleteCartResponse
304
+ # deleteCartResult - ChannelAdvisor::CartServiceSOAP::APIResultOfInt32
305
+ class DeleteCartResponse
306
+ attr_accessor :deleteCartResult
307
+
308
+ def initialize(deleteCartResult = nil)
309
+ @deleteCartResult = deleteCartResult
310
+ end
311
+ end
312
+
313
+ # {http://api.channeladvisor.com/webservices/}CreateCart
314
+ # accountID - SOAP::SOAPString
315
+ # buyerEmail - SOAP::SOAPString
316
+ # lineItem - ChannelAdvisor::CartServiceSOAP::ArrayOfCartItemRequest
317
+ class CreateCart
318
+ attr_accessor :accountID
319
+ attr_accessor :buyerEmail
320
+ attr_accessor :lineItem
321
+
322
+ def initialize(accountID = nil, buyerEmail = nil, lineItem = nil)
323
+ @accountID = accountID
324
+ @buyerEmail = buyerEmail
325
+ @lineItem = lineItem
326
+ end
327
+ end
328
+
329
+ # {http://api.channeladvisor.com/webservices/}CreateCartResponse
330
+ # createCartResult - ChannelAdvisor::CartServiceSOAP::APIResultOfCart
331
+ class CreateCartResponse
332
+ attr_accessor :createCartResult
333
+
334
+ def initialize(createCartResult = nil)
335
+ @createCartResult = createCartResult
336
+ end
337
+ end
338
+
339
+ # {http://api.channeladvisor.com/webservices/}ModifyCart
340
+ # accountID - SOAP::SOAPString
341
+ # cartID - SOAP::SOAPInt
342
+ # buyerEmail - SOAP::SOAPString
343
+ # lineItem - ChannelAdvisor::CartServiceSOAP::ArrayOfCartItemRequest
344
+ class ModifyCart
345
+ attr_accessor :accountID
346
+ attr_accessor :cartID
347
+ attr_accessor :buyerEmail
348
+ attr_accessor :lineItem
349
+
350
+ def initialize(accountID = nil, cartID = nil, buyerEmail = nil, lineItem = nil)
351
+ @accountID = accountID
352
+ @cartID = cartID
353
+ @buyerEmail = buyerEmail
354
+ @lineItem = lineItem
355
+ end
356
+ end
357
+
358
+ # {http://api.channeladvisor.com/webservices/}ModifyCartResponse
359
+ # modifyCartResult - ChannelAdvisor::CartServiceSOAP::APIResultOfCart
360
+ class ModifyCartResponse
361
+ attr_accessor :modifyCartResult
362
+
363
+ def initialize(modifyCartResult = nil)
364
+ @modifyCartResult = modifyCartResult
365
+ end
366
+ end
367
+
368
+ # {http://api.channeladvisor.com/webservices/}Ping
369
+ class Ping
370
+ def initialize
371
+ end
372
+ end
373
+
374
+ # {http://api.channeladvisor.com/webservices/}PingResponse
375
+ # pingResult - ChannelAdvisor::CartServiceSOAP::APIResultOfString
376
+ class PingResponse
377
+ attr_accessor :pingResult
378
+
379
+ def initialize(pingResult = nil)
380
+ @pingResult = pingResult
381
+ end
382
+ end
383
+
384
+
385
+ end; end
@@ -0,0 +1,10 @@
1
+ module ChannelAdvisor
2
+ class Error < Exception
3
+ attr_accessor :response, :message_code
4
+
5
+ def initialize(response, message_code)
6
+ @response = response
7
+ @message_code = message_code
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,42 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), 'shared_requires.rb'))
2
+ require File.expand_path(File.join(File.dirname(__FILE__), 'inventory_service', 'types.rb'))
3
+ require File.expand_path(File.join(File.dirname(__FILE__), 'inventory_service', 'mapping_registry.rb'))
4
+ require File.expand_path(File.join(File.dirname(__FILE__), 'inventory_service', 'client.rb'))
5
+
6
+ module ChannelAdvisor
7
+ class InventoryService
8
+
9
+ def initialize
10
+ @client = InventoryServiceSOAP::InventoryServiceSoap.new
11
+ @client.headerhandler << ChannelAdvisor::AuthHandler.new
12
+ end
13
+
14
+ InventoryServiceSOAP::InventoryServiceSoap::Methods.each do |m|
15
+ method_name = m[1]
16
+ result_method = "#{method_name}Result"
17
+ class_name = method_name[0..0].upcase + method_name[1..-1]
18
+
19
+ define_method(method_name) do |*args|
20
+ args = args.unshift(configatron.channel_advisor.account_id)
21
+
22
+ request_class = InventoryServiceSOAP.const_get(class_name)
23
+ request = request_class.new(*args)
24
+
25
+ result = @client.send(method_name, request)
26
+ response = result.send(result_method)
27
+
28
+ check_for_success(response)
29
+ response.resultData
30
+ end
31
+
32
+ end
33
+
34
+
35
+ protected
36
+ def check_for_success(response)
37
+ unless response.status == 'Success'
38
+ raise ChannelAdvisor::Error.new(response, MessageCode.get(response.messageCode))
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,199 @@
1
+ module ChannelAdvisor::InventoryServiceSOAP
2
+
3
+ class InventoryServiceSoap < ::SOAP::RPC::Driver
4
+ DefaultEndpointUrl = "https://api.channeladvisor.com/ChannelAdvisorAPI/v1/InventoryService.asmx"
5
+
6
+ Methods = [
7
+ [ "http://api.channeladvisor.com/webservices/DoesSkuExist",
8
+ "doesSkuExist",
9
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "DoesSkuExist"]],
10
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "DoesSkuExistResponse"]] ],
11
+ { :request_style => :document, :request_use => :literal,
12
+ :response_style => :document, :response_use => :literal,
13
+ :faults => {} }
14
+ ],
15
+ [ "http://api.channeladvisor.com/webservices/DoesSkuExistList",
16
+ "doesSkuExistList",
17
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "DoesSkuExistList"]],
18
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "DoesSkuExistListResponse"]] ],
19
+ { :request_style => :document, :request_use => :literal,
20
+ :response_style => :document, :response_use => :literal,
21
+ :faults => {} }
22
+ ],
23
+ [ "http://api.channeladvisor.com/webservices/DeleteInventoryItem",
24
+ "deleteInventoryItem",
25
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "DeleteInventoryItem"]],
26
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "DeleteInventoryItemResponse"]] ],
27
+ { :request_style => :document, :request_use => :literal,
28
+ :response_style => :document, :response_use => :literal,
29
+ :faults => {} }
30
+ ],
31
+ [ "http://api.channeladvisor.com/webservices/GetInventoryItemList",
32
+ "getInventoryItemList",
33
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemList"]],
34
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemListResponse"]] ],
35
+ { :request_style => :document, :request_use => :literal,
36
+ :response_style => :document, :response_use => :literal,
37
+ :faults => {} }
38
+ ],
39
+ [ "http://api.channeladvisor.com/webservices/GetFilteredInventoryItemList",
40
+ "getFilteredInventoryItemList",
41
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetFilteredInventoryItemList"]],
42
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetFilteredInventoryItemListResponse"]] ],
43
+ { :request_style => :document, :request_use => :literal,
44
+ :response_style => :document, :response_use => :literal,
45
+ :faults => {} }
46
+ ],
47
+ [ "http://api.channeladvisor.com/webservices/GetFilteredSkuList",
48
+ "getFilteredSkuList",
49
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetFilteredSkuList"]],
50
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetFilteredSkuListResponse"]] ],
51
+ { :request_style => :document, :request_use => :literal,
52
+ :response_style => :document, :response_use => :literal,
53
+ :faults => {} }
54
+ ],
55
+ [ "http://api.channeladvisor.com/webservices/GetInventoryItemShippingInfo",
56
+ "getInventoryItemShippingInfo",
57
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemShippingInfo"]],
58
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemShippingInfoResponse"]] ],
59
+ { :request_style => :document, :request_use => :literal,
60
+ :response_style => :document, :response_use => :literal,
61
+ :faults => {} }
62
+ ],
63
+ [ "http://api.channeladvisor.com/webservices/GetInventoryItemQuantityInfo",
64
+ "getInventoryItemQuantityInfo",
65
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemQuantityInfo"]],
66
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemQuantityInfoResponse"]] ],
67
+ { :request_style => :document, :request_use => :literal,
68
+ :response_style => :document, :response_use => :literal,
69
+ :faults => {} }
70
+ ],
71
+ [ "http://api.channeladvisor.com/webservices/GetClassificationConfigurationInformation",
72
+ "getClassificationConfigurationInformation",
73
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetClassificationConfigurationInformation"]],
74
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetClassificationConfigurationInformationResponse"]] ],
75
+ { :request_style => :document, :request_use => :literal,
76
+ :response_style => :document, :response_use => :literal,
77
+ :faults => {} }
78
+ ],
79
+ [ "http://api.channeladvisor.com/webservices/GetInventoryItemClassificationAttributeList",
80
+ "getInventoryItemClassificationAttributeList",
81
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemClassificationAttributeList"]],
82
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemClassificationAttributeListResponse"]] ],
83
+ { :request_style => :document, :request_use => :literal,
84
+ :response_style => :document, :response_use => :literal,
85
+ :faults => {} }
86
+ ],
87
+ [ "http://api.channeladvisor.com/webservices/GetInventoryItemVariationInfo",
88
+ "getInventoryItemVariationInfo",
89
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemVariationInfo"]],
90
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemVariationInfoResponse"]] ],
91
+ { :request_style => :document, :request_use => :literal,
92
+ :response_style => :document, :response_use => :literal,
93
+ :faults => {} }
94
+ ],
95
+ [ "http://api.channeladvisor.com/webservices/GetInventoryItemStoreInfo",
96
+ "getInventoryItemStoreInfo",
97
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemStoreInfo"]],
98
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemStoreInfoResponse"]] ],
99
+ { :request_style => :document, :request_use => :literal,
100
+ :response_style => :document, :response_use => :literal,
101
+ :faults => {} }
102
+ ],
103
+ [ "http://api.channeladvisor.com/webservices/GetInventoryItemImageList",
104
+ "getInventoryItemImageList",
105
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemImageList"]],
106
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryItemImageListResponse"]] ],
107
+ { :request_style => :document, :request_use => :literal,
108
+ :response_style => :document, :response_use => :literal,
109
+ :faults => {} }
110
+ ],
111
+ [ "http://api.channeladvisor.com/webservices/SynchInventoryItem",
112
+ "synchInventoryItem",
113
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "SynchInventoryItem"]],
114
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "SynchInventoryItemResponse"]] ],
115
+ { :request_style => :document, :request_use => :literal,
116
+ :response_style => :document, :response_use => :literal,
117
+ :faults => {} }
118
+ ],
119
+ [ "http://api.channeladvisor.com/webservices/SynchInventoryItemList",
120
+ "synchInventoryItemList",
121
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "SynchInventoryItemList"]],
122
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "SynchInventoryItemListResponse"]] ],
123
+ { :request_style => :document, :request_use => :literal,
124
+ :response_style => :document, :response_use => :literal,
125
+ :faults => {} }
126
+ ],
127
+ [ "http://api.channeladvisor.com/webservices/UpdateInventoryItemQuantityAndPrice",
128
+ "updateInventoryItemQuantityAndPrice",
129
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "UpdateInventoryItemQuantityAndPrice"]],
130
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "UpdateInventoryItemQuantityAndPriceResponse"]] ],
131
+ { :request_style => :document, :request_use => :literal,
132
+ :response_style => :document, :response_use => :literal,
133
+ :faults => {} }
134
+ ],
135
+ [ "http://api.channeladvisor.com/webservices/UpdateInventoryItemQuantityAndPriceList",
136
+ "updateInventoryItemQuantityAndPriceList",
137
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "UpdateInventoryItemQuantityAndPriceList"]],
138
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "UpdateInventoryItemQuantityAndPriceListResponse"]] ],
139
+ { :request_style => :document, :request_use => :literal,
140
+ :response_style => :document, :response_use => :literal,
141
+ :faults => {} }
142
+ ],
143
+ [ "http://api.channeladvisor.com/webservices/GetInventoryQuantity",
144
+ "getInventoryQuantity",
145
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryQuantity"]],
146
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryQuantityResponse"]] ],
147
+ { :request_style => :document, :request_use => :literal,
148
+ :response_style => :document, :response_use => :literal,
149
+ :faults => {} }
150
+ ],
151
+ [ "http://api.channeladvisor.com/webservices/GetInventoryQuantityList",
152
+ "getInventoryQuantityList",
153
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryQuantityList"]],
154
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "GetInventoryQuantityListResponse"]] ],
155
+ { :request_style => :document, :request_use => :literal,
156
+ :response_style => :document, :response_use => :literal,
157
+ :faults => {} }
158
+ ],
159
+ [ "http://api.channeladvisor.com/webservices/Ping",
160
+ "ping",
161
+ [ ["in", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "Ping"]],
162
+ ["out", "parameters", ["::SOAP::SOAPElement", "http://api.channeladvisor.com/webservices/", "PingResponse"]] ],
163
+ { :request_style => :document, :request_use => :literal,
164
+ :response_style => :document, :response_use => :literal,
165
+ :faults => {} }
166
+ ]
167
+ ]
168
+
169
+ def initialize(endpoint_url = nil)
170
+ endpoint_url ||= DefaultEndpointUrl
171
+ super(endpoint_url, nil)
172
+ self.mapping_registry = DefaultMappingRegistry::EncodedRegistry
173
+ self.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry
174
+ init_methods
175
+ end
176
+
177
+ private
178
+
179
+ def init_methods
180
+ Methods.each do |definitions|
181
+ opt = definitions.last
182
+ if opt[:request_style] == :document
183
+ add_document_operation(*definitions)
184
+ else
185
+ add_rpc_operation(*definitions)
186
+ qname = definitions[0]
187
+ name = definitions[2]
188
+ if qname.name != name and qname.name.capitalize == name.capitalize
189
+ ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
190
+ __send__(name, *arg)
191
+ end
192
+ end
193
+ end
194
+ end
195
+ end
196
+ end
197
+
198
+
199
+ end