Binding to a Web Service

Web services enable you to share information across the Internet. When you communicate with a remote web service, you use a local proxy class to represent the web service located on the remote machine. You can use the ObjectDataSource to represent this proxy class.

For example, the file in Listing 18.9 contains a simple web service that returns the current server time. You can create this file in Visual Web Developer by selecting Web Site, Add New Item, and selecting the Web Service item.

Listing 18.9. TimeService.asmx

images

After you create the web service in Listing 18.9, you can communicate with the service from anywhere ...

Get ASP.NET 4 Unleashed 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.