1 / 27

Mobile Web Services Problems and a Good Solution

INFOSYS290-3 Web Services: Concepts, Design and Implementation. Mobile Web Services Problems and a Good Solution. ablum@good.com. Agenda. Microsoft and Java tools for web services Outstanding problems with web services Good solution to those problems.

anisa
Download Presentation

Mobile Web Services Problems and a Good Solution

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. INFOSYS290-3 Web Services: Concepts, Design and Implementation Mobile Web Services Problemsand a Good Solution ablum@good.com

  2. Agenda • Microsoft and Java tools for web services • Outstanding problems with web services • Good solution to those problems

  3. Microsoft Tools: .NET Compact Framework • Subset of .NET for small and mobile devices • CLR for managed code • Subset of System.Windows.Forms • Subset of System.Drawing • Data and XML • Web services clients only • Multithreaded apps (vs. Palm) • IrDA support • Bluetooth Support

  4. .NET Compact Framework: What’s Not There • Method Overloads • Controls • Printing • Most third party controls • XPath • Local database support for SQL Server CE and remote support for SQL Server. Third party provides support for PocketAccess – that’s it • Binary serialization • Access to registry • Direct COM object access (need to write wrapper in .NET CF) • No cookie usage for stateful web services • No .NET remoting

  5. Microsoft Tools: Visual Studio .NET • Pre-built device profiles • Templates • Smart Device Apps • Mobile Web Apps • Device specific controls • Device emulators • Automatic deployment • Remote debugging • Languages • C# • VB • Demo Visual Studio Smart Device Application

  6. Microsoft Mobile Web Services Tools • Pros • Easy to use development environment • Good implementation • Assume they will be among the earliest with newer web services features (e.g. WS-Security) • Cons • Still fairly low level • No compression method for the XML • No ability to have a mediating server send just updated data • No ability to have server handle web service invocation as a proxy for the client • Most business XML documents and web services would still be way too large to send, deliver and process in bulk (e.g. repeated queries)

  7. Java Tools - MIDP • MIDP 2.0 (JSR 118) • UI controls • Push settings • Alerts, message, broadcasts • Over-the-air provisioning (OTA) • End to end security • Write once deploy to many devices

  8. JSR 172- Web Services APIs (WSA) for J2ME • Basic XML processing • Subset of JAXP • APIs for web service clients • Subset of WSDL to Java mappings in JAX-RPC • Discusses possibility of compressed “fast XML” • No algorithms or implementations supplied • Early internal Sun attempts resulted in approximately 3 to 1 • Implementations • IBM WebSphere Device Developer Studio • Sun Java Studio Mobility 6 • Reference • http://www-106.ibm.com/developerworks/wireless/library/wi-/jsr/?ca=dgr-lnxw82ws4Wireless

  9. JSR 172 Invocation Model

  10. Java References • MIDP • Overview - http://msdn.microsoft.com/mobility/netcf/ • What’s New in 2.0 -- http://java.sun.com/products/midp/whatsnew.html • JSR 172 • http://www-106.ibm.com/developerworks/wireless/library/wi-jsr/?ca=dgr-lnxw82ws4Wireless • Sun J2ME Wireless Toolkit • http://java.sun.com/products/j2mewtoolkit/

  11. Overall Problems with Web Services on Devices • Web services data transmission • Large (if to mobile device client), especially if doing repeated queries • Syncing data to devices • Difficult • Slow • Web Service connectivity app design • Difficult for even one platform • No common “write once run anywhere” solution • Result on MIDP is unattractive and not tuned to device • Working with offline data • Try to provide responses to queries even when offline • Indicate when data may be stale • Allow computation with offline data • It should be easy to see changes coming from the server • Handle cases where user edits may be overridden or lost by other users

  12. GAWS Architecture Overview Web service documents GetAccount Object— GoodSOAP codec SOAP- GoodSOAP codec Siebel ShowContacts App Definitions (.AAC files) GoodSync GoodCall GoodSync GetAccounts SalesForce Web service documents ListContacts SOAP reliable transport reliable transport Subscription Manager GoodSOAP QueryProducts Document Manager Forms Runner .web service subscriptions SAP QueryCompany GoodAccess Client GoodAccess Server

  13. The Problem: SOAP Messages to Mobile Devices • SOAP messages are large and consume high amount of bandwidth • And bandwidth is both unreliable and low compared to desktops and servers • Processing SOAP messages can consume large percent of CPU

  14. The Solution:GoodSOAP • Mediating server communicates generic SOAP to backend web service • Server communicates proprietary compressed format to device • proprietary compression format can be optimized for the XML document format used • Algorithm • XML Schema knowledge allows dictionary lookup for elements, structure and data types • State machine which helps knowledge of what the next element may be • E.g. Two choices -> one bit • Final pass is LZW for actual content • Results • Greater than 15 to 1 compression for most SOAP XML traffic • Encoders/decoders available for mobile devices and specific mediating server

  15. GoodSOAP Architecture GAWS Forms Runner Client GAWS Server enterprise application web service Enterprise Application (e.g SalesForce, Siebel,SAP, Oracle CRM) NameValue- GoodSOAP codec App Definition (.AAC file) GoodSOAP -SOAP codec SOAP endpoint SOAP WSDL definition Good Sync Good Sync GAWS Form Renderer GoodSOAP dictionary GoodSOAP Reliable messaging Reliable messaging App Definition (.AAC) GoodSOAP dictionary generator AboveAll Studio Forms Designer on device In the enterprise

  16. The Problem: Syncing Data to Devices • Users wants all data of interest on their device as current as possible • Parallel to the Blackberry and GoodLink value proposition for email • For web service data this implies reexecuting a query-web service whenever in coverage • For example in an SFA scenario the sales rep user might want • All their customer companies • All their leads and opportunities • All the contacts and notes attached to any of those objects • All their products and inventory levels • Executing these web service requests from device whenever in coverage is prohibitively expensive in bandwidth, processing power, and device storage • Imagine requerying for all of your one thousand customer accounts and contacts to find any updated data directly from your device: • Even polling every 10 minutes, its likely that your device will be continuously processing the XML web service data and never finish before the next time it is supposed to query • Device will quickly fill up with data, be unable to process other important traffic (such as email) and slow down to a crawl as it parses the returned XML

  17. The Solution: GoodSync • Perform web service query execution for “subscribed services” on GAWS Server • Server stores query web service results • Server determines delta from previous execution • First reoccurring element from the root is guess at repeating “record” (configurable during service registration) • can configure a “key” (e.g. ID) attribute or subelement of the “record” element • Store key, hash of record content in per user, per object cache • Server checks new query result against existing cache looking for changes, adds and deletes (no key: everything is add and delete) • Server ends deltas only (adds, deletes, updates) to device • Server stays current with backend web service by • Polling on configured interval (with optional self-adjusting frequency) • Providing callback to backend web service to be notified of new content • Maintaining a per user, per object type (returned document) cache with result of invocation Result: All your data current on your device all the time!

  18. GoodSync Runtime Architecture GoodSync Service <GetAccountResponse> <Account ID=1 Name=IBM …> <Account ID=2 Name=Microsoft…> </GetAccountResponse> SOAP-based Web service endpoints GoodSync cache GetAccounts operation <GetContactsResponse> <Contact ID=7 Name=Mary Phone=212-555-1234/> <Contact ID=9 Name=Jake Phone=212-555-4321/> </GetContactsResponse> GetContacts operation <QueryProductsResponse> <Product ID=5 Name=Widget Price=100.00/> <Product ID=6 Name=Axle Price=50.0-/> </GetContactsResponse> QueryProducts operation

  19. GoodSync: Configure Subscriptions • Registration (by administrator) • Registers web service • Identifies query operation in WSDL portType • Identifies record boundary in query web service response document • Identifies key attribute or subelement • Identifies update web service operation in WSDL portType • Describe how to package record data back into update/insert/delete operations • Subscription (by user) • Identifies query criteria • Override polling time interval • Space budget in mB • Recipients

  20. Query Web Service Subscription and Registration web service subscription web interface web service registration web interface Subscription query executor query cache Web service update packager

  21. GoodSync: Drilldown Into Runtime Object Sync GoodSync Service <GetAccounts/> <User=“John”> <Category= “mobile software tools”/> </GetAccounts> GetAccounts operation

  22. GoodSync Receives Web Service Response GoodSync Service <GetAccountsResponse/> <User=“John”> <Category=“mobile software tools”/> <Accounts> <Account Name=“IBM” …/> <Account Name=“Microsoft”../> <Account Name=“Good” …/> </Accounts> </GetAccountsResponse> GetAccounts operation

  23. GoodSync Updates Cache GoodSync Service <GetAccountsResponse/> <User=“John”> <Category=“mobile software tools”/> <Accounts> <Account Name=“IBM” …/> <Account Name=“Microsoft”../> <Account Name=“Good” …/> </Accounts> </GetAccountsResponse> GetAccounts operation

  24. GoodSync Sends Updates Only to Device GoodSOAP encoded data Account Update Name=IBM… Account Delete Name=Sun Account Create Name=Good GoodSync Service GetAccounts operation

  25. The Problem: Offline Editing and Synced Updates • In the GAWS Client with GoodSync, data is continuously updated to the client • Customers also work with existing data offline • They edit values, delete records, add new records • User-edited but not yet synced updated records need to be clearly identified • Changed records • Updated records • Deleted records • Syncs that that causes conflicts need to be clearly shown • User edited data should not be synced when it conflicts with more recent server change • However user edits should not be discarded

  26. The Solution:GAWS Subscription Viewerand Conflict Resolver • Show conflicting record to user in Subscription Viewer “record view” • When editing record either “server copy” or “local copy” in form allow easy choice of which edits to accept • All server changes • All local changes • Field by field for changed fields • Rely on web service for appropriate business logic to handle successive updates

  27. References • “Smart Clients: Combining the Power of the PC with the Reach of the Web” • http://www.microsoft.com/library/toolbar/3.0/images/banners/dotNET_masthead_ltr.gif • “Architecting Disconnected Mobile Applications Using a Service Oriented Architecture” • http://msdn.microsoft.com/library/en-us/dnppc2k3/html/develop_disconnect_mob_apps.asp?frame=true

More Related