Cisco Support Community
Community Member

Error while consuming Finesse API

I am getting following error while consuming Finesse API used to login the agent.

EXCEPTION  : The underlying connection was closed: An unexpected error occurred on a send. Inner Exception: Received an unexpected EOF or 0 bytes from the transport stream. 

When tried to access the same URL using fiddler, we are getting following exception:

-= Fiddler Event Log =-> HTTPS handshake to finesse-wb-tr01.ccvp1.private (for #1) failed. System.IO.IOException Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. < An existing connection was forcibly closed by the remote host

I have created a  Console Application and tried following code to call web API.

string m_strAuth = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes("AgentId:PWD"));
byte[] dataBytes = Encoding.UTF8.GetBytes("<User><state>LOGIN</state><extension>8110001</extension></User>");
var request = new RestRequest(Method.PUT);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
request.AddHeader("authorization", string.Format("Basic {0}", m_strAuth)); ;
request.AddParameter("application/XML", Xml, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

I also tried calling the service using HttpRequest but getting same error.

Please Note: I am able to access the same API from IE. 

CreatePlease to create content