请帮我解决以下错误:使用客户端代码
使用服务时抛出异常异常详细信息:System.Net.WebException:远程服务器返回错误:(405)Method Not Allowed。
using (var customerCreditService = new CustomerCreditServiceClient())
{
var creditLimit = customerCreditService.GetCreditLimit(customer.Firstname,
customer.Surname, customer.DateOfBirth);
(**Exception thrown while calling this method**)
}
错误消息:远程服务器返回了意外响应:(405)方法不允许。
堆栈跟踪:服务器堆栈跟踪: at> System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request,HttpWebResponse response,HttpChannelFactory
1 factory, WebException responseException, ChannelBinding channelBinding) at System.ServiceModel.Channels.HttpChannelFactory
1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 在System.ServiceModel.Channels.RequestChannel.Request(消息消息,TimeSpan超时) 在System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息消息,TimeSpan超时) 在System.ServiceModel.Channels.ServiceChannel.Call(String action,Boolean oneway,ProxyOperationRuntime operation,Object [] ins,Object [] outs,TimeSpan timeout) 在System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime操作) 在System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)在[0]处重新抛出异常: 在System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg) 在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,Int32 type) at App.ICustomerCreditService.GetCreditLimit(String firstname,String surname,DateTime dateOfBirth) at App.CustomerCreditServiceClient.GetCreditLimit(String firstname,String surname,DateTime dateOfBirth)in \ App \ CustomerCreditService.cs:第53行 在App.Customer.doCreditCheck(客户客户)中 \ App \ Customer.cs:第36行 位于\ App \ SilverCustomer.cs的App.SilverCustomer.doCreditCheck(客户客户):第14行 位于\ App \ App \ CustomerService.cs中的App.CustomerService.AddCustomer(客户客户):第64行 在App.Tests.CustomerUnitTests.AddCustomer_DoCreditCheck_ForSilver()在\ App.Tests \ CustomerUnitTests.cs:第74行