Web Services client unable to connect

The most common error occurs when your Web Services client application fails to obtain a response, or you receive this error message:

Server Error in <name> Application

The underlying connection was closed: Unable to connect to the remote server

The Web Services client may be directing SOAP requests to the wrong host or to the wrong TCP port number. Service Manager generates WSDL files that contain the hostname and TCP port number for the Service Manager server instance receiving the request. The Web Services client application may use the hostname and port number used during application development, but the production hostname and port might be different each time the application runs if they are dynamically allocated.

If the server instance generating the WSDL is different from the hostname or port number receiving the client application requests, the client/server connection will fail. Follow these rules to ensure successful client/server SOAP communication.

  • Ensure that your Web Services request is not running against a common port with heavy server traffic. Otherwise, tracking request and response messages will be difficult.
  • Type the following at the command line to generate debug logs:

    sm -httpPort:unique portnumber -sslConnector:0 -debughttp:1 -log:../logs/debug.log

    where

    -httpPort identifies a dedicated port for Web Service client connections

    -log defines a path to store the logs for this connection.

    Note It is easier to troubleshoot errors if each SOAP client application connects to its own TCP port number.

  • Examine the HTTP.LOG file for response messages. You can use this information to determine where a Web Service client connection failure occurs.