The Setup
I want to consume a web service in Visual Studio. I added a service reference, pointing it at a WSDL document. I get a bunch of generated code that works like a champ.
The Problem
In the Service Reference dialog, I selected "Internal" as the "Access level for generated classes." It appears as though that puts the "internal" keyword in front of the WhateverSoapClient class. Groovy. However, the generated model classes are all preceded by the "public partial" keywords. The "partial" part is fine (even desired), but not so the public. I want these classes to be internal as well.
The Solution?
Surely Visual Studio (svcutil.exe?) is making use of a template to generate Reference.cs, right? Is there any way to change that template, or specify an alternate? Or am I barking up the wrong tree?
Thanks!
Disclaimer: I'm a real n00b in this area, so the likelihood of getting this question phrased correctly is low.
Edit: In response to Tuzo's comment, I'm connecting Visual Studio to the following:
VS generates an internal class called CatalystEcommerceWebserviceSoapClient, which has a method called Catalogue_Retrieve(). Catalogue_Retrieve() returns a Catalogue object, and Visual Studio is generating the Catalogue class as "public partial". I want it to be internal.
Here are some snippets of what is getting generated:
internal partial class CatalystEcommerceWebsierviceSoapClient : System.ServiceModel.ClientBase<BcApi.EcommerceApi.CatalystEcommerceWebserviceSoap>, BcApi.EcommerceApi.CatalystEcommerceWebserviceSoap {
public BcApi.EcommerceApi.Catalogue Catalogue_Retrieve(...) {
// ...
}
}
public partial class Catalogue : object, System.ComponentModel.INotifyPropertyChanged {
// ...
}
And in response to Jamie, I'm familiar with T4 templates thanks to SubSonic. So I did already dig around a little bit for some a T4-related answer to this problem. I could probably dig a little more, though. Thanks for the tip.