caching xml web services to support disconnected operation
Download
Skip this Video
Download Presentation
Caching XML Web Services to Support Disconnected Operation

Loading in 2 Seconds...

play fullscreen
1 / 28

Caching XML Web Services to Support Disconnected Operation - PowerPoint PPT Presentation


  • 166 Views
  • Uploaded on

Caching XML Web Services to Support Disconnected Operation. Venugopalan Ramasubramanian Cornell University Doug Terry Microsoft Research, Silicon Valley. Web Services. method of providing and accessing services on the Internet consumer services hotmail, orbitz, mapquest, ebay, …

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Caching XML Web Services to Support Disconnected Operation' - hera


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
caching xml web services to support disconnected operation

Caching XML Web Services to Support Disconnected Operation

Venugopalan Ramasubramanian

Cornell University

Doug Terry

Microsoft Research, Silicon Valley

web services
Web Services
  • method of providing and accessing services on the Internet
    • consumer services
      • hotmail, orbitz, mapquest, ebay, …
    • B to B services
      • supply chain management
  • request-response paradigm
    • RPCs on the internet
xml web services
XML Web Services
  • W3C (world wide web consortium) standards
    • Microsoft, IBM, HP, …
    • Microsoft .Net web services (HailStorm)
      • mycontacts, myprofile, myfavoritewebsites
    • TerraServer, CoolRooster
  • SOAP (simple object access protocol)
    • standard representation of web service requests/responses (SOAP-RPC)
  • WSDL (web services description language)
    • description of web services
availability of web services
Availability of Web Services

GOAL

make web services available despite frequent disconnections and limited bandwidth!

  • web service clients reside on all kinds of devices
    • desktop, laptop, PDA, smart phone
  • network outages (especially wireless)
  • bandwidth restriction
governing principles
Governing Principles
  • cannot modify web services
  • cannot modify access protocols
  • can perhaps modify client
    • must also comply with existing clients
  • can interpose storage and computation

client-side caching is a solution to improve availability!

xml standards soap
XML Standards: SOAP
  • SOAP-RPC standard
    • encoding definitions for data types
    • success, failure definitions
  • SOAP-Envelope
    • outer-most element
  • SOAP-Body
    • obligatory
    • request operation: name, parameters
    • response status: return value, failure
  • SOAP-Header
    • optional, multiple header blocks.
    • supplementary information: kerberos ticket
  • HTTP binding
    • HTTP request and response messages
example soap request
example: soap request

xmlns:mp="http://schemas.microsoft.com/hs/2001/10/myProfile" >

3240

http://schemas.microsoft.com/hs/2001/10/core#request

http://terry.microsoft.com

b55528a4-5d63-49f1-87a2-5fab8d76f658

select="/m:myContacts/m:contact[mp:name/mp:givenName = ‘Terry']/mp:emailAddress" >

[email protected]

xml standards wsdl
XML Standards: WSDL
  • concrete definition of the web service
    • data structures
    • interface offered by the web service
      • operation names and parameters
    • message formats (components of a message)
    • protocol binding (SOAP)
  • automatic generation of client-side stubs
    • Visual Studio .Net
experiments with web cache
MyContacts

MyServices

MyProfile

cache

Experiments with Web Cache
  • experiment with existing clients and services (Microsoft .Net web services)
  • check feasibility by building a cache to store HTTP requests/responses
issues in caching
Issues in Caching
  • web services are active
    • default HTTP cache directive is No Cache!
  • web services are diverse
    • unlike files and databases, web services have custom interfaces
  • fundamental questions
    • which requests are cacheable?
    • which operations have permanent side effects?
    • how to understand requests/responses?
      • services use different formats for requests/responses
example soap request11
example: soap request

xmlns:mp="http://schemas.microsoft.com/hs/2001/10/myProfile" >

3240

http://schemas.microsoft.com/hs/2001/10/core#request

http://terry.microsoft.com

b55528a4-5d63-49f1-87a2-5fab8d76f658

select="/m:myContacts/m:contact[mp:name/mp:givenName = ‘Terry']/mp:emailAddress" >

[email protected]

issues in caching contd
Issues in Caching contd.

request 1: query request

  • consistency
    • later requests might invalidate responses cached earlier.
      • read/write, write/write conflicts
    • how to specify consistency requirements for generic web services?

request 2: delete request

“myContacts/contact[name=‘terry’]/phone[@cat=‘cell’]”/>

more issues
More Issues…
  • user experience
    • user unaware of web service cache
    • operations reportedly successful could fail!
  • hoarding
    • keeping the cache hot
    • user controlled hoard requests
  • security
    • enforce access control
our approach
Our Approach
  • annotate WSDL description of web services to define cache properties
    • published by service providers or third party
    • no changes to server side code required 
  • transparent cache for web services
    • acts as a web proxy on the client machine
    • no modifications of the client program necessary 
  • custom cache managers for each web service
    • generated automatically from the annotated WSDL description 
architecture
I

N

T

E

R

N

E

T

Web

Service 1

Web

Service 3

Web

Service 2

Web Client 1

Web Client 2

C

C

M

1

C

C

M

2

C

C

M

3

Architecture

Proxy

Server

Cache

WBQ

CCM1: Custom Cache Manager 1

WBQ: Write Back Queue

wsdl annotations for each operation
WSDL Annotations: for each Operation
  • cacheable: the operation can be cached
  • lifetime: the duration for which replies are cached
  • play-back: the operation has side effects and must be played back when connection is restored
  • default-response: a default response will be sent when connection is not available
wsdl annotations for each service
WSDL Annotations: for each Service
  • identify the operation (operationName)
    • xpath (xml query language) expression to extract the name of the operation
  • extract the request message (identifier)
    • portions of the request message should be ignored while caching (date)
    • xpath expression to extract relevant parts of the message for identification
snippet from annotated mycontacts wsdl
snippet from annotated myContacts.wsdl

operationName =

"substring-before(localname(/senv:Envelope/senv:Body/*[1]), 'Request')"

Identifier = "/senv:Envelope/senv:Header/s0:licenses | /senv:Envelope/senv:Header/s1:request | /senv:Envelope/senv:Body">

annotations for consistency
Annotations for Consistency
  • when does request 2 invalidate the response of an earlier request 1 in the cache?
    • an insert could invalidate an earlier query response
  • consider requests to be functions with signatures

req1: op1 (param1,1, param1,2, …, param1,n)

req2: op2 (param2,1, param2,2, …, param2,m)

  • invalidate condition is an expression of req1 and req2

f(op1, op2, param1,1, …, param2,1, …)

annotations for consistency xsl transformations
Annotations for Consistency: XSL Transformations
  • extensible style sheet language (XSL)
    • transforms XML documents in to html/text/xml
    • Turing-complete language
  • cache transform: transforms a cached response
    • input: request1, reply1, request2, reply2
    • output: transformed reply1 (null if invalidated)
  • powerful than just specifying invalidations
    • can actually transform the old response
cache transform example
Cache Transform Example

request 1: query request

request 2: delete request

“myContacts/contact[name=‘terry’]/phone[@cat=‘cell’]”/>

smart cache transform would delete the cell phone number from the cached query response

slide22

picking level of consistency
Picking Level of Consistency
  • user-freedom in choosing consistency guarantees
    • multiple consistency transforms
  • strong consistency
    • less availability 
    • better user experience 
  • weak consistency
    • user experience could deteriorate 
      • operations reportedly successful could fail!
      • optional cache header
    • better availability 
more transforms
More Transforms
  • response transform
    • response from the cache may have to be changed before returning to the client.
    • adding time-stamp, unique identifiers etc.
  • default response transform
    • generates a default response for a request.
    • default responses are returned when disconnected but request is queued for play-back
optional cache header
Optional Cache Header
  • cache provides information to the client using cache header
    • response from cache or server
    • age of cached response
    • request will be played back in the future
  • no changes to the definition of WSDL
    • would not affect existing clients in any way.
  • cache aware clients can provide additional information to the user
example default response and cache header
example: default response and cache header

http://schemas.microsoft.com/hs/2001/10/core#response

http://terry.microsoft.com

d978b559-aceb-4e9e-9747-b8a306234bc8

< responsexmlns ="http://schemas.microsoft.com/hs/2001/10/core" />

conclusion
Conclusion
  • built a prototype web services cache
  • experimented with Hailstorm web services and clients
  • annotated Hailstorm WSDL files
  • the prototype demonstrates custom cache managers in action for Hailstorm
  • couldn’t give a demo 
work for the future
Work for the Future
  • WSDL annotations for more web services
    • hard to find interesting web services with WSDL descriptions yet!
  • hoarding to enhance availability
    • specify user controlled hoard queries
    • hoard transform to obtain response from cached hoard requests
  • incorporate security constraints
  • tune cache performance
ad