Не знаю, как удовлетворить ваши требования с помощью WSDL.
Но вы можете удалить метод, который вам не нужен, после добавления ссылки на службу через этот wsdl.
Например, после добавления ссылки у меня есть контракт на обслуживание ICalculatorService и прокси сервиса CalculatorServiceClient.
public interface ICalculatorService {
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICalculatorService/Add", ReplyAction="http://tempuri.org/ICalculatorService/AddResponse")]
double Add(double a, double b);
//[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ICalculatorService/Substract", ReplyAction="http://tempuri.org/ICalculatorService/SubstractResponse")]
//double Substract(double a, double b);
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface ICalculatorServiceChannel : consoleClient.CalculatorClient.ICalculatorService, System.ServiceModel.IClientChannel {
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class CalculatorServiceClient : System.ServiceModel.ClientBase<consoleClient.CalculatorClient.ICalculatorService>, consoleClient.CalculatorClient.ICalculatorService {
public CalculatorServiceClient() {
}
public CalculatorServiceClient(string endpointConfigurationName) :
base(endpointConfigurationName) {
}
public CalculatorServiceClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public CalculatorServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
base(endpointConfigurationName, remoteAddress) {
}
public CalculatorServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress) {
}
public double Add(double a, double b) {
return base.Channel.Add(a, b);
}
//public double Substract(double a, double b) {
// return base.Channel.Substract(a, b);
//}
}
Если мне не нужен метод Substract, я мог бы закомментировать метод Substract в ICalculatorService и CalculatorServiceClient.