求解答,刚接触C#,这里有个.net 6.0 的项目添加了个服务引用,这个服务引用用的是.framework 4.0,已经配置好了,但是客户端调用方法的时候服务端没有反应,也没有报错信息,代码是这样的:
public System.Threading.Tasks.Task SetAccountAsync(string account,string zkbh)
{
return base.Channel.SetAccountAsync(account, zkbh);
}
private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
{
if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_ICalculator))
{
System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
result.MaxBufferSize = int.MaxValue;
result.MessageEncoding = System.ServiceModel.WSMessageEncoding.Mtom;
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
return result;
}
throw new System.InvalidOperationException(string.Format("找不到名称为“{0}”的终结点。", endpointConfiguration));
}
客户端的调用
ServiceReference.UpdateServiceClient client = new ServiceReference.UpdateServiceClient ();
client.SetAccountAsync(Passbook,zkhb);
应该怎么查错,用http发送请求的话应该怎么写