Web Services — Part II

Web-Based Services (INFOSYS 290-3)

Erik Wilde, UC Berkeley iSchool
Monday, October 9, 2006
Creative Commons License

This work is licensed under a Creative Commons
Attribution-NonCommercial-ShareAlike 2.5 License.

Abstract

The basic Web Services technologies of SOAP and WSDL are being used by various companies to provide service access for B2B communications. Google and Amazon are two popular examples, with both companies providing access to their traditionally browser-based services through SOAP. Google has a very simple service, while Amazon's is much more complex, allowing more types of interactions with Amazon. In both cases, the service is not anonymous, so that service usage can be controlled.

Web Service Examples

Outline (Service Usage Considerations)

  1. Service Usage Considerations [11]
    1. GUIs vs. APIs [4]
    2. Access Control [4]
    3. Choreography [2]
  2. Web Services Examples [10]
    1. Google [5]
    2. Amazon [4]
  3. Conclusions [2]

Service Design

Outline (GUIs vs. APIs)

  1. Service Usage Considerations [11]
    1. GUIs vs. APIs [4]
    2. Access Control [4]
    3. Choreography [2]
  2. Web Services Examples [10]
    1. Google [5]
    2. Amazon [4]
  3. Conclusions [2]

APIification

HTTP Cookies

Cookie Handling

Cookie Problems

Outline (Access Control)

  1. Service Usage Considerations [11]
    1. GUIs vs. APIs [4]
    2. Access Control [4]
    3. Choreography [2]
  2. Web Services Examples [10]
    1. Google [5]
    2. Amazon [4]
  3. Conclusions [2]

Humans vs. Machines

Deep Linking

Keeping Robots Away

Preventing Anonymous Usage

Outline (Choreography)

  1. Service Usage Considerations [11]
    1. GUIs vs. APIs [4]
    2. Access Control [4]
    3. Choreography [2]
  2. Web Services Examples [10]
    1. Google [5]
    2. Amazon [4]
  3. Conclusions [2]

Services & Operations

 <portType name="GoogleSearchPort">
  <operation name="doGetCachedPage">
   <input message="typens:doGetCachedPage"/>
   <output message="typens:doGetCachedPageResponse"/>
  </operation>
  <operation name="doSpellingSuggestion">
   <input message="typens:doSpellingSuggestion"/>
   <output message="typens:doSpellingSuggestionResponse"/>
  </operation>
  <operation name="doGoogleSearch">
   <input message="typens:doGoogleSearch"/>
   <output message="typens:doGoogleSearchResponse"/>
  </operation>
 </portType>

Choreography Example

Outline (Web Services Examples)

  1. Service Usage Considerations [11]
    1. GUIs vs. APIs [4]
    2. Access Control [4]
    3. Choreography [2]
  2. Web Services Examples [10]
    1. Google [5]
    2. Amazon [4]
  3. Conclusions [2]

APIified GUIs

Outline (Google)

  1. Service Usage Considerations [11]
    1. GUIs vs. APIs [4]
    2. Access Control [4]
    3. Choreography [2]
  2. Web Services Examples [10]
    1. Google [5]
    2. Amazon [4]
  3. Conclusions [2]

Google Search API

Google Search Message

 <message name="doGoogleSearch">
  <part name="key" type="xsd:string"/>
  <part name="q" type="xsd:string"/>
  <part name="start" type="xsd:int"/>
  <part name="maxResults" type="xsd:int"/>
  <part name="filter" type="xsd:boolean"/>
  <part name="restrict" type="xsd:string"/>
  <part name="safeSearch" type="xsd:boolean"/>
  <part name="lr" type="xsd:string"/>
  <part name="ie" type="xsd:string"/>
  <part name="oe" type="xsd:string"/>
 </message>

Google Search Result

   <xsd:complexType name="GoogleSearchResult">
    <xsd:all>
     <xsd:element name="documentFiltering" type="xsd:boolean"/>
     <xsd:element name="searchComments" type="xsd:string"/>
     <xsd:element name="estimatedTotalResultsCount" type="xsd:int"/>
     <xsd:element name="estimateIsExact" type="xsd:boolean"/>
     <xsd:element name="resultElements" type="typens:ResultElementArray"/>
     <xsd:element name="searchQuery" type="xsd:string"/>
     <xsd:element name="startIndex" type="xsd:int"/>
     <xsd:element name="endIndex" type="xsd:int"/>
     <xsd:element name="searchTips" type="xsd:string"/>
     <xsd:element name="directoryCategories" type="typens:DirectoryCategoryArray"/>
     <xsd:element name="searchTime" type="xsd:double"/>
    </xsd:all>
   </xsd:complexType>

WSDL Description

WSDL Documentation

Outline (Amazon)

  1. Service Usage Considerations [11]
    1. GUIs vs. APIs [4]
    2. Access Control [4]
    3. Choreography [2]
  2. Web Services Examples [10]
    1. Google [5]
    2. Amazon [4]
  3. Conclusions [2]

Amazon as a Service

Amazon Search Request

   <xs:element name="ItemSearch">
    <xs:complexType>
     <xs:sequence>
      <xs:element name="MarketplaceDomain" type="xs:string" minOccurs="0"/>
      <xs:element name="AWSAccessKeyId" type="xs:string" minOccurs="0"/>
      <xs:element name="SubscriptionId" type="xs:string" minOccurs="0"/>
      <xs:element name="AssociateTag" type="xs:string" minOccurs="0"/>
      <xs:element name="XMLEscaping" type="xs:string" minOccurs="0"/>
      <xs:element name="Validate" type="xs:string" minOccurs="0"/>
      <xs:element name="Shared" type="tns:ItemSearchRequest" minOccurs="0"/>
      <xs:element name="Request" type="tns:ItemSearchRequest" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
    </xs:complexType>
   </xs:element>
   <xs:complexType name="ItemSearchRequest">
    <xs:sequence>
     <xs:element name="Actor" type="xs:string" minOccurs="0"/>
     <xs:element name="Artist" type="xs:string" minOccurs="0"/>
     <xs:element name="Availability" minOccurs="0">

WSDL Documentation

REST Alternative

Outline (Conclusions)

  1. Service Usage Considerations [11]
    1. GUIs vs. APIs [4]
    2. Access Control [4]
    3. Choreography [2]
  2. Web Services Examples [10]
    1. Google [5]
    2. Amazon [4]
  3. Conclusions [2]

Web Service Examples

Assignment 4