diff options
author | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-03 17:15:23 +0000 |
---|---|---|
committer | nahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-03 17:15:23 +0000 |
commit | 6ea9e723ea7ccff688c7bc093d868314d29fe95a (patch) | |
tree | ee655fc699db0b3ecacd5f0153b4315442546a57 | |
parent | 18b1fd953f5df852ce0298ddb8bf4ab5833ebd2e (diff) | |
download | ruby-6ea9e723ea7ccff688c7bc093d868314d29fe95a.tar.gz |
* lib/xsd/datatypes.rb: dump sign by itself. under the problematic platform,
sprintf("%+.10g", -0.0) => +0. Sigh.
* sample/wsdl/amazon/*: update schema ver2 to ver3.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/soap/marshal.rb | 2 | ||||
-rw-r--r-- | lib/soap/streamHandler.rb | 2 | ||||
-rw-r--r-- | lib/xsd/datatypes.rb | 71 | ||||
-rw-r--r-- | sample/wsdl/amazon/AmazonSearch.rb | 1176 | ||||
-rw-r--r-- | sample/wsdl/amazon/AmazonSearchDriver.rb | 68 | ||||
-rw-r--r-- | sample/wsdl/amazon/sampleClient.rb | 2 | ||||
-rw-r--r-- | sample/wsdl/amazon/wsdlDriver.rb | 6 |
8 files changed, 1200 insertions, 134 deletions
@@ -1,3 +1,10 @@ +Sat Oct 4 02:12:44 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org> + + * lib/xsd/datatypes.rb: dump sign by itself. under the problematic + platform, sprintf("%+.10g", -0.0) => +0. sigh. + + * sample/wsdl/amazon/*: update schema ver2 to ver3. + Sat Oct 4 01:33:46 2003 Tanaka Akira <akr@m17n.org> * lib/pathname.rb (initialize): duplicate and freeze argument. diff --git a/lib/soap/marshal.rb b/lib/soap/marshal.rb index 1dc4e13558..f45f80a0de 100644 --- a/lib/soap/marshal.rb +++ b/lib/soap/marshal.rb @@ -36,7 +36,7 @@ module Marshal Time, ::SOAP::SOAPDateTime, ::SOAP::Mapping::Registry::DateTimeFactory -) + ) class << self public diff --git a/lib/soap/streamHandler.rb b/lib/soap/streamHandler.rb index c0ca3955f7..a9068b368d 100644 --- a/lib/soap/streamHandler.rb +++ b/lib/soap/streamHandler.rb @@ -37,8 +37,6 @@ class StreamHandler end RUBY_VERSION_STRING = "ruby #{ RUBY_VERSION } (#{ RUBY_RELEASE_DATE }) [#{ RUBY_PLATFORM }]" - %q$Id$ =~ /: (\S+),v (\S+)/ - RCS_FILE, RCS_REVISION = $1, $2 class ConnectionData attr_accessor :send_string diff --git a/lib/xsd/datatypes.rb b/lib/xsd/datatypes.rb index bb4f53e59a..0be64fe635 100644 --- a/lib/xsd/datatypes.rb +++ b/lib/xsd/datatypes.rb @@ -135,10 +135,6 @@ class XSDAnySimpleType < NSDBase end end - def trim(data) - data.sub(/\A\s*(\S*)\s*\z/, '\1') - end - private def _set(value) @@ -204,7 +200,7 @@ private def _set(value) if value.is_a?(String) - str = trim(value) + str = value.strip if str == 'true' || str == '1' @data = true elsif str == 'false' || str == '0' @@ -245,7 +241,7 @@ private end def set_str(str) - /^([+\-]?)(\d*)(?:\.(\d*)?)?$/ =~ trim(str.to_s) + /^([+\-]?)(\d*)(?:\.(\d*)?)?$/ =~ str.to_s.strip unless Regexp.last_match raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.") end @@ -281,7 +277,14 @@ private end end +module FloatConstants + NaN = 0.0/0.0 + POSITIVE_INF = 1.0/0.0 + NEGATIVE_INF = -1.0/0.0 +end + class XSDFloat < XSDAnySimpleType + include FloatConstants Type = QName.new(Namespace, FloatLiteral) def initialize(value = nil) @@ -299,13 +302,13 @@ private return end - str = trim(value.to_s) + str = value.to_s.strip if str == 'NaN' - @data = 0.0/0.0 + @data = NaN elsif str == 'INF' - @data = 1.0/0.0 + @data = POSITIVE_INF elsif str == '-INF' - @data = -1.0/0.0 + @data = NEGATIVE_INF else if /^[+\-\.\deE]+$/ !~ str raise ValueSpaceError.new("#{ type }: cannot accept '#{ str }'.") @@ -320,7 +323,6 @@ private end end - # Do I have to convert 0.0 -> 0 and -0.0 -> -0 ? def _to_s if @data.nan? 'NaN' @@ -329,7 +331,8 @@ private elsif @data.infinite? == -1 '-INF' else - sprintf("%+.10g", @data) + sign = (1 / @data > 0.0) ? '+' : '-' + sign + sprintf("%.10g", @data.abs).sub(/[eE]([+-])?0+/) { 'e' + $1 } end end @@ -346,6 +349,7 @@ end # Ruby's Float is double-precision 64-bit floating point value. class XSDDouble < XSDAnySimpleType + include FloatConstants Type = QName.new(Namespace, DoubleLiteral) def initialize(value = nil) @@ -363,13 +367,13 @@ private return end - str = trim(value.to_s) + str = value.to_s.strip if str == 'NaN' - @data = 0.0/0.0 + @data = NaN elsif str == 'INF' - @data = 1.0/0.0 + @data = POSITIVE_INF elsif str == '-INF' - @data = -1.0/0.0 + @data = NEGATIVE_INF else begin @data = Float(str) @@ -388,7 +392,6 @@ private end end - # Do I have to convert 0.0 -> 0 and -0.0 -> -0 ? def _to_s if @data.nan? 'NaN' @@ -397,7 +400,8 @@ private elsif @data.infinite? == -1 '-INF' else - sprintf("%+.16g", @data) + sign = (1 / @data > 0.0) ? '+' : '-' + sign + sprintf("%.16g", @data.abs).sub(/[eE]([+-])?0+/) { 'e' + $1 } end end end @@ -429,7 +433,7 @@ class XSDDuration < XSDAnySimpleType private def _set(value) - /^([+\-]?)P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/ =~ trim(value.to_s) + /^([+\-]?)P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)D)?(T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/ =~ value.to_s.strip unless Regexp.last_match raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") end @@ -475,9 +479,6 @@ end require 'rational' require 'date' -unless Object.const_defined?('DateTime') - raise LoadError.new('XSD4R requires date2/3.2 or later to be installed. You can download it from http://www.funaba.org/en/ruby.html#date2') -end module XSDDateTimeImpl SecInDay = 86400 # 24 * 60 * 60 @@ -557,7 +558,7 @@ class XSDDateTime < XSDAnySimpleType private def set_str(t) - /^([+\-]?\d\d\d\d\d*)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d(?:\.(\d*))?)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ trim(t.to_s) + /^([+\-]?\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d(?:\.(\d*))?)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip unless Regexp.last_match raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") end @@ -620,7 +621,7 @@ class XSDTime < XSDAnySimpleType private def set_str(t) - /^(\d\d):(\d\d):(\d\d(?:\.(\d*))?)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ trim(t.to_s) + /^(\d\d):(\d\d):(\d\d(?:\.(\d*))?)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip unless Regexp.last_match raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") end @@ -663,7 +664,7 @@ class XSDDate < XSDAnySimpleType private def set_str(t) - /^([+\-]?\d\d\d\d\d*)-(\d\d)-(\d\d)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ trim(t.to_s) + /^([+\-]?\d{4,})-(\d\d)-(\d\d)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip unless Regexp.last_match raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") end @@ -699,7 +700,7 @@ class XSDGYearMonth < XSDAnySimpleType private def set_str(t) - /^([+\-]?\d\d\d\d\d*)-(\d\d)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ trim(t.to_s) + /^([+\-]?\d{4,})-(\d\d)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip unless Regexp.last_match raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") end @@ -734,7 +735,7 @@ class XSDGYear < XSDAnySimpleType private def set_str(t) - /^([+\-]?\d\d\d\d\d*)(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ trim(t.to_s) + /^([+\-]?\d{4,})(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip unless Regexp.last_match raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") end @@ -768,7 +769,7 @@ class XSDGMonthDay < XSDAnySimpleType private def set_str(t) - /^(\d\d)-(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ trim(t.to_s) + /^(\d\d)-(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip unless Regexp.last_match raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") end @@ -799,7 +800,7 @@ class XSDGDay < XSDAnySimpleType private def set_str(t) - /^(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ trim(t.to_s) + /^(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip unless Regexp.last_match raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") end @@ -829,7 +830,7 @@ class XSDGMonth < XSDAnySimpleType private def set_str(t) - /^(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ trim(t.to_s) + /^(\d\d)(Z|(?:[+\-]\d\d:\d\d)?)?$/ =~ t.to_s.strip unless Regexp.last_match raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.") end @@ -860,7 +861,7 @@ class XSDHexBinary < XSDAnySimpleType if /^[0-9a-fA-F]*$/ !~ value raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") end - @data = trim(String.new(value)) + @data = String.new(value).strip @is_nil = false end @@ -890,7 +891,7 @@ class XSDBase64Binary < XSDAnySimpleType if /^[A-Za-z0-9+\/=]*$/ !~ value raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") end - @data = trim(String.new(value)) + @data = String.new(value).strip @is_nil = false end @@ -901,7 +902,7 @@ class XSDBase64Binary < XSDAnySimpleType private def _set(value) - @data = trim([value].pack("m")) + @data = [value].pack("m").strip end end @@ -918,7 +919,7 @@ private def _set(value) begin - @data = URI.parse(trim(value.to_s)) + @data = URI.parse(value.to_s.strip) rescue URI::InvalidURIError raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") end @@ -937,7 +938,7 @@ class XSDQName < XSDAnySimpleType private def _set(value) - /^(?:([^:]+):)?([^:]+)$/ =~ trim(value.to_s) + /^(?:([^:]+):)?([^:]+)$/ =~ value.to_s.strip unless Regexp.last_match raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") end diff --git a/sample/wsdl/amazon/AmazonSearch.rb b/sample/wsdl/amazon/AmazonSearch.rb index 29397c2d56..1027592d85 100644 --- a/sample/wsdl/amazon/AmazonSearch.rb +++ b/sample/wsdl/amazon/AmazonSearch.rb @@ -229,6 +229,62 @@ class Details @imageUrlLarge = value end + def MerchantId + @merchantId + end + + def MerchantId=(value) + @merchantId = value + end + + def MinPrice + @minPrice + end + + def MinPrice=(value) + @minPrice = value + end + + def MaxPrice + @maxPrice + end + + def MaxPrice=(value) + @maxPrice = value + end + + def MinSalePrice + @minSalePrice + end + + def MinSalePrice=(value) + @minSalePrice = value + end + + def MaxSalePrice + @maxSalePrice + end + + def MaxSalePrice=(value) + @maxSalePrice = value + end + + def MultiMerchant + @multiMerchant + end + + def MultiMerchant=(value) + @multiMerchant = value + end + + def MerchantSku + @merchantSku + end + + def MerchantSku=(value) + @merchantSku = value + end + def ListPrice @listPrice end @@ -461,6 +517,14 @@ class Details @encoding = value end + def ProductDescription + @productDescription + end + + def ProductDescription=(value) + @productDescription = value + end + def Reviews @reviews end @@ -477,6 +541,14 @@ class Details @similarProducts = value end + def FeaturedProducts + @featuredProducts + end + + def FeaturedProducts=(value) + @featuredProducts = value + end + def Lists @lists end @@ -493,6 +565,14 @@ class Details @status = value end + def Variations + @variations + end + + def Variations=(value) + @variations = value + end + def initialize(url = nil, asin = nil, productName = nil, @@ -510,6 +590,13 @@ class Details imageUrlSmall = nil, imageUrlMedium = nil, imageUrlLarge = nil, + merchantId = nil, + minPrice = nil, + maxPrice = nil, + minSalePrice = nil, + maxSalePrice = nil, + multiMerchant = nil, + merchantSku = nil, listPrice = nil, ourPrice = nil, usedPrice = nil, @@ -539,10 +626,13 @@ class Details accessories = nil, platforms = nil, encoding = nil, + productDescription = nil, reviews = nil, similarProducts = nil, + featuredProducts = nil, lists = nil, - status = nil) + status = nil, + variations = nil) @url = url @asin = asin @productName = productName @@ -560,6 +650,13 @@ class Details @imageUrlSmall = imageUrlSmall @imageUrlMedium = imageUrlMedium @imageUrlLarge = imageUrlLarge + @merchantId = merchantId + @minPrice = minPrice + @maxPrice = maxPrice + @minSalePrice = minSalePrice + @maxSalePrice = maxSalePrice + @multiMerchant = multiMerchant + @merchantSku = merchantSku @listPrice = listPrice @ourPrice = ourPrice @usedPrice = usedPrice @@ -589,10 +686,13 @@ class Details @accessories = accessories @platforms = platforms @encoding = encoding + @productDescription = productDescription @reviews = reviews @similarProducts = similarProducts + @featuredProducts = featuredProducts @lists = lists @status = status + @variations = variations end end @@ -841,6 +941,41 @@ class SimilarProductsArray < Array end # http://soap.amazon.com +class FeaturedProductsArray < Array + # Contents type should be dumped here... + @@schema_type = "FeaturedProductsArray" + @@schema_ns = "http://soap.amazon.com" +end + +# http://soap.amazon.com +class FeaturedProduct + @@schema_type = "FeaturedProduct" + @@schema_ns = "http://soap.amazon.com" + + def Asin + @asin + end + + def Asin=(value) + @asin = value + end + + def Comment + @comment + end + + def Comment=(value) + @comment = value + end + + def initialize(asin = nil, + comment = nil) + @asin = asin + @comment = comment + end +end + +# http://soap.amazon.com class ListArray < Array # Contents type should be dumped here... @@schema_type = "ListArray" @@ -848,6 +983,101 @@ class ListArray < Array end # http://soap.amazon.com +class VariationArray < Array + # Contents type should be dumped here... + @@schema_type = "VariationArray" + @@schema_ns = "http://soap.amazon.com" +end + +# http://soap.amazon.com +class Variation + @@schema_type = "Variation" + @@schema_ns = "http://soap.amazon.com" + + def Asin + @asin + end + + def Asin=(value) + @asin = value + end + + def ClothingSize + @clothingSize + end + + def ClothingSize=(value) + @clothingSize = value + end + + def ClothingColor + @clothingColor + end + + def ClothingColor=(value) + @clothingColor = value + end + + def Price + @price + end + + def Price=(value) + @price = value + end + + def SalePrice + @salePrice + end + + def SalePrice=(value) + @salePrice = value + end + + def Availability + @availability + end + + def Availability=(value) + @availability = value + end + + def MultiMerchant + @multiMerchant + end + + def MultiMerchant=(value) + @multiMerchant = value + end + + def MerchantSku + @merchantSku + end + + def MerchantSku=(value) + @merchantSku = value + end + + def initialize(asin = nil, + clothingSize = nil, + clothingColor = nil, + price = nil, + salePrice = nil, + availability = nil, + multiMerchant = nil, + merchantSku = nil) + @asin = asin + @clothingSize = clothingSize + @clothingColor = clothingColor + @price = price + @salePrice = salePrice + @availability = availability + @multiMerchant = multiMerchant + @merchantSku = merchantSku + end +end + +# http://soap.amazon.com class MarketplaceSearch @@schema_type = "MarketplaceSearch" @@schema_ns = "http://soap.amazon.com" @@ -1150,6 +1380,14 @@ class ListingProductDetails @exchangeTitle = value end + def ExchangeDescription + @exchangeDescription + end + + def ExchangeDescription=(value) + @exchangeDescription = value + end + def ExchangePrice @exchangePrice end @@ -1297,6 +1535,7 @@ class ListingProductDetails def initialize(exchangeId = nil, listingId = nil, exchangeTitle = nil, + exchangeDescription = nil, exchangePrice = nil, exchangeAsin = nil, exchangeEndDate = nil, @@ -1318,6 +1557,7 @@ class ListingProductDetails @exchangeId = exchangeId @listingId = listingId @exchangeTitle = exchangeTitle + @exchangeDescription = exchangeDescription @exchangePrice = exchangePrice @exchangeAsin = exchangeAsin @exchangeEndDate = exchangeEndDate @@ -1626,12 +1866,102 @@ class KeywordRequest @sort = value end - def variations - @variations + def locale + @locale end - def variations=(value) - @variations = value + def locale=(value) + @locale = value + end + + def price + @price + end + + def price=(value) + @price = value + end + + def initialize(keyword = nil, + page = nil, + mode = nil, + tag = nil, + type = nil, + devtag = nil, + sort = nil, + locale = nil, + price = nil) + @keyword = keyword + @page = page + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + @price = price + end +end + +# http://soap.amazon.com +class TextStreamRequest + @@schema_type = "TextStreamRequest" + @@schema_ns = "http://soap.amazon.com" + + def textStream + @textStream + end + + def textStream=(value) + @textStream = value + end + + def page + @page + end + + def page=(value) + @page = value + end + + def mode + @mode + end + + def mode=(value) + @mode = value + end + + def tag + @tag + end + + def tag=(value) + @tag = value + end + + def type + @type + end + + def type=(value) + @type = value + end + + def devtag + @devtag + end + + def devtag=(value) + @devtag = value + end + + def sort + @sort + end + + def sort=(value) + @sort = value end def locale @@ -1642,24 +1972,32 @@ class KeywordRequest @locale = value end - def initialize(keyword = nil, + def price + @price + end + + def price=(value) + @price = value + end + + def initialize(textStream = nil, page = nil, mode = nil, tag = nil, type = nil, devtag = nil, sort = nil, - variations = nil, - locale = nil) - @keyword = keyword + locale = nil, + price = nil) + @textStream = textStream @page = page @mode = mode @tag = tag @type = type @devtag = devtag @sort = sort - @variations = variations @locale = locale + @price = price end end @@ -1724,14 +2062,6 @@ class PowerRequest @sort = value end - def variations - @variations - end - - def variations=(value) - @variations = value - end - def locale @locale end @@ -1747,7 +2077,6 @@ class PowerRequest type = nil, devtag = nil, sort = nil, - variations = nil, locale = nil) @power = power @page = page @@ -1756,7 +2085,6 @@ class PowerRequest @type = type @devtag = devtag @sort = sort - @variations = variations @locale = locale end end @@ -1830,6 +2158,22 @@ class BrowseNodeRequest @locale = value end + def keywords + @keywords + end + + def keywords=(value) + @keywords = value + end + + def price + @price + end + + def price=(value) + @price = value + end + def initialize(browse_node = nil, page = nil, mode = nil, @@ -1837,7 +2181,9 @@ class BrowseNodeRequest type = nil, devtag = nil, sort = nil, - locale = nil) + locale = nil, + keywords = nil, + price = nil) @browse_node = browse_node @page = page @mode = mode @@ -1846,6 +2192,8 @@ class BrowseNodeRequest @devtag = devtag @sort = sort @locale = locale + @keywords = keywords + @price = price end end @@ -1910,13 +2258,22 @@ class AsinRequest @locale = value end + def mode + @mode + end + + def mode=(value) + @mode = value + end + def initialize(asin = nil, tag = nil, type = nil, devtag = nil, offer = nil, offerpage = nil, - locale = nil) + locale = nil, + mode = nil) @asin = asin @tag = tag @type = type @@ -1924,6 +2281,7 @@ class AsinRequest @offer = offer @offerpage = offerpage @locale = locale + @mode = mode end end @@ -2038,12 +2396,98 @@ class UpcRequest @sort = value end - def variations - @variations + def locale + @locale end - def variations=(value) - @variations = value + def locale=(value) + @locale = value + end + + def initialize(upc = nil, + mode = nil, + tag = nil, + type = nil, + devtag = nil, + sort = nil, + locale = nil) + @upc = upc + @mode = mode + @tag = tag + @type = type + @devtag = devtag + @sort = sort + @locale = locale + end +end + +# http://soap.amazon.com +class SkuRequest + @@schema_type = "SkuRequest" + @@schema_ns = "http://soap.amazon.com" + + def sku + @sku + end + + def sku=(value) + @sku = value + end + + def mode + @mode + end + + def mode=(value) + @mode = value + end + + def tag + @tag + end + + def tag=(value) + @tag = value + end + + def type + @type + end + + def type=(value) + @type = value + end + + def devtag + @devtag + end + + def devtag=(value) + @devtag = value + end + + def merchant_id + @merchant_id + end + + def merchant_id=(value) + @merchant_id = value + end + + def keywords + @keywords + end + + def keywords=(value) + @keywords = value + end + + def sort + @sort + end + + def sort=(value) + @sort = value end def locale @@ -2054,21 +2498,23 @@ class UpcRequest @locale = value end - def initialize(upc = nil, + def initialize(sku = nil, mode = nil, tag = nil, type = nil, devtag = nil, + merchant_id = nil, + keywords = nil, sort = nil, - variations = nil, locale = nil) - @upc = upc + @sku = sku @mode = mode @tag = tag @type = type @devtag = devtag + @merchant_id = merchant_id + @keywords = keywords @sort = sort - @variations = variations @locale = locale end end @@ -2134,14 +2580,6 @@ class ArtistRequest @sort = value end - def variations - @variations - end - - def variations=(value) - @variations = value - end - def locale @locale end @@ -2150,6 +2588,22 @@ class ArtistRequest @locale = value end + def keywords + @keywords + end + + def keywords=(value) + @keywords = value + end + + def price + @price + end + + def price=(value) + @price = value + end + def initialize(artist = nil, page = nil, mode = nil, @@ -2157,8 +2611,9 @@ class ArtistRequest type = nil, devtag = nil, sort = nil, - variations = nil, - locale = nil) + locale = nil, + keywords = nil, + price = nil) @artist = artist @page = page @mode = mode @@ -2166,8 +2621,9 @@ class ArtistRequest @type = type @devtag = devtag @sort = sort - @variations = variations @locale = locale + @keywords = keywords + @price = price end end @@ -2232,14 +2688,6 @@ class AuthorRequest @sort = value end - def variations - @variations - end - - def variations=(value) - @variations = value - end - def locale @locale end @@ -2248,6 +2696,22 @@ class AuthorRequest @locale = value end + def keywords + @keywords + end + + def keywords=(value) + @keywords = value + end + + def price + @price + end + + def price=(value) + @price = value + end + def initialize(author = nil, page = nil, mode = nil, @@ -2255,8 +2719,9 @@ class AuthorRequest type = nil, devtag = nil, sort = nil, - variations = nil, - locale = nil) + locale = nil, + keywords = nil, + price = nil) @author = author @page = page @mode = mode @@ -2264,8 +2729,9 @@ class AuthorRequest @type = type @devtag = devtag @sort = sort - @variations = variations @locale = locale + @keywords = keywords + @price = price end end @@ -2330,14 +2796,6 @@ class ActorRequest @sort = value end - def variations - @variations - end - - def variations=(value) - @variations = value - end - def locale @locale end @@ -2346,6 +2804,22 @@ class ActorRequest @locale = value end + def keywords + @keywords + end + + def keywords=(value) + @keywords = value + end + + def price + @price + end + + def price=(value) + @price = value + end + def initialize(actor = nil, page = nil, mode = nil, @@ -2353,8 +2827,9 @@ class ActorRequest type = nil, devtag = nil, sort = nil, - variations = nil, - locale = nil) + locale = nil, + keywords = nil, + price = nil) @actor = actor @page = page @mode = mode @@ -2362,8 +2837,9 @@ class ActorRequest @type = type @devtag = devtag @sort = sort - @variations = variations @locale = locale + @keywords = keywords + @price = price end end @@ -2428,14 +2904,6 @@ class DirectorRequest @sort = value end - def variations - @variations - end - - def variations=(value) - @variations = value - end - def locale @locale end @@ -2444,6 +2912,22 @@ class DirectorRequest @locale = value end + def keywords + @keywords + end + + def keywords=(value) + @keywords = value + end + + def price + @price + end + + def price=(value) + @price = value + end + def initialize(director = nil, page = nil, mode = nil, @@ -2451,8 +2935,9 @@ class DirectorRequest type = nil, devtag = nil, sort = nil, - variations = nil, - locale = nil) + locale = nil, + keywords = nil, + price = nil) @director = director @page = page @mode = mode @@ -2460,8 +2945,9 @@ class DirectorRequest @type = type @devtag = devtag @sort = sort - @variations = variations @locale = locale + @keywords = keywords + @price = price end end @@ -2584,14 +3070,6 @@ class ManufacturerRequest @sort = value end - def variations - @variations - end - - def variations=(value) - @variations = value - end - def locale @locale end @@ -2600,6 +3078,22 @@ class ManufacturerRequest @locale = value end + def keywords + @keywords + end + + def keywords=(value) + @keywords = value + end + + def price + @price + end + + def price=(value) + @price = value + end + def initialize(manufacturer = nil, page = nil, mode = nil, @@ -2607,8 +3101,9 @@ class ManufacturerRequest type = nil, devtag = nil, sort = nil, - variations = nil, - locale = nil) + locale = nil, + keywords = nil, + price = nil) @manufacturer = manufacturer @page = page @mode = mode @@ -2616,8 +3111,9 @@ class ManufacturerRequest @type = type @devtag = devtag @sort = sort - @variations = variations @locale = locale + @keywords = keywords + @price = price end end @@ -2866,6 +3362,14 @@ class MarketplaceRequest @listing_id = value end + def desc + @desc + end + + def desc=(value) + @desc = value + end + def locale @locale end @@ -2895,6 +3399,7 @@ class MarketplaceRequest geo = nil, sort = nil, listing_id = nil, + desc = nil, locale = nil, index = nil) @marketplace_search = marketplace_search @@ -2910,6 +3415,7 @@ class MarketplaceRequest @geo = geo @sort = sort @listing_id = listing_id + @desc = desc @locale = locale @index = index end @@ -2960,6 +3466,14 @@ class SellerProfileRequest @page = value end + def desc + @desc + end + + def desc=(value) + @desc = value + end + def locale @locale end @@ -2973,12 +3487,14 @@ class SellerProfileRequest type = nil, devtag = nil, page = nil, + desc = nil, locale = nil) @seller_id = seller_id @tag = tag @type = type @devtag = devtag @page = page + @desc = desc @locale = locale end end @@ -3052,6 +3568,14 @@ class SellerRequest @keyword = value end + def desc + @desc + end + + def desc=(value) + @desc = value + end + def locale @locale end @@ -3076,6 +3600,7 @@ class SellerRequest page = nil, seller_browse_id = nil, keyword = nil, + desc = nil, locale = nil, index = nil) @seller_id = seller_id @@ -3086,6 +3611,7 @@ class SellerRequest @page = page @seller_browse_id = seller_browse_id @keyword = keyword + @desc = desc @locale = locale @index = index end @@ -3232,6 +3758,14 @@ class Item @ourPrice = value end + def MerchantSku + @merchantSku + end + + def MerchantSku=(value) + @merchantSku = value + end + def initialize(itemId = nil, productName = nil, catalog = nil, @@ -3239,7 +3773,8 @@ class Item exchangeId = nil, quantity = nil, listPrice = nil, - ourPrice = nil) + ourPrice = nil, + merchantSku = nil) @itemId = itemId @productName = productName @catalog = catalog @@ -3248,6 +3783,7 @@ class Item @quantity = quantity @listPrice = listPrice @ourPrice = ourPrice + @merchantSku = merchantSku end end @@ -3298,6 +3834,14 @@ class AddItem @@schema_type = "AddItem" @@schema_ns = "http://soap.amazon.com" + def ParentAsin + @parentAsin + end + + def ParentAsin=(value) + @parentAsin = value + end + def Asin @asin end @@ -3306,6 +3850,14 @@ class AddItem @asin = value end + def MerchantId + @merchantId + end + + def MerchantId=(value) + @merchantId = value + end + def ExchangeId @exchangeId end @@ -3322,10 +3874,14 @@ class AddItem @quantity = value end - def initialize(asin = nil, + def initialize(parentAsin = nil, + asin = nil, + merchantId = nil, exchangeId = nil, quantity = nil) + @parentAsin = parentAsin @asin = asin + @merchantId = merchantId @exchangeId = exchangeId @quantity = quantity end @@ -3368,14 +3924,24 @@ class ShoppingCart @items = value end + def SimilarProducts + @similarProducts + end + + def SimilarProducts=(value) + @similarProducts = value + end + def initialize(cartId = nil, hMAC = nil, purchaseUrl = nil, - items = nil) + items = nil, + similarProducts = nil) @cartId = cartId @hMAC = hMAC @purchaseUrl = purchaseUrl @items = items + @similarProducts = similarProducts end end @@ -3424,16 +3990,26 @@ class GetShoppingCartRequest @locale = value end + def sims + @sims + end + + def sims=(value) + @sims = value + end + def initialize(tag = nil, devtag = nil, cartId = nil, hMAC = nil, - locale = nil) + locale = nil, + sims = nil) @tag = tag @devtag = devtag @cartId = cartId @hMAC = hMAC @locale = locale + @sims = sims end end @@ -3548,18 +4124,28 @@ class AddShoppingCartItemsRequest @locale = value end + def sims + @sims + end + + def sims=(value) + @sims = value + end + def initialize(tag = nil, devtag = nil, cartId = nil, hMAC = nil, items = nil, - locale = nil) + locale = nil, + sims = nil) @tag = tag @devtag = devtag @cartId = cartId @hMAC = hMAC @items = items @locale = locale + @sims = sims end end @@ -3616,18 +4202,28 @@ class RemoveShoppingCartItemsRequest @locale = value end + def sims + @sims + end + + def sims=(value) + @sims = value + end + def initialize(tag = nil, devtag = nil, cartId = nil, hMAC = nil, items = nil, - locale = nil) + locale = nil, + sims = nil) @tag = tag @devtag = devtag @cartId = cartId @hMAC = hMAC @items = items @locale = locale + @sims = sims end end @@ -3684,18 +4280,414 @@ class ModifyShoppingCartItemsRequest @locale = value end + def sims + @sims + end + + def sims=(value) + @sims = value + end + def initialize(tag = nil, devtag = nil, cartId = nil, hMAC = nil, items = nil, - locale = nil) + locale = nil, + sims = nil) @tag = tag @devtag = devtag @cartId = cartId @hMAC = hMAC @items = items @locale = locale + @sims = sims + end +end + +# http://soap.amazon.com +class OrderIdArray < Array + # Contents type should be dumped here... + @@schema_type = "OrderIdArray" + @@schema_ns = "http://soap.amazon.com" +end + +# http://soap.amazon.com +class Price + @@schema_type = "Price" + @@schema_ns = "http://soap.amazon.com" + + def Amount + @amount + end + + def Amount=(value) + @amount = value + end + + def CurrencyCode + @currencyCode + end + + def CurrencyCode=(value) + @currencyCode = value + end + + def initialize(amount = nil, + currencyCode = nil) + @amount = amount + @currencyCode = currencyCode + end +end + +# http://soap.amazon.com +class Package + @@schema_type = "Package" + @@schema_ns = "http://soap.amazon.com" + + def TrackingNumber + @trackingNumber + end + + def TrackingNumber=(value) + @trackingNumber = value + end + + def CarrierName + @carrierName + end + + def CarrierName=(value) + @carrierName = value + end + + def initialize(trackingNumber = nil, + carrierName = nil) + @trackingNumber = trackingNumber + @carrierName = carrierName + end +end + +# http://soap.amazon.com +class PackageArray < Array + # Contents type should be dumped here... + @@schema_type = "PackageArray" + @@schema_ns = "http://soap.amazon.com" +end + +# http://soap.amazon.com +class OrderItem + @@schema_type = "OrderItem" + @@schema_ns = "http://soap.amazon.com" + + def ItemNumber + @itemNumber + end + + def ItemNumber=(value) + @itemNumber = value + end + + def ASIN + @aSIN + end + + def ASIN=(value) + @aSIN = value + end + + def ExchangeId + @exchangeId + end + + def ExchangeId=(value) + @exchangeId = value + end + + def Quantity + @quantity + end + + def Quantity=(value) + @quantity = value + end + + def UnitPrice + @unitPrice + end + + def UnitPrice=(value) + @unitPrice = value + end + + def TotalPrice + @totalPrice + end + + def TotalPrice=(value) + @totalPrice = value + end + + def initialize(itemNumber = nil, + aSIN = nil, + exchangeId = nil, + quantity = nil, + unitPrice = nil, + totalPrice = nil) + @itemNumber = itemNumber + @aSIN = aSIN + @exchangeId = exchangeId + @quantity = quantity + @unitPrice = unitPrice + @totalPrice = totalPrice + end +end + +# http://soap.amazon.com +class OrderItemArray < Array + # Contents type should be dumped here... + @@schema_type = "OrderItemArray" + @@schema_ns = "http://soap.amazon.com" +end + +# http://soap.amazon.com +class ShortSummary + @@schema_type = "ShortSummary" + @@schema_ns = "http://soap.amazon.com" + + def OrderId + @orderId + end + + def OrderId=(value) + @orderId = value + end + + def SellerId + @sellerId + end + + def SellerId=(value) + @sellerId = value + end + + def Condition + @condition + end + + def Condition=(value) + @condition = value + end + + def TransactionDate + @transactionDate + end + + def TransactionDate=(value) + @transactionDate = value + end + + def TransactionDateEpoch + @transactionDateEpoch + end + + def TransactionDateEpoch=(value) + @transactionDateEpoch = value + end + + def Total + @total + end + + def Total=(value) + @total = value + end + + def Subtotal + @subtotal + end + + def Subtotal=(value) + @subtotal = value + end + + def Shipping + @shipping + end + + def Shipping=(value) + @shipping = value + end + + def Tax + @tax + end + + def Tax=(value) + @tax = value + end + + def Promotion + @promotion + end + + def Promotion=(value) + @promotion = value + end + + def StoreName + @storeName + end + + def StoreName=(value) + @storeName = value + end + + def Packages + @packages + end + + def Packages=(value) + @packages = value + end + + def OrderItems + @orderItems + end + + def OrderItems=(value) + @orderItems = value + end + + def ErrorCode + @errorCode + end + + def ErrorCode=(value) + @errorCode = value + end + + def ErrorString + @errorString + end + + def ErrorString=(value) + @errorString = value + end + + def initialize(orderId = nil, + sellerId = nil, + condition = nil, + transactionDate = nil, + transactionDateEpoch = nil, + total = nil, + subtotal = nil, + shipping = nil, + tax = nil, + promotion = nil, + storeName = nil, + packages = nil, + orderItems = nil, + errorCode = nil, + errorString = nil) + @orderId = orderId + @sellerId = sellerId + @condition = condition + @transactionDate = transactionDate + @transactionDateEpoch = transactionDateEpoch + @total = total + @subtotal = subtotal + @shipping = shipping + @tax = tax + @promotion = promotion + @storeName = storeName + @packages = packages + @orderItems = orderItems + @errorCode = errorCode + @errorString = errorString + end +end + +# http://soap.amazon.com +class ShortSummaryArray < Array + # Contents type should be dumped here... + @@schema_type = "ShortSummaryArray" + @@schema_ns = "http://soap.amazon.com" +end + +# http://soap.amazon.com +class GetTransactionDetailsRequest + @@schema_type = "GetTransactionDetailsRequest" + @@schema_ns = "http://soap.amazon.com" + + def tag + @tag + end + + def tag=(value) + @tag = value + end + + def devtag + @devtag + end + + def devtag=(value) + @devtag = value + end + + def key + @key + end + + def key=(value) + @key = value + end + + def OrderIds + @orderIds + end + + def OrderIds=(value) + @orderIds = value + end + + def locale + @locale + end + + def locale=(value) + @locale = value + end + + def initialize(tag = nil, + devtag = nil, + key = nil, + orderIds = nil, + locale = nil) + @tag = tag + @devtag = devtag + @key = key + @orderIds = orderIds + @locale = locale + end +end + +# http://soap.amazon.com +class GetTransactionDetailsResponse + @@schema_type = "GetTransactionDetailsResponse" + @@schema_ns = "http://soap.amazon.com" + + def ShortSummaries + @shortSummaries + end + + def ShortSummaries=(value) + @shortSummaries = value + end + + def initialize(shortSummaries = nil) + @shortSummaries = shortSummaries end end diff --git a/sample/wsdl/amazon/AmazonSearchDriver.rb b/sample/wsdl/amazon/AmazonSearchDriver.rb index bf532b75a5..01915e2735 100644 --- a/sample/wsdl/amazon/AmazonSearchDriver.rb +++ b/sample/wsdl/amazon/AmazonSearchDriver.rb @@ -24,6 +24,12 @@ class AmazonSearchPort < SOAP::RPC::Driver { :type => XSD::QName.new("http://soap.amazon.com", "Details") } ) MappingRegistry.set( + TextStreamRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "TextStreamRequest") } + ) + MappingRegistry.set( PowerRequest, ::SOAP::SOAPStruct, ::SOAP::Mapping::Registry::TypedStructFactory, @@ -60,6 +66,12 @@ class AmazonSearchPort < SOAP::RPC::Driver { :type => XSD::QName.new("http://soap.amazon.com", "UpcRequest") } ) MappingRegistry.set( + SkuRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "SkuRequest") } + ) + MappingRegistry.set( AuthorRequest, ::SOAP::SOAPStruct, ::SOAP::Mapping::Registry::TypedStructFactory, @@ -192,6 +204,12 @@ class AmazonSearchPort < SOAP::RPC::Driver { :type => XSD::QName.new("http://soap.amazon.com", "Item") } ) MappingRegistry.set( + SimilarProductsArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") } + ) + MappingRegistry.set( ClearShoppingCartRequest, ::SOAP::SOAPStruct, ::SOAP::Mapping::Registry::TypedStructFactory, @@ -234,6 +252,30 @@ class AmazonSearchPort < SOAP::RPC::Driver { :type => XSD::QName.new("http://soap.amazon.com", "ItemQuantity") } ) MappingRegistry.set( + GetTransactionDetailsRequest, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "GetTransactionDetailsRequest") } + ) + MappingRegistry.set( + OrderIdArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://www.w3.org/2001/XMLSchema", "string") } + ) + MappingRegistry.set( + GetTransactionDetailsResponse, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "GetTransactionDetailsResponse") } + ) + MappingRegistry.set( + ShortSummaryArray, + ::SOAP::SOAPArray, + ::SOAP::Mapping::Registry::TypedArrayFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ShortSummary") } + ) + MappingRegistry.set( Details, ::SOAP::SOAPStruct, ::SOAP::Mapping::Registry::TypedStructFactory, @@ -281,6 +323,12 @@ class AmazonSearchPort < SOAP::RPC::Driver ::SOAP::Mapping::Registry::TypedStructFactory, { :type => XSD::QName.new("http://soap.amazon.com", "ItemQuantity") } ) + MappingRegistry.set( + ShortSummary, + ::SOAP::SOAPStruct, + ::SOAP::Mapping::Registry::TypedStructFactory, + { :type => XSD::QName.new("http://soap.amazon.com", "ShortSummary") } + ) Methods = [ ["KeywordSearchRequest", "keywordSearchRequest", [ @@ -289,6 +337,12 @@ class AmazonSearchPort < SOAP::RPC::Driver ["retval", "return", [::SOAP::SOAPStruct, "http://soap.amazon.com", "ProductInfo"]]], "http://soap.amazon.com", "http://soap.amazon.com"], + ["TextStreamSearchRequest", "textStreamSearchRequest", [ + ["in", "TextStreamSearchRequest", + [::SOAP::SOAPStruct, "http://soap.amazon.com", "TextStreamRequest"]], + ["retval", "return", + [::SOAP::SOAPStruct, "http://soap.amazon.com", "ProductInfo"]]], + "http://soap.amazon.com", "http://soap.amazon.com"], ["PowerSearchRequest", "powerSearchRequest", [ ["in", "PowerSearchRequest", [::SOAP::SOAPStruct, "http://soap.amazon.com", "PowerRequest"]], @@ -319,6 +373,12 @@ class AmazonSearchPort < SOAP::RPC::Driver ["retval", "return", [::SOAP::SOAPStruct, "http://soap.amazon.com", "ProductInfo"]]], "http://soap.amazon.com", "http://soap.amazon.com"], + ["SkuSearchRequest", "skuSearchRequest", [ + ["in", "SkuSearchRequest", + [::SOAP::SOAPStruct, "http://soap.amazon.com", "SkuRequest"]], + ["retval", "return", + [::SOAP::SOAPStruct, "http://soap.amazon.com", "ProductInfo"]]], + "http://soap.amazon.com", "http://soap.amazon.com"], ["AuthorSearchRequest", "authorSearchRequest", [ ["in", "AuthorSearchRequest", [::SOAP::SOAPStruct, "http://soap.amazon.com", "AuthorRequest"]], @@ -420,10 +480,16 @@ class AmazonSearchPort < SOAP::RPC::Driver [::SOAP::SOAPStruct, "http://soap.amazon.com", "ModifyShoppingCartItemsRequest"]], ["retval", "ShoppingCart", [::SOAP::SOAPStruct, "http://soap.amazon.com", "ShoppingCart"]]], + "http://soap.amazon.com", "http://soap.amazon.com"], + ["GetTransactionDetailsRequest", "getTransactionDetailsRequest", [ + ["in", "GetTransactionDetailsRequest", + [::SOAP::SOAPStruct, "http://soap.amazon.com", "GetTransactionDetailsRequest"]], + ["retval", "GetTransactionDetailsResponse", + [::SOAP::SOAPStruct, "http://soap.amazon.com", "GetTransactionDetailsResponse"]]], "http://soap.amazon.com", "http://soap.amazon.com"] ] - DefaultEndpointUrl = "http://soap.amazon.com/onca/soap2" + DefaultEndpointUrl = "http://soap.amazon.com/onca/soap3" def initialize(endpoint_url = nil) endpoint_url ||= DefaultEndpointUrl diff --git a/sample/wsdl/amazon/sampleClient.rb b/sample/wsdl/amazon/sampleClient.rb index 71bafd7345..3caad84e04 100644 --- a/sample/wsdl/amazon/sampleClient.rb +++ b/sample/wsdl/amazon/sampleClient.rb @@ -4,7 +4,7 @@ # generated by WSDL file and wsdl2ruby.rb. # # $ wsdl2ruby.rb --type client --force \ -# --wsdl http://soap.amazon.com/schemas2/AmazonWebServices.wsdl +# --wsdl http://soap.amazon.com/schemas3/AmazonWebServices.wsdl # # See wsdlDriver.rb to use WSDL file directly (slow). require 'AmazonSearchDriver.rb' diff --git a/sample/wsdl/amazon/wsdlDriver.rb b/sample/wsdl/amazon/wsdlDriver.rb index 3abf40bb39..00ef6135a4 100644 --- a/sample/wsdl/amazon/wsdlDriver.rb +++ b/sample/wsdl/amazon/wsdlDriver.rb @@ -3,7 +3,8 @@ require 'soap/wsdlDriver' book = ARGV.shift || "Ruby" # AmazonSearch.rb is generated from WSDL. -# Run "wsdl2ruby.rb --wsdl http://soap.amazon.com/schemas2/AmazonWebServices.wsdl --classDef --force" +# Run "wsdl2ruby.rb --wsdl http://soap.amazon.com/schemas3/AmazonWebServices.wsdl --classdef --force" +# http://soap.amazon.com/schemas3/AmazonWebServices.wsdl require 'AmazonSearch.rb' =begin @@ -32,7 +33,8 @@ end #devtag = File.open(File.expand_path("~/.amazon_key")).read.chomp devtag = nil -AMAZON_WSDL = 'http://soap.amazon.com/schemas2/AmazonWebServices.wsdl' +# v2: AMAZON_WSDL = 'http://soap.amazon.com/schemas2/AmazonWebServices.wsdl' +AMAZON_WSDL = 'http://soap.amazon.com/schemas3/AmazonWebServices.wsdl' amazon = SOAP::WSDLDriverFactory.new(AMAZON_WSDL).create_driver p "WSDL loaded" amazon.generate_explicit_type = true |