I’ve got a WCF Web Service method whose prototype is:
[OperationContract] Response<List<Customer>> GetCustomers();
When I add the service reference to a client, Visual Studio (2005) creates a type called ‘ResponseOfArrayOfCustomerrleXg3IC’ that is a wrapper for ‘Response<List<Customer>>’. Is there any way I can control the wrapper name? ResponseOfArrayOfCustomerrleXg3IC doesn’t sound very appealing…
You can define your own name in the
DataContractattribute like this:Note that in your example the
{0}will be replaced and your proxy reference type will beResponseOfArrayOfCustomer.More info here: WCF: Serialization and Generics