Consuming a Web Service Synchronously

In this section, you'll create a standard synchronous Web Service consumer. You'll also investigate how the proxy class makes it look like you're working with a local object and its methods when you make method calls in the Web Service.

The Sample Web Service

For this example, you'll modify the InventoryService Web Service you created in the previous chapter. This service provides a simple UnitsInStock method, which returns the available inventory for a product matching the ProductID value your method call supplies. In the following steps, you'll add code that causes the method to delay 10 seconds before returning its value to simulate the behavior of a Web Service that takes measurable time to do its work. ...

Get ASP.NET Developer's JumpStart now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.