< ASP .NET, C# Web Service Program Example & IIS | Main | ASP .NET & VB .NET Web Service Program Example >

 


 

 

Chapter 11 Part 3:

XML Web Services and the Network

 

 

What do we have in this chapter 11 Part 3?

  1. Adding the Web Service Reference (proxy class)

 

 

Adding the Web Service Reference (proxy class)

 

Next, we are ready to ad the web services to resolve the references for the exposed methods. Select the project folder > Right-click mouse > Select Add Service Reference.

 

Creating and consuming the ASP .NET web service and C# console application program example: adding the ASP .NET web service to the existing C# console application

 

In the Add Service Reference page click the Advanced button.

 

Creating and consuming the ASP .NET web service and C# console application program example: the Add Service Reference page

 

In the Service Reference Settings page, click the Add Web Reference button.

 

Creating and consuming the ASP .NET web service and C# console application program example: the Service Reference Settings page

 

Remember that the web service was hosted at the local IIS web server. Select the second link: Web services on the local machine.

 

Creating and consuming the ASP .NET web service and C# console application program example: selecting and displaying the web services available on the local machine (local web site)

 

Click the Service1 link which corresponds to the web service that we need.

 

Creating and consuming the ASP .NET web service and C# console application program example: selecting the web service that we want to use

 

Just leave the web reference name to 'localhost' and click Add Reference button.

 

Creating and consuming the ASP .NET web service and C# console application program example: addding the web service reference to the existing project

 

You should see the added web service reference in the Solution Explorer.

 

Creating and consuming the ASP .NET web service and C# console application program example: the added web service reference seen in the Visual Studio Solution Explorer

 

Build the project and make sure there in no error.

 

Creating and consuming the ASP .NET web service and C# console application program example: building a solution

 

Run the project without debugging.

 

Creating and consuming the ASP .NET web service and C# console application program example: running VS solution/project without debugging

 

Key-in the X and Y values to be added. Confirm the result of addition operation is correct.

 

Creating and consuming the ASP .NET web service and C# console application program example: testing the C# console application which request  ASP .NET web services

 

 

 


< ASP .NET, C# Web Service Program Example & IIS | Main | ASP .NET & VB .NET Web Service Program Example >