Web Services at IRIS DMC Joanna Muench Linus Kamb
Outline Web service development process at DMC Demos SOSA seismogram processing UPDS product handling DHI database access
Developing a web service Interface creation with a wsdl Code generation Building the backend Client side development Deployment Testing and logging Reports from the field
Creating an interface WSDL (web service definition language) is public interface to service Best practice - define wsdl first Avoids language specific constructs Guarantees* interface intent But - complicated, easy to make mistakes <wsdl:definitions name="dhi_webservice" targetNamespace=" xmlns:mime=" xmlns:soap=" xmlns:tns=" xmlns:wsdl=" xmlns:xsd=" xmlns:xsd1=" Created using Cape Clear Studio SOA Editor> <xsd:schema targetNamespace=" xmlns:SOAP-ENC=" xmlns:wsdl=" xmlns:xsd=" xmlns:xsd1=" Defines a time span with start and end times.
Tools for WSDL creation Cape Clear SOA Editor Graphic interface WSDL validator Great manual (and free!) Other editors: Altova XMLSpy Sonic Software or, XML Editor + WSDL validator
Code generation Tools that translate wsdl into a web service engine in your favorite language Provide stubs and bindings, making server and/or client generation easier Available in many languages Java: Axis, GLUE, JibxSOAP Perl: SOAPLite C#:.NET C++: gSOAP, Axis
Building the backend Implement desired functionality Various architectures possible Maintain flexibility through interfaces Test Fill in stub methods in generated code, calling your implementation Youre ready to deploy!
Building the client Deployment is more interesting with a client Client skeleton can be generated from wsdl Could be command line driven, web application or full application Common practice to have a client internal to server project, for testing new ideas
Server Deployment Most web service development environments have deployment tools Automation is essential - useful tools like ant Three levels of deployment EnvironmentFunctionUpdated LocalDevelopmentEvery 5 min TestLoad test, etc.Daily (or less) ProductionPublic serviceNew release only
Testing and logging Testing at all levels Unit tests in dev Functional tests Performance tests Automate and run frequently Logging Debugging Performance monitoring Usage monitoring
Reports from the Field Can be easy but… Setting up deployment, classpaths, etc can be tricky Tools arent foolproof (at least not the free ones) Attachment specification still vague
IRIS DMC web services SeismoProcess - component of SOSA (Synthetic and Observed Seismogram Analysis) UPDS (Uniform Product Distribution Service) revolves around web service DHI (Data Handling Interface) web service
SeismoProcess Service Provides additional processing capabilities for SOSA, a Java GUI application Part of SCEC CME Motivation: Update and expand processing capabilities without re-installing application Prototype for possible more general seismogram processing service Released as part of SOSA 1.0, but not yet running on production server
SeismoProcess Service
Implementation details Attachment style SOAP with Attachments (SwA) Seismograms sent as SAC files Issues Attachment configuration Performance
UPDS - Motivation Uniform Product Distribution System Submit, archive, query, and access Handles XML Data Products Many different types of products Unknown future products Extensible products, product list
UPDS - Design Submission service Query/Access service Unstructured XML Application and Web interfaces Flexible interfaces
UPDS - Overview DATA PRODUCT PRODUCER PRODUCT ARCHIVE SUBMISSION WEB SERVICE Product Handler Module Product Handler Module Product Handler Module Product Handler Modules SUBMIT CLIENT Web Access QUERY / ACCESS WEB SERVICES CLIENT PROGRAM
UPDS - Overview DATA PRODUCT PRODUCER PRODUCT ARCHIVE SUBMISSION WEB SERVICE Product Handler Module Product Handler Module Product Handler Module Product Handler Modules Web Access QUERY / ACCESS WEB SERVICES CLIENT PROGRAM SERVLET Q/A WEB SERVICES Q/A LIB
UPDS - Issues Pure XML vs binary products Large products Pure WS vs multi-protocol approach Large result sets Attachment handling Performance
DHI web service Web service to CORBA-based DHI SCEC CME in conjunction with USArray Provides subset of full DHI capabilities Motivation: Language agnostic service Available over port 80 Provide most commonly accessed DHI functions, simplified data types Not yet beta release
DHI web service
Implementation details Attachment style Seismograms sent as mSeed, SAC or link to URL for download Issues Attachment configuration problems in Axis Performance of underlying CORBA service
Recap Can be easy but… hard to do right Setting up deployment, etc can be tricky Tools arent foolproof (at least not the free ones) Attachment specifications still vague