Lab #2: Web API Programming Exercises By J. H. Wang Dec. 19, 2011.

Slides:



Advertisements
Similar presentations
Oct, 26 th, 2010 OGF 30, NSI-WG: Network Service Interface working group Web Services Overview Web Services for NSI protocol implementation
Advertisements

Overview of Web Services
Composing Your Learning Environment Warwick Bailey, Director Icodeon Ltd Cambridge, UK.
CIS 375—Web App Dev II SOAP.
XML in the real world (2) SOAP. What is SOAP? ► SOAP stands for Simple Object Access Protocol ► SOAP is a communication protocol ► SOAP is for communication.
SOAP SOAP is a protocol for accessing a Web Service. SOAP stands for Simple Object Access Protocol * SOAP is a communication protocol * SOAP is for communication.
Information Management NTU Web Services. Information Management NTU What Are Web Services? Semantically encapsulate discrete functionality Loosely coupled,
SE 370: Programming Web Services Week 4: SOAP & NetBeans Copyright © Steven W. Johnson February 1, 2013.
Table of Contents This document describes about XML application to control, customize, initiate action of phone. Overview of XML Application Each Function.
COEN 445 Communication Networks and Protocols Lab 4
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
An authorization control framework to enable service composition Takashi Suzuki, Randy H. Katz EECS Department University of California, Berkeley {tsuzuki,
XML Technologies and Applications Rajshekhar Sunderraman Department of Computer Science Georgia State University Atlanta, GA 30302
Slide 1 EE557: Server-Side Development Lecturer: David Molloy Room: XG19 Mondays 10am-1pm Notes:
ΗΛΕΚΤΡΟΝΙΚΟ ΕΜΠΟΡΙΟ Web Services Overview Mary Grammatikou 9/06/2009.
1 Web Search Interfaces. 2 Web Search Interface Web search engines of course need a web-based interface. Search page must accept a query string and submit.
Implementation of One Stop Search by XSLT By Dave Low University of Hong Kong 9-Dec-2003.
More APIs: Web Services CMPT 281. Announcements Project milestone Lab: – Web services examples.
Web service testing Group D5. What are Web Services? XML is the basis for Web services Web services are application components Web services communicate.
TP2653 Adv Web Programming SOAP and WSDL. SOAP Simple Object Access Protocol – Lightweight XML-based messaging protocol – A protocol for accessing a Web.
JSON (JavaScript Object Notation).  A lightweight data-interchange format  A subset of the object literal notation of JavaScript (or ECMA-262).  A.
1 HTML and CGI Scripting CSC8304 – Computing Environments for Bioinformatics - Lecture 10.
Grid Computing, B. Wilkinson, 20043b.1 Web Services Part II.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Application Protocols: HTTP CSNB534 Semester 2, 2007/2008 Asma Shakil.
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
Cambridge, March 23 rd 2004 MobileMAN Project MobileMAN Project Web Service in Ad Hoc Network Veronica Vanni NETikos S.p.A.
Is Apache CouchDB for you?
Outline  Enterprise System Integration: Key for Business Success  Key Challenges to Enterprise System Integration  Service-Oriented Architecture (SOA)
NBN:URN Generator and Resolver ERPANET Workshop on Persistent Identifiers Cork, June, Ádám Horváth National Széchényi Library Hungary.
Web Services An introduction for eWiSACWIS May 2008.
James Holladay, Mario Sweeney, Vu Tran. Web Services Presentation Web Services Theory James Holladay Tools – Visual Studio Vu Tran Tools – Net Beans Mario.
Tunis International Centre for Environmental Technologies Small Seminar on Networking Technology Information Centers UNFCCC secretariat offices Bonn, Germany.
CSC8530 Distributed Systems XML Web Services David Vaglia.
Python and REST Kevin Hibma. What is REST? Why REST? REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a.
Google’s Web Service January 4, 2004 Shuying Wang.
Course Overview for Web Computing J. H. Wang Sep. 19, 2011.
Dynamic Content On Edge Cache Server (using Microsoft.NET) Name: Aparna Yeddula CS – 522 Semester Project Project URL: cs.uccs.edu/~ayeddula/project.html.
UWG 2013 Meeting PO.DAAC Web Services Demo. What are PO.DAAC Web Services?
Introduction to Web APIs and Protocols By J. H. Wang Dec. 12, 2011.
1 My Yahoo! Personalising the Web Nick Cox – Product Manager May 2007.
Helsinki, June 7 th 2004 IAB Meeting MobileMAN Project Web Service in Ad Hoc Network Veronica Vanni NETikos S.p.A.
Enterprise Computing: Web Services
Form Data Encoding GET – URL encoded POST – URL encoded
Facebook API Kelly Orser. Client Libraries Client libraries will simplify the calls to the platform by reducing the amount of code you have to write.
1 Alternative view on Internet Computing Web 1.0 –Web 1.0 is first generation, Web Information based. Driven by Information provider. Web 2.0 Ajax enabled.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Introduction to Web Services
Web Services Martin Nečaský, Ph.D. Faculty of Mathematics and Physics Charles University in Prague, Czech Republic Summer 2014.
RESTful Web Services A MIDAS MISSION PRESENTATION APRIL 29, 2015.
Intro to Web Services Dr. John P. Abraham UTPA. What are Web Services? Applications execute across multiple computers on a network.  The machine on which.
Netprog: Soap & XML-RPC1 XML-RPC and SOAP. Netprog: Soap & XML-RPC2 XML Extensible Markup Language Markup Language. –HTML is also a markup language (but.
Introduction to Web Services Presented by Sarath Chandra Dorbala.
Lab #3: Programming Exercises for Social Web APIs By J. H. Wang Dec. 26, 2011.
Lecture VI: SOAP-based Web Service CS 4593 Cloud-Oriented Big Data and Software Engineering.
Server-side http General form of http response/request GET request method POST request method Responses Servlet support.
SOAP, Web Service, WSDL Week 14 Web site:
Web Services Essentials. What is a web service? web service: software functionality that can be invoked through the internet using common protocols like.
TSDS (HPDE DAP). Objectives (1) develop a standard API for time series-like data, (2) develop a software package, TSDS (Time Series Data Server), that.
Software Architecture Patterns (3) Service Oriented & Web Oriented Architecture source: microsoft.
Web Services Dr.Kwanchai Eurviriyanukul The contents of this slide set are obtained from various sources including W3School, WIKIPEDIA.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
WEB SERVICES.
Unit – 5 JAVA Web Services
Application HTTP.
Uniform Resource Locators
Lecture 14: JSON and Web SERVICES
Programmatic interaction with the Invenio-based NADRE Repository
Programmatic interaction with the Invenio-based NADRE Repository
Presentation transcript:

Lab #2: Web API Programming Exercises By J. H. Wang Dec. 19, 2011

Outline Yahoo! Term Extraction API Bing Search API Others

Platform and compiler (The same as networking programming in any language on any platform.)

Web API programming exercises 1.Network programming Sending a request packet Parsing the response from Web server 2.To start programming with Web API – Document: e.g. – Register an API key – Start using the API 3.Protocol and message format – Prepare parameters in request – Parsing responses

Network Programming Sending an HTTP packet Parsing the HTTP responses

Yahoo Term Extraction API Document: – Register an API key – Start using the API – Request method: HTTP POST – Response format: JSON, XML

Yahoo! 搜尋『斷章取義』 API Method] – API Method: ws: (word segmentation) ke: (keyword extraction) – appid= – content= (encoded in UTF-8) – format=json (or xml)

HTTP POST E.g.: &format=xml&content= POST /cas/v1/ke HTTP/1.1\r\n Host: asia.search.yahooapis.com\r\n Content-Length: \r\n Content-Type: application/x-www-form- urlencoded\r\n \r\n appid= &format=xml&content=

Yahoo Term Extraction Web Service mExtraction.html mExtraction.html Sample request: – ermExtraction – appid: YahooDemo – context: Italian sculptors and painters of the renaissance favored the Virgin Mary for inspiration. – query: madonna

Sample response – italian sculptors virgin mary painters renaissance inspiration

Parsing JSON Output Document: Implementations – JSON parser in C, C++, Java, Perl, PHP, Python, … – Ex. JSON_checker, and JSON_parser in C

Bing Search API Document: us/library/dd aspxhttp://msdn.microsoft.com/en- us/library/dd aspx – Search: Web, images, news, video, … – Register an API key – Start using the API – Request method: HTTP GET – Response format: JSON, XML, SOAP

Bing Web Search Example in Web search – Sample request: – – AppId= – Sources=Web – Query=msdn blogs

HTTP GET E.g.: &Sources=Web&Query= GET /json.aspx?AppId= &Sources=Web&Query= HTTP/1.1\r\n Connection: close\r\n Host: api.bing.net\r\n \r\n

Request Example your AppId here&Query=msdn blogs&Sources=Web&Version=2.0&Market=e n- us&Adult=Moderate&Options=EnableHighligh ting&Web.Count=10&Web.Offset=0&Web.Opt ions=DisableHostCollapsing+DisableQueryAlte rations&JsonType=callback&JsonCallback=Sea rchCompleted

Response Example { "SearchResponse":{ "Version":"2.0", "Query":{ "SearchTerms":"msdn blogs" }, "Web":{ "Total":1490, "Offset":0, "Results":[ { "Title":"Monads", "Description":"Monad 1 2 Manifesto. Jeffrey P. Snover. Aug 8, Version 1.2. What is Monad? Monad is the next generation platform for administrative automation.", "Url":" ", "DisplayUrl":" 7.ashx", "DateTime":" T05:27:14Z" }, …, { "Title":"Software Design Invitation Proposal Template for Imagine Cup", "Description":"SINGPAPORE SOFTWARE DESIGN INVITATIONAL SUBMISSION PROPOSAL TEMPLATE. NOTE: This section contains a template, not a fixed format. Please return soft copy only – hardcopies will not be...", "Url":" "DisplayUrl":" hx", "DateTime":" T18:13:07Z" } ] } } }

Thanks for Your Attention!