Skip to main content


 

Symptoms


I have the following sample to call into our customers K2 instance.

using System
using System.Collections.Generic
using System.Linq
using System.Text

using SourceCode.Workflow.Client
using SourceCode.Hosting.Client

namespace K2ExtranetWorkflowKickoff
{
class Program
{
static void Main(stringg] args)
{
SourceCode.Workflow.Client.Connection connection = new SourceCode.Workflow.Client.Connection()
SourceCode.Workflow.Client.ConnectionSetup conSetup = new ConnectionSetup()
conSetup.ConnectionParameterss"Authenticate"] = "true"
conSetup.ConnectionParameterss"Port"] = "5555"
conSetup.ConnectionParameterss"Host"] = "k2dev.denallix.com"
conSetup.ConnectionParameterss"Integrated"] = "true"
conSetup.ConnectionParameterss"IsPrimaryLogin"] = "true"
conSetup.ConnectionParameterss"SecurityLabelName"] = "K2"
conSetup.ConnectionParameterss"WindowsDomain"] = ""
conSetup.ConnectionParameterss"UserID"] = ""
conSetup.ConnectionParameterss"Password"] = ""
connection.Open(conSetup)
connection.Close()

}
}
}

but I get the following error : {"Send failed with error: An existing connection was forcibly closed by the remote host. "}

This is the error from the K2 Server Logs :

"34125304","2016-04-13 11:58:56","Error","Communication","8050","BadHeaderError","SourceCode.Hosting.Server.Services.TCPClientSocket.ProcessReceive","8050 Received BAD Header From {IPAddress}:16882","system","::1","K2Dev:C:Program Files (x86)K2 blackpearlHost ServerBin","34125304","c94a9afa8b034122aace9a6a9f531d53",""
 

Diagnoses


The port specified in the connection string '5555' is the Host Server port for a client connection, you will likely need port 5252 (Workflow server). As per:

https://www.k2.com/onlinehelp/k2blackpearl/devref/current/default.htm_Working_with_a_Process.html

Please note that these two ports will usually need to be opened between the K2 server if you are interacting with the Workflow.Client API or perhaps the Smartobject API:

http://help.k2.com/kb001318
 

Resolution

Changing the port to 5252 in the connection string resolved the issue.




 
Be the first to reply!

Reply