locked
Error : "Unable to connect remote server" web service RRS feed

  • Question

  • User1951874821 posted

    Hi

    Some times my Windows application can not able to connect web service in production environment but i can connect through browser. 

    if you have a solution please suggest me.

    Detailed exception : 

    Unable to connect to the remote server----->   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
       at System.Net.HttpWebRequest.GetRequestStream()
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

    Thanks in Advance!!

    Monday, February 24, 2020 7:33 AM

All replies

  • User475983607 posted

    The usual cause is not cleaning up connections on the client.

    Monday, February 24, 2020 12:20 PM
  • User1951874821 posted

    Hi,

    Usually use object inside the "Using statement". So explicitly no need of clearing up the connections. Do you any other suggestions?

    Monday, February 24, 2020 12:27 PM
  • User475983607 posted

    Usually use object inside the "Using statement". So explicitly no need of clearing up the connections. Do you any other suggestions?

    Keep in mind, the community cannot see your code.  The usually problem is not handing connections properly on client and the client uses up all the connections.

    You'll need to debug the application.  You can use a stress test and add logging.   If you want a community code review then we'll need your source code.  

    Monday, February 24, 2020 12:39 PM
  • User1951874821 posted

    Hi Thanks!

    The issue is not replicating in Dev env , its in production. Client environment uses Network Load Balance to handle heavy load. The issue is because of heavy load?

    Tuesday, February 25, 2020 2:51 AM
  • User475983607 posted

    The issue is not replicating in Dev env , its in production. Client environment uses Network Load Balance to handle heavy load. The issue is because of heavy load?

    Everyone says it works in dev...

    You have to realize that the community cannot see your code or reproduce this issue..  Is is up to you to troubleshoot.

    Tuesday, February 25, 2020 12:16 PM
  • User1951874821 posted

    Hi 

    can you please help me to know, whether do we need to install SSl certificate to connect web service from the Desktop application if web service is from https?

    Wednesday, February 26, 2020 7:34 AM
  • User475983607 posted

    N J Pradeep

    Hi 

    can you please help me to know, whether do we need to install SSl certificate to connect web service from the Desktop application if web service is from https?

    If the service is running under SSL then it already has a certificate.  If the certificate is self signed, not purchased from a certificate authority, then your client application will fail when connecting due to validation error.  Usually the exception is very specific when this happens.  

    You'll need to troubleshoot your application.  Post your code if you want a community code review.

    Wednesday, February 26, 2020 11:42 AM
  • User-330142929 posted

    Hi 

    can you please help me to know, whether do we need to install SSl certificate to connect web service from the Desktop application if web service is from https?

    You might need to install an SSL certificate on the client-side before calling the remote service. This is due to that Https communication requires that the remote server is trusted. We need to determine whether the server is the expected one. If the certificate is a self-signed certificate, not purchased from others, we need to install the server certificate on the client-side so as to validate the server. If it is purchased, the root certificate of that is usually on-built in OS/Browser. namely, we needn't.
    Best Regards
    Abraham

    Thursday, February 27, 2020 8:44 AM
  • User1951874821 posted

    Thanks Abraham

    Thursday, February 27, 2020 9:21 AM