AnsweredAssumed Answered

Unable to create a session - connection forcibly closed by the remote host error?

Question asked by tbone7281 on Jul 18, 2017
Latest reply on Jul 20, 2017 by afaust

Alfresco 4.2.0

CMIS 1.1

 

I'm creating a web service using Port CMIS to connect to Alfresco via browser binding.  Long story short, I am unable to even really begin because I can't successfully create a session.  It seems like it should be fairly straightforward, but here we are...

 

(Inner Exceptions)

HttpRequestException:  An error occurred while sending the request.

WebException:  The underlying connection was closed:  An unexpected error occurred on a send.

IOException:  Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

SocketException:  An existing connection was forcibly closed by the remote host.

 

I've dumbed it down a bit, but this is basically the code I I'm trying to run.  There's really not much to it:

 

private static void TestConnectToAlfresco()
{
// default factory implementation
SessionFactory factory = SessionFactory.NewInstance();

Dictionary<string, string> parameters = new Dictionary<string, string>();

// user credentials
parameters[SessionParameter.User] = Utils.GetAppSetting("ALFRESCO_USER");
parameters[SessionParameter.Password] = Utils.GetAppSetting("ALFRESCO_PASS");

// connection settings
parameters[SessionParameter.BrowserUrl] = Utils.GetAppSetting("WebURL");
parameters[SessionParameter.BindingType] = BindingType.Browser;

//create session
IList<IRepository> repos = factory.GetRepositories(parameters);
foreach (IRepository repo in repos)
{
System.Diagnostics.Debug.WriteLine("Repository Name: " + repo.Name + " RepositoryID: " + repo.Id);
}

ISession session = factory.GetRepositories(parameters)[0].CreateSession();

}

 

For a while, I thought maybe I was just using an incorrect URL (which is still possible), but I feel like I've tried every iteration of URL suggestion I've seen.  Pretty much always the same error.  I KNOW the credentials are good, because I can get into the Alfresco UI (or to the API) through a web browser using them.

 

URLs tried:

https://alfresco-test0.mycompany.com/share

https://alfresco-test0.mycompany.com/share/cmis/browser

https://alfresco-test0.mycompany.com/alfresco/api/-default-/public/cmis/versions/1.1/browser

 

I'm not specifying a port because it's currently just the default, but I did try explicitly specifying one for a while, but it seemed to have no effect.  Any thoughts?  Please ask if I've left out any information that might be helpful.  TIA.

 

-Tony

Outcomes