Using Web Services: Best Practices

  • Ensure that the connection between web service and web server is asynchronous. This means that the web application does not need to stop its processes until the web server responds to its request.

  • Minimize the number of requests that an application needs to send to a web server to consume a web service. Send as much information as can be sent. This will ensure network traffic is cut to a minimum by decreasing the number of requests.

  • Ensure the web service is created using the concepts of object oriented programming. Create once use many times. This also should create a standard of information used.

  • Minimize time of response by using cache. This will ensure that every time the web service is called upon, the web service is not run, the cache will be used. You can set the time in which the cache can be refreshed so to catch any updates that may happen.

Using Web Services: Part 1

In order to use web services in .NET you must first import the following namespaces at the top of your code behind at a minimum:

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols