
988ccee98b22d3dea9af1054a48bc846.ppt
- Количество слайдов: 22
Professional Development with Web APIs Presented To: Indy. NET Developer’s Association By: Denise Gosnell denise@denisegosnell. com July 14, 2005 © 2005 Denise M. Gosnell. All Rights Reserved.
Based On Topics In My New Book: Professional Development with Web APIs n Google, e. Bay, Pay. Pal, Amazon. com, Map. Point, UPS, Fed. Ex (April 2005) This Presentation Is Available For Download from www. denisegosnell. com/news. html The Source Code for the book is available for download from www. wrox. com. © 2005 Denise M. Gosnell. All Rights Reserved.
Outline of Topics What Is A Web API? Google API Map. Point API Amazon. Com APIs e. Bay API Pay. Pal API Other APIs Calling From Mobile Devices and Office Creating Your Own API © 2005 Denise M. Gosnell. All Rights Reserved.
What Is a Web API? (Chapter 1) Series or collection of web services Sometimes used interchangeably with “web services” Examples: Google API, Amazon. Com APIs © 2005 Denise M. Gosnell. All Rights Reserved.
How Do You Call a Web API? XML web services can be invoked in one of three ways: n n Using REST (HTTP-GET) URL includes parameters Example: http: //webservices. amazon. com/onca/xml? Service=AWSECo mmerce. Service&Subscription. Id=YOURIDGOESHERE&Oper ation=Item. Search&Search. Index=Books&Keywords=Denise% 20 Gosnell n Using HTTP-POST You post an XML document returned n Using SOAP More complex, allows structured and type information © 2005 Denise M. Gosnell. All Rights Reserved.
The Google API (Chapter 2) Available Using SOAP with HTTP Limited to 1000 Calls Per Day Obtain a Developer Key and Developer’s Kit From: n www. google. com/apis/ Query Syntax: n do. Google. Search (Key, Search. String, Start, Max. Results, Filter, Restrict, Safe. Search, lr, ie, oe) Returns only 10 results at a time – have to change the start index to specify which ones to retrieve n n do. Get. Cached. Page (Key, URL) do. Spelling. Suggestion (Key, Phrase) © 2005 Denise M. Gosnell. All Rights Reserved.
The Map. Point API (Chapter 3) Can Be Called Using SOAP with HTTP Examples of Supported Features: n n n Addresses Reverse Geocoding Finding Nearby Places Custom Locations Map Rendering Points of Interest Evaluation Account / Developer Account: http: //www. microsoft. com/mappoint/webservice/d efault. mspx © 2005 Denise M. Gosnell. All Rights Reserved.
The Amazon. Com APIs (Chapter 4) There Are Currently 3 Amazon. Com APIs n n n Amazon E-Commerce Service (ECS) Alexa Web Information Service (AWIS) – programmatic access to www. alexa. com web crawl data Simple Queue Service All 3 Can Be Called Using SOAP or HTTP-GET(REST) Info About These 3 Can Be Found At: http: //www. amazon. com/gp/browse. html/102 -31935827147314? %5 Fencoding=UTF 8&node=3435361 Sign Up For Subscription ID at: http: //www. amazon. com/gp/aws/registrationform. html Mention www. a 9. com which uses one or more of Amazon. com APIs above © 2005 Denise M. Gosnell. All Rights Reserved.
Amazon. Com Demo Create a New VB. NET Win. Forms Project Add a reference to the Amazon. com API (Project | Add Web Reference): http: //webservices. amazon. com/AWSECommerce. Service/AWSECommerce Service. wsdl Then, add the following code to your VB. NET Win. Forms project: Private Sub Form 1_Load(By. Val sender As System. Object, By. Val e As System. Event. Args) Handles My. Base. Load System. Object, System. Event. Args) Dim Amazon. Product. Data As New _ Test. Amazon. Web. Service. Amazon. AWSECommerce. Service Dim Amazon. Search As New Test. Amazon. Web. Service. Amazon. Item. Search Dim Amazon. Response As New _ Test. Amazon. Web. Service. Amazon. Item. Search. Response Dim Amazon. Request(1) As _ Test. Amazon. Web. Service. Amazon. Item. Search. Request 'Developer/Subscription Code Amazon. Search. Subscription. Id = "YOUR ID GOES HERE" 'We are only making one request, not batching multiple requests 'Thus element 0 of the array is all we need to assign and work with Amazon. Request(0) = New _ Test. Amazon. Web. Service. amazon. Item. Search. Request Amazon. Request(0). Search. Index = "Books" Amazon. Request(0). Keywords = “Denise Gosnell" © 2005 Denise M. Gosnell. All Rights Reserved.
Amazon. Com Demo (continued) 'assign the search object to the request object with the assigned parameters Amazon. Search. Request = Amazon. Request 'run the search and populate the response Amazon. Response = Amazon. Product. Data. Item. Search(Amazon. Search) Dim item As New Test. Amazon. Web. Service. Amazon. Item Dim str. Output As String str. Output = "Search results for keyword(s): " & Amazon. Request(0). Keywords & " in " & Amazon. Request(0). Search. Index & ": " & vb. Cr. Lf 'loop through the results For Each item In Amazon. Response. Items(0). Item str. Output = str. Output & item. Item. Attributes. Title & vb. Cr. Lf Next 'display the results in a message box Msg. Box(str. Output) End Sub © 2005 Denise M. Gosnell. All Rights Reserved.
The e. Bay API (Chapter 5) e. Bay API can be called using HTTP-POST or SOAP Sandbox (Test) and Live Environments Supports most popular features: n n n Retrieve Auction Listings Retrieve Customer Reviews Retrieve Status of Auction Add New Auction Listing Retrieve Winning Details Join Developer Program and Obtain Account: http: //developer. ebay. com © 2005 Denise M. Gosnell. All Rights Reserved.
The Pay. Pal API (Chapter 6) Pay. Pal API can be called using SOAP Sandbox (Test) and Live Environments Supports several features: n n Get. Transaction. Details Transaction. Search Refund. Transaction Mass. Pay Join Developer Program and Obtain Account: http: //developer. paypal. com © 2005 Denise M. Gosnell. All Rights Reserved.
Demo – Combining APIs (from Chapter 11 Case Study) Uses Google To Retrieve Top 5 web Sites That Mention Your Customer Uses Map. Point To Retrieve Map And/Or Driving Directions To Customer Location © 2005 Denise M. Gosnell. All Rights Reserved.
© 2005 Denise M. Gosnell. All Rights Reserved.
© 2005 Denise M. Gosnell. All Rights Reserved.
© 2005 Denise M. Gosnell. All Rights Reserved.
Other APIs (Chapter 7) Inter. Fax API n http: //www. interfax. net/en/dev/index. html UPS API n http: //www. ec. ups. com/ecommerce/gettools/prodcom panies. html Fed. Ex API n http: //www. fedex. com/us/solutions/wis/index. html (some require DLLs) Bloglines API n http: //www. bloglines. com/services/ © 2005 Denise M. Gosnell. All Rights Reserved.
Finding More Web APIs UDDI Directory n http: //uddi. microsoft. com Binding. Point Web Site n http: //www. bindingpoint. com Various Other Locations On Internet © 2005 Denise M. Gosnell. All Rights Reserved.
Calling From Mobile Devices (Chapter 8) Use. NET Compact Framework In Visual Studio. NET To Target Pocket PCs and Smart. Phones n n Just Select Project Type In VS. Net http: //www. microsoft. com/windowsmobile e. Mbedded Visual Tools n Use To Create Separate From VS. Net Web Services For Palm n http: //pluggedin. palmone. com/regac/pluggedin/Web. S ervices. jsp © 2005 Denise M. Gosnell. All Rights Reserved.
Calling From Microsoft Office (Chapter 9) There At Least 3 Ways To Call Web API From Microsoft Office Programs: VBA n Example in Excel using VBA and HTTP/GET (REST) VBA using SOAP n requires Web Services Toolkit (available for free download from Microsoft) Using. NET n requires Visual Studio Tools for Microsoft Office System – must purchase © 2005 Denise M. Gosnell. All Rights Reserved.
Creating Your Own APIs (Chapter 10) Create New ASP. NET Web Service Project from VS. NET n n n Add Code Test The Web Service Using Built-In Testing Utility In Web Browser Call Web Service From Another Program Using Protocols You Enabled For Service Can Also Convert Existing. NET App To Web Service By Wrapping With Web. Method Attribute © 2005 Denise M. Gosnell. All Rights Reserved.
Questions? © 2005 Denise M. Gosnell. All Rights Reserved.
988ccee98b22d3dea9af1054a48bc846.ppt