What happened to 'nice' generated class names in .NET for web services?

1.7k views Asked by At

I am using .NET 3.5 to call a FedEx web service.

In Fedex's sample code (VS2005) it has things like:

AddressValidationService addressValidationService = new AddressValidationService();
AddressValidationReply reply = addressValidationService.addressValidation(request);

This is nice. I like that. I'm calling a method on a 'Service'.

but in .NET 3.5 I get this generated from the same WSDL:

AddressValidationPortTypeClient addressValidationService = new AddressValidationPortTypeClient();
AddressValidationReply reply = addressValidationService.addressValidation(request);

What is all this 'PortTypeClient' *#&$. I am quite happy with progress, but this just seems a little crazy. I dont know what it means.

Is there any documentation that tells me what changed and why?

1

There are 1 answers

2
Marc Gravell On

What tool are you using? wsdl.exe? or svcutil.exe? If you are adding a "service reference", then that is WCF, so svcutil.exe is used - this names things as clients. There is, however, still the option to use the old wsdl.exe tool. In the IDE you do this via "Advanced..." -> "Add Web Reference..." - this will generate a 2.0 style service proxy.

Re the names; WCF is correct - the proxy class is a client, not a service.