WEB开发网
开发学院软件开发Python Python Web 服务开发者: 现实世界,第二部分 阅读

Python Web 服务开发者: 现实世界,第二部分

 2007-03-29 12:13:08 来源:WEB开发网   
核心提示: 清单 4. 展示快速修复 SOAPpy 0.10.4 中的 WSDL.py 的不同之处60,61c60< stream = urllib.urlopen(wsdlsource)< self.wsdl = reader.loadFromStream(stream)--->

清单 4. 展示快速修复 SOAPpy 0.10.4 中的 WSDL.py 的不同之处     
60,61c60
<         stream = urllib.urlopen(wsdlsource)
<         self.wsdl = reader.loadFromStream(stream)
---
>         self.wsdl = reader.loadFromURL(wsdlsource) 
      

瞧,行了!我们的小测试应用程序正常工作了(请参见 清单 5)。当然了,不修改 SOAPpy,我们也能使用浏览器从 Amazon.com 中检索到 WSDL 文件(请参阅 参考资料),然后从本地文件中进行加载——这对 SOAPpy 的 0.10.4 版本同样是有效的。

清单 5. amazon_soap_test.py 的输出结果。     
[scott@baal amazon_api]$ python amazon_soap_test.py
26 methods in WSDL:
BlendedSearchRequest
WishlistSearchRequest
ClearShoppingCartRequest
MarketplaceSearchRequest
BrowseNodeSearchRequest
SimilaritySearchRequest
SkuSearchRequest
SellerSearchRequest
SellerProfileSearchRequest
ActorSearchRequest
AsinSearchRequest
ListManiaSearchRequest
AuthorSearchRequest
GetShoppingCartRequest
PowerSearchRequest
ExchangeSearchRequest
DirectorSearchRequest
TextStreamSearchRequest
ModifyShoppingCartItemsRequest
KeywordSearchRequest
ArtistSearchRequest
UpcSearchRequest
GetTransactionDetailsRequest
AddShoppingCartItemsRequest
RemoveShoppingCartItemsRequest
ManufacturerSearchRequest
Amazon.com search for " spotted owl "
total pages of results (max 10 per page): 6
total results: 52
displaying first result (of 52):
Asin: 0060248912
ImageUrlSmall: /tech/UploadPic/2010922/2010922121311781.jpg
ProductName: There's an Owl in the Shower
ListPrice: $14.95
Availability: THIS TITLE IS CURRENTLY NOT AVAILABLE.
If you would like to purchase this title, we recommend
that you occasionally check this page to see if it has become available.
ReleaseDate: September, 1995
Catalog: Book
<SOAPpy.Types.typedArrayType at 1084200524>
Manufacturer: Harpercollins Juvenile Books
Url: http://www.amazon.com/exec/obidos/ASIN/0060248912/?dev-t=
D1V63VYIH286CL%26camp=2025%26link_code=sp1
UsedPrice: $1.25
ImageUrlMedium: /tech/UploadPic/2010922/2010922121312135.jpg
ImageUrlLarge: /tech/UploadPic/2010922/2010922121313202.jpg
OurPrice: $14.95
      

上一页  1 2 3 4 5 6 7 8  下一页

Tags:Python Web 服务

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接