Optimizing Web Services

Key points from the article "Top 5 Web Service Mistakes" paraphrased -

  • For maximum interoperability of .NET Web Services with non .NET clients, use standard XML Schema base types instead of .NET specific types.
  • Web services developed in .NET are deployed in ASP.NET and so they have access to all of the same great features of any ASP.Net web application like Output caching, application data caching, SessionState persistence (including out-of-process State Server and SQL Server) and client cookies. Significant performance benefits can be achieved by leveraging these state persistence features (with some caveats, however)
  • Consider aggregating smaller requests into a larger single request to improve performance while suitably handling the increased complexity.
  • Use web services to expose functionality and not data. For example, Google Search Web Service's usefulness is in its ability to give organized and relevant results rather than plain data.
  • Secure the data exchange and web service by validating the input to the web methods, protecting the data that is returned back to the client (for instance, using SSL to encrypt the data between the client and server) and auditing web service usage to prevent malicious access.
The checklist on Web Services Performance along with accompanying notes in the P&P guide "Improving .NET Application Performance and Scalability" contain valuable suggestions on building robust Web Services.

Comments