接收对Service.svc的HTTP响应时发生错误。 这可能是由于服务端点绑定不使用HTTP 协议。这也可能是由于HTTP请求上下文所致 由服务器中止(可能是由于服务关闭)。
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IRemoteService" />
<binding name="BasicHttpBinding_IRemoteService1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://192.168.1.104/fin_vyshakh/RemoteService/RemoteService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRemoteService"
contract="RemoteLoanServiceReference.IRemoteService" name="BasicHttpBinding_IRemoteService" />
<endpoint address="http://192.168.1.105/fin_vyshakh/RemoteService/RemoteService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRemoteService1"
contract="RemoteDepositServiceReference.IRemoteService" name="BasicHttpBinding_IRemoteService1" />
</client>
在背后的代码中。
RemoteDepositServiceReference.RemoteServiceClient client = new RemoteDepositServiceReference.RemoteServiceClient();
string result= client.CallFunction("abc");
client.Close();