I am receiving randomly (Not always) "An error occurred while receiving the HTTP response to.." when calling SOAP API from client. It does not happen every time. My application itself is a WCF service.
Client Config:
<binding name="AbcBinding"
sendTimeout="00:02:45"
closeTimeout="00:02:45"
openTimeout="00:02:45"
receiveTimeout="00:10:00"
bypassProxyOnLocal="false"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<security mode="Transport" >
<transport clientCredentialType="Basic" />
</security>
</binding>
<client>
<endpoint binding="basicHttpBinding" bindingConfiguration="AbcBinding"
contract="AbcContract" name="AbcBinding" />
</client>
Code:
var configFactory = new ConfigurationChannelFactory<AbcContract>("AbcBinding"), ConfigFile, "localhost:9198/AbcCall");
#region Basic http authentication
if (configFactory.Credentials != null)
{
var defaultCredentials = configFactory.Endpoint.Behaviors.Find<ClientCredentials>();
configFactory.Endpoint.Behaviors.Remove(defaultCredentials);
var loginCredentials = new ClientCredentials();
loginCredentials.UserName.UserName = "UserName";
loginCredentials.UserName.Password = "Password";
configFactory.Endpoint.Behaviors.Add(loginCredentials);
}
EDIT
On local environment, it is working fine with following configuration: useDefaultWebProxy="false" proxyAddress="http://127.0.0.1:8888"
But on deployment server I am getting following error with above configuration:
There was no endpoint listening at ... that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
"An error occurred while receiving the HTTP response .." This error can occur when there something breaks in your service code.
Recheck the service code.
Try enabling svclog in client and server. The trace log can give some idea
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With