Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

20: Web Services > Implementing a Windows Client

Implementing a Windows Client

The test is working, but you want to create a Windows client that uses the Web service. The client must create a SOAP message that will be sent across an HTTP channel. It is not necessary to make this message ourselves. The System.Web.Services.Protocols.SoapHttpClientProtocol class does all the work behind the scenes.

Try It Out Creating a Client Windows Application

  1. Create a new C# Windows Application, call it SimpleClient, and add two text boxes and a button to the form (see Figure 20-12). You will use the button's Click handler to invoke the Web service.

    images

    Figure 20-12

  2. Add a Web reference using the Project images Add Web Reference... menu and enter the URL of the Web service that was just generated. Then, you can view the contract and documentation. Before pressing the Add Reference button, change the Web reference name to WebServicesSample, as shown in Figure 20-13.

    images

    Figure 20-13


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint