![](/images/new-backgrounds/1175219/175219713x1.webp)
334Microsoft Visual Studio 2010: A Beginner’s Guide
This example shows that the proxy will translate the results into a List<Customer> (List(Of Customer) in VB). While I showed you how to make this setting after creating the Web service, I chose this sequence because it shows the value of changing the collection return type. However, you can make this setting when first creating the Web reference. Looking at Figure
Now, you’ve seen all five operations of the Web service. Remember that exactly the same techniques are used here as in any other type of .NET application. For your convenience, Listing
Listing 11-7 An application using a Web service
C#:
using System;
using System.Collections.Generic; using System.Linq;
using System.Text;
using CustomerConsole.CustomerService;
namespace CustomerConsole
{
class Program
{
static void Main()
{
var svc = new CustomerServiceClient();
var newCust = new Customer
{
Age = 36,
Birthday = new DateTime(1974, 8, 22), Income = 56000m,
Name = "Venus"
};
var newCustID = svc.InsertCustomer(newCust);
Console.WriteLine("New Customer ID: " + newCustID);
Customer cust = svc.GetCustomer(newCustID);