Designing Interopable Web Services

3,730 views

Published on

This presentation outlines best practices for designing SOAP based web services for use in exchanging information between systems.

The presentation was given on Feb 24 at the Vancouver Tech Fest by Lawrence Chan and Jeff Pennal of OpenRoad Communications Ltd.

Published in: Technology
1 Comment
6 Likes
Statistics
Notes
No Downloads
Views
Total views
3,730
On SlideShare
0
From Embeds
0
Number of Embeds
174
Actions
Shares
0
Downloads
0
Comments
1
Likes
6
Embeds 0
No embeds

No notes for slide

Designing Interopable Web Services

  1. 1. Designing Interoperable Web Services Lawrence Chan Jeff Pennal OpenRoad Communications Ltd. Vancouver Java Users group http:// www.openroad.ca/vanjug /
  2. 2. Overview <ul><li>The promise and reality of Web Services </li></ul><ul><li>Designing flexible web services </li></ul><ul><li>Debugging web services </li></ul><ul><li>Designing for performance </li></ul><ul><li>Recommendations </li></ul><ul><li>Fabulous prizes! </li></ul>http://www.flickr.com/photos/josefstuefer/9500503/
  3. 3. The Promise It’s just XML! Cross Platform! A standard! Network Transparent! http://www.flickr.com/photos/tookie/183503927/
  4. 4. The Reality Hard to debug Poor Performance Poor compatibility http://www.flickr.com/photos/tom_vac/373021521/
  5. 5. So why bother? It works.
  6. 6. Real World Examples : Performance
  7. 7. Court Services Online <ul><li>Java e-commerce for searching and filing court records </li></ul><ul><li>https:// webapps.ag.gov.bc.ca/cso </li></ul><ul><li>Multiple backend content providers in different locations with different technologies </li></ul><ul><li>Technical solution: Use Web Services! </li></ul>
  8. 8. Challenges <ul><li>Dealing with large databases </li></ul><ul><li>Performance, performance, performance </li></ul><ul><li>Security </li></ul>
  9. 9. Solutions <ul><li>Benchmarked different Java SOAP providers </li></ul><ul><ul><li>Systinet vs. Axis vs. Oracle </li></ul></ul><ul><li>Optimized web service API calls to match screens </li></ul><ul><li>Used Layer 7 XML Firewall to inspect and secure network traffic </li></ul>
  10. 10. Real World Examples : Debugging
  11. 11. Supreme Court Scheduling System <ul><li>.NET web application for Supreme Court, hosted in Vancouver </li></ul><ul><li>New project goal: Integrate with Java based Ministry of AG case tracking application in Victoria </li></ul><ul><li>Technical solution: Use Web Services! </li></ul>
  12. 12. Challenges <ul><li>Client was .Net 1.1 talking to Systinet Server for Java </li></ul><ul><li>Interoperability ended up being a huge problem! </li></ul><ul><li>Kept seeing NoSuchMethodError </li></ul><ul><li>How to debug? </li></ul>
  13. 13. Debugging SOAP <ul><li>Recommendation: use proxy-based SOAP debugger </li></ul><ul><li>Microsoft Soap Toolkit 3.0 </li></ul><ul><li>Proxy debuggers sit between SOAP client and server, and display traffic </li></ul>
  14. 14. <ul><li>How .NET encoded the method parameters </li></ul><ul><li><soap:Body> </li></ul><ul><li><p1 xmlns=&quot;http://systinet.com/xsd/SchemaTypes/&quot;>772</p1> </li></ul><ul><li><p0_10 xmlns=&quot;http://systinet.com/xsd/SchemaTypes/&quot;>16882</p0_10> </li></ul><ul><li></soap:Body> </li></ul><ul><li>versus </li></ul><ul><li>How Systinet encoded the method parameters </li></ul><ul><li><e:Body> </li></ul><ul><li><n0:p0_10 xmlns:n0= http://systinet.com/xsd/SchemaTypes/ i:type=&quot;d:decimal&quot; >772</n0:p0_10> </li></ul><ul><li><n1:p1 xmlns:n1= http://systinet.com/xsd/SchemaTypes/ </li></ul><ul><li>i:type=&quot;d:decimal&quot; >16882</n1:p1> </li></ul><ul><li></e:Body> </li></ul>.NET vs Systinet
  15. 15. Real World Examples: Flexibility
  16. 16. Hip Digital <ul><li>B2B provider specializing in digital music downloads of over 1 million tracks from the 4 majors </li></ul><ul><li>Clients include Pepsi, Nissan and Country Music Television </li></ul><ul><li>Needed both a web front end and an API </li></ul><ul><li>Technical Solution: Use Web Services! </li></ul>
  17. 17. Hip Digital Challenges <ul><li>API must integrate seamlessly into any platform </li></ul><ul><li>Must keep track downloads secure </li></ul><ul><li>Need to keep Hip Digital hidden from end users </li></ul><ul><li>Need to integrate with varied payment models </li></ul>
  18. 18. Hip Digital Solutions <ul><li>Kept API to simple data types - strings and ints </li></ul><ul><li>Used one-time passwords that could be revoked at any time to authorize every download </li></ul><ul><li>Authorization, redemption and error handling handled via web services </li></ul><ul><li>Only direct connection to HD for actual track download and DRM authorization </li></ul>
  19. 19. Summary <ul><li>Not all implementations are equal </li></ul><ul><li>Network trace tools are useful for debug </li></ul><ul><li>Minimize the data being sent </li></ul><ul><li>Design your Web Services with reuse in mind </li></ul><ul><li>Keep your interfaces simple </li></ul>http://www.flickr.com/photos/jerryjohn/63351338
  20. 20. Interop Gotchas: Arrays <ul><li>Problem: Arrays can be bad </li></ul><ul><li>Solution: Keep them simple </li></ul>
  21. 21. Interop Gotchas: Naming <ul><li>Problem: Code compiles but there are runtime errors </li></ul><ul><li>Solution: Make class names unique, don’t rely on the namespace </li></ul>
  22. 22. Interop Gotchas: Datatypes <ul><li>Problem: Datatype conversion </li></ul><ul><li>Solution: Keep it simple </li></ul>
  23. 23. Java vs .NET type comparison System.DateTime DateTime DateTime Calendar System.Double Double double double System.Single Single float float System.Int64 Long long long System.Int32 Integer int int System.Int16 Decimal short short System.SByte -N/A- sbyte byte System.Boolean Boolean bool boolean System.String String string String .NET Framework Type VB.NET C#.NET Java
  24. 24. Interop Gotchas: OO <ul><li>Problem: Object Oriented features do not translate well across platforms. </li></ul><ul><li>Solution: Denormalize your objects, stick to simple types </li></ul>
  25. 25. Pop Quiz! This technology originally developed by Dave Winer, is considered to be the precursor to SOAP. What is XML-RPC?
  26. 26. Pop Quiz! This technology provides a platform-independent , XML-based registry for businesses worldwide to list themselves on the Internet. What is Universal Description, Discovery, and Integration (UDDI)?
  27. 27. Pop Quiz! These are the two encoding mechanisms for SOAP attachments. What are MIME and DIME?
  28. 28. Any Questions? <ul><li>Jeff Pennal </li></ul><ul><li>[email_address] </li></ul><ul><li>Lawrence Chan </li></ul><ul><li>[email_address] </li></ul><ul><li>VanJug www.openroad.ca/vanjug </li></ul>http://www.flickr.com/photos/feaverish/19544565

×