You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Lu, Wentao" <We...@bchydro.com> on 2014/09/22 22:35:16 UTC

DotCMIS create document failed with "The socket connection was aborted"

Hi,

We are testing DotCMIS with Web Service binding (atompub works fine so far, but in some use cases we have to use web service binding).

We get below exceptions with createDocument function, the sample "test.zip" file is only 400KB.

{"Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host."}

StackTrace as below

      at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
   at System.Net.Security._SslStream.StartWriting(SplitWritesState splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
   at System.Net.TlsStream.MultipleWrite(BufferOffsetSize[] buffers)
   at System.Net.PooledStream.MultipleWrite(BufferOffsetSize[] buffers)
   at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.ServiceModel.Channels.BytesReadPositionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.WebRequestOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)

Here is our sample code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DotCMIS;
using DotCMIS.Client;
using DotCMIS.Client.Impl;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters[SessionParameter.BindingType] = BindingType.WebServices;
            String host = "myhost";

            parameters[DotCMIS.SessionParameter.WebServicesRepositoryService] = "https://"+host+":7010/cmis/services101/RepositoryService";

            parameters[DotCMIS.SessionParameter.WebServicesAclService] = "https://"+host+":7010/cmis/services101/ACLService";

            parameters[DotCMIS.SessionParameter.WebServicesDiscoveryService] = "https://"+host+":7010/cmis/services101/DiscoveryService";

            parameters[DotCMIS.SessionParameter.WebServicesMultifilingService] = "https://"+host+":7010/cmis/services101/MultiFilingService";

            parameters[DotCMIS.SessionParameter.WebServicesNavigationService] = "https://"+host+":7010/cmis/services101/NavigationService";

            parameters[DotCMIS.SessionParameter.WebServicesObjectService] = "https://"+host+":7010/cmis/services101/ObjectService";

            parameters[DotCMIS.SessionParameter.WebServicesPolicyService] = "https://"+host+":7010/cmis/services101/PolicyService";

            parameters[DotCMIS.SessionParameter.WebServicesRelationshipService] = "https://"+host+":7010/cmis/services101/RelationshipService";

            parameters[DotCMIS.SessionParameter.WebServicesVersioningService] = "https://"+host+":7010/cmis/services101/VersioningService";

            parameters[DotCMIS.SessionParameter.WebServicesEnableUnsecuredResponse] = "true";

            parameters[SessionParameter.User] = "admin";
            parameters[SessionParameter.Password] = "password";
            parameters[SessionParameter.RepositoryId] = "RepositoryOS1";
            parameters[SessionParameter.ConnectTimeout] = "-1";

            SessionFactory factory = SessionFactory.NewInstance();
            ISession session = factory.CreateSession(parameters);

            IDictionary<string, object> properties = new Dictionary<string, object>();
            properties[PropertyIds.Name] = "Hello World Document";
            properties[PropertyIds.ObjectTypeId] = "Document";

            byte[] content = UTF8Encoding.UTF8.GetBytes("Hello World!");

            System.IO.FileInfo fileinfo = new System.IO.FileInfo("C:\\test\\test.zip");

            DotCMIS.Data.Impl.ContentStream contentStream = new DotCMIS.Data.Impl.ContentStream();
            contentStream.FileName = fileinfo.Name;
            contentStream.MimeType = "application/zip";
            contentStream.Length = fileinfo.Length;
            contentStream.Stream = fileinfo.OpenRead();

            IFolder myFolder = (IFolder)session.GetObjectByPath("/temp");

            IDocument myDoc1 = myFolder.CreateDocument(properties, contentStream, DotCMIS.Enums.VersioningState.Major);

        }

    }
}

Any ideas what could be the issue?

Thanks
Wentao



________________________________
This email and its attachments are intended solely for the personal use of the individual or entity named above. Any use of this communication by an unintended recipient is strictly prohibited. If you have received this email in error, any publication, use, reproduction, disclosure or dissemination of its contents is strictly prohibited. Please immediately delete this message and its attachments from your computer and servers. We would also appreciate if you would contact us by a collect call or return email to notify us of this error. Thank you for your cooperation.
-BCHydroDisclaimerID5.2.8.1541

RE: DotCMIS create document failed with "The socket connection was aborted"

Posted by "Lu, Wentao" <We...@bchydro.com>.
Hi Florian,

After some digging, looks like it is the web proxy issue, without the proxy, the code works. We'll contact vendor to fix it. 

By the way, I think I find a bug in DotCMIS 0.6 and has raised a JIRA CMIS-850 (https://issues.apache.org/jira/browse/CMIS-850).  

Thanks
Wentao

-----Original Message-----
From: Lu, Wentao 
Sent: 2014, September 29 9:32 AM
To: 'Florian Müller'
Cc: dev@chemistry.apache.org
Subject: RE: DotCMIS create document failed with "The socket connection was aborted"

Thanks Florian.

We have not go through all web services binding functions yet, we use IBM CMIS for FileNet, do you know if there are any known issues for using DotCMIS against it?

I am trying to convince other team members to use atompub....  :-)

Regards,
Wentao

-----Original Message-----
From: Florian Müller [mailto:fmui@apache.org]
Sent: 2014, September 28 3:30 AM
To: Lu, Wentao
Cc: dev@chemistry.apache.org
Subject: Re: DotCMIS create document failed with "The socket connection was aborted"

Hi Wentao,

Some older SOAP stacks and stacks that don't handle MTOM correctly don't work with DotCMIS.
Do you have specific repository or SOAP stack that doesn't work for you?

Btw. You should avoid the Web Services binding if you can...


- Florian


> Hi Florian,
> 
> From readme file https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk/README it said " Not all CMIS Web Services endpoints are compatible with the .NET framework for a number of reasons",  do you have a list which endpoints are not compatible?
> 
> 
> Thanks
> Wentao
> 
> -----Original Message-----
> From: Florian Müller [mailto:fmui@apache.org]
> Sent: 2014, September 22 1:43 PM
> To: dev@chemistry.apache.org
> Cc: Lu, Wentao
> Subject: Re: DotCMIS create document failed with "The socket connection was aborted"
> 
> Hi Wentao,
> 
> Check your server and network setup. Some Web Services stacks (for example .Net) have (configurable) limits.
> There is nothing the client can do if the server closes the connection.
> 
> 
> - Florian
> 
> 
>> Hi,
>>
>> We are testing DotCMIS with Web Service binding (atompub works fine so far, but in some use cases we have to use web service binding).
>>
>> We get below exceptions with createDocument function, the sample "test.zip" file is only 400KB.
>>
>> {"Unable to write data to the transport connection: An existing 
>> connection was forcibly closed by the remote host."}
>>
>> StackTrace as below
>>
>>       at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
>>    at System.Net.Security._SslStream.StartWriting(SplitWritesState splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)
>>    at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
>>    at System.Net.TlsStream.MultipleWrite(BufferOffsetSize[] buffers)
>>    at System.Net.PooledStream.MultipleWrite(BufferOffsetSize[] buffers)
>>    at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
>>    at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
>>    at System.ServiceModel.Channels.BytesReadPositionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
>>    at
>> System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.WebReque
>> s tOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
>>
>> Here is our sample code:
>> using System;
>> using System.Collections.Generic;
>> using System.Linq;
>> using System.Text;
>> using DotCMIS;
>> using DotCMIS.Client;
>> using DotCMIS.Client.Impl;
>>
>> namespace ConsoleApplication1
>> {
>>     class Program
>>     {
>>         static void Main(string[] args)
>>         {
>>             
>> System.Net.ServicePointManager.ServerCertificateValidationCallback = 
>> delegate { return true; };
>>
>>             Dictionary<string, string> parameters = new Dictionary<string, string>();
>>             parameters[SessionParameter.BindingType] = BindingType.WebServices;
>>             String host = "myhost";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesRepositoryService] = 
>> "https://"+host+":7010/cmis/services101/RepositoryService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesAclService]
>> = "https://"+host+":7010/cmis/services101/ACLService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesDiscoveryService] = 
>> "https://"+host+":7010/cmis/services101/DiscoveryService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesMultifilingService] = 
>> "https://"+host+":7010/cmis/services101/MultiFilingService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesNavigationService] = 
>> "https://"+host+":7010/cmis/services101/NavigationService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesObjectService] = 
>> "https://"+host+":7010/cmis/services101/ObjectService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesPolicyService] = 
>> "https://"+host+":7010/cmis/services101/PolicyService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesRelationshipService] = 
>> "https://"+host+":7010/cmis/services101/RelationshipService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesVersioningService] = 
>> "https://"+host+":7010/cmis/services101/VersioningService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesEnableUnsecuredRespons
>> e
>> ] = "true";
>>
>>             parameters[SessionParameter.User] = "admin";
>>             parameters[SessionParameter.Password] = "password";
>>             parameters[SessionParameter.RepositoryId] = "RepositoryOS1";
>>             parameters[SessionParameter.ConnectTimeout] = "-1";
>>
>>             SessionFactory factory = SessionFactory.NewInstance();
>>             ISession session = factory.CreateSession(parameters);
>>
>>             IDictionary<string, object> properties = new Dictionary<string, object>();
>>             properties[PropertyIds.Name] = "Hello World Document";
>>             properties[PropertyIds.ObjectTypeId] = "Document";
>>
>>             byte[] content = UTF8Encoding.UTF8.GetBytes("Hello 
>> World!");
>>
>>             System.IO.FileInfo fileinfo = new 
>> System.IO.FileInfo("C:\\test\\test.zip");
>>
>>             DotCMIS.Data.Impl.ContentStream contentStream = new DotCMIS.Data.Impl.ContentStream();
>>             contentStream.FileName = fileinfo.Name;
>>             contentStream.MimeType = "application/zip";
>>             contentStream.Length = fileinfo.Length;
>>             contentStream.Stream = fileinfo.OpenRead();
>>
>>             IFolder myFolder =
>> (IFolder)session.GetObjectByPath("/temp");
>>
>>             IDocument myDoc1 = myFolder.CreateDocument(properties,
>> contentStream, DotCMIS.Enums.VersioningState.Major);
>>
>>         }
>>
>>     }
>> }
>>
>> Any ideas what could be the issue?
>>
>> Thanks
>> Wentao
>>
>>
>>
>> ________________________________
>> This email and its attachments are intended solely for the personal use of the individual or entity named above. Any use of this communication by an unintended recipient is strictly prohibited. If you have received this email in error, any publication, use, reproduction, disclosure or dissemination of its contents is strictly prohibited. Please immediately delete this message and its attachments from your computer and servers. We would also appreciate if you would contact us by a collect call or return email to notify us of this error. Thank you for your cooperation.
>> -BCHydroDisclaimerID5.2.8.1541
>>

RE: DotCMIS create document failed with "The socket connection was aborted"

Posted by Jay Brown <ja...@us.ibm.com>.
We do all our internal testing with OpenCMIS but if there is a
compatibility issue that exists with one of the other Apache Chemistry
libraries because of a defect in our code we would certainly like to know
about this so we can fix it (assuming it is possible based on the underling
SOAP libraries that we use).

If you cannot use the preferred binding (Atompub) I suggest you open a
support ticked with IBM so that resources can be assigned to this.

Thanks.

Jay Brown
Senior Engineer, ECM Development
IBM Software Group



|------------>
| From:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |"Lu, Wentao" <We...@bchydro.com>                                                                                                              |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Florian Müller <fm...@apache.org>                                                                                                                  |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Cc:        |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |"dev@chemistry.apache.org" <de...@chemistry.apache.org>                                                                                             |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |09/29/2014 09:32 AM                                                                                                                               |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |RE: DotCMIS create document failed with "The socket connection was aborted"                                                                       |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|





Thanks Florian.

We have not go through all web services binding functions yet, we use IBM
CMIS for FileNet, do you know if there are any known issues for using
DotCMIS against it?

I am trying to convince other team members to use atompub....  :-)

Regards,
Wentao

-----Original Message-----
From: Florian Müller [mailto:fmui@apache.org]
Sent: 2014, September 28 3:30 AM
To: Lu, Wentao
Cc: dev@chemistry.apache.org
Subject: Re: DotCMIS create document failed with "The socket connection was
aborted"

Hi Wentao,

Some older SOAP stacks and stacks that don't handle MTOM correctly don't
work with DotCMIS.
Do you have specific repository or SOAP stack that doesn't work for you?

Btw. You should avoid the Web Services binding if you can...


- Florian


> Hi Florian,
>
> From readme file
https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk/README it said "
Not all CMIS Web Services endpoints are compatible with the .NET framework
for a number of reasons",  do you have a list which endpoints are not
compatible?
>
>
> Thanks
> Wentao
>
> -----Original Message-----
> From: Florian Müller [mailto:fmui@apache.org]
> Sent: 2014, September 22 1:43 PM
> To: dev@chemistry.apache.org
> Cc: Lu, Wentao
> Subject: Re: DotCMIS create document failed with "The socket connection
was aborted"
>
> Hi Wentao,
>
> Check your server and network setup. Some Web Services stacks (for
example .Net) have (configurable) limits.
> There is nothing the client can do if the server closes the connection.
>
>
> - Florian
>
>
>> Hi,
>>
>> We are testing DotCMIS with Web Service binding (atompub works fine so
far, but in some use cases we have to use web service binding).
>>
>> We get below exceptions with createDocument function, the sample
"test.zip" file is only 400KB.
>>
>> {"Unable to write data to the transport connection: An existing
>> connection was forcibly closed by the remote host."}
>>
>> StackTrace as below
>>
>>       at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize
[] buffers)
>>    at System.Net.Security._SslStream.StartWriting(SplitWritesState
splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)
>>    at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[]
buffers, SplitWriteAsyncProtocolRequest asyncRequest)
>>    at System.Net.TlsStream.MultipleWrite(BufferOffsetSize[] buffers)
>>    at System.Net.PooledStream.MultipleWrite(BufferOffsetSize[] buffers)
>>    at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[]
buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
>>    at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32
size)
>>    at System.ServiceModel.Channels.BytesReadPositionStream.Write(Byte[]
buffer, Int32 offset, Int32 count)
>>    at
>> System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.WebReque
>> s tOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
>>
>> Here is our sample code:
>> using System;
>> using System.Collections.Generic;
>> using System.Linq;
>> using System.Text;
>> using DotCMIS;
>> using DotCMIS.Client;
>> using DotCMIS.Client.Impl;
>>
>> namespace ConsoleApplication1
>> {
>>     class Program
>>     {
>>         static void Main(string[] args)
>>         {
>>
>> System.Net.ServicePointManager.ServerCertificateValidationCallback =
>> delegate { return true; };
>>
>>             Dictionary<string, string> parameters = new
Dictionary<string, string>();
>>             parameters[SessionParameter.BindingType] =
BindingType.WebServices;
>>             String host = "myhost";
>>
>>
>> parameters[DotCMIS.SessionParameter.WebServicesRepositoryService] =
>> "https://"+host+":7010/cmis/services101/RepositoryService";
>>
>>
>> parameters[DotCMIS.SessionParameter.WebServicesAclService]
>> = "https://"+host+":7010/cmis/services101/ACLService";
>>
>>
>> parameters[DotCMIS.SessionParameter.WebServicesDiscoveryService] =
>> "https://"+host+":7010/cmis/services101/DiscoveryService";
>>
>>
>> parameters[DotCMIS.SessionParameter.WebServicesMultifilingService] =
>> "https://"+host+":7010/cmis/services101/MultiFilingService";
>>
>>
>> parameters[DotCMIS.SessionParameter.WebServicesNavigationService] =
>> "https://"+host+":7010/cmis/services101/NavigationService";
>>
>>
>> parameters[DotCMIS.SessionParameter.WebServicesObjectService] =
>> "https://"+host+":7010/cmis/services101/ObjectService";
>>
>>
>> parameters[DotCMIS.SessionParameter.WebServicesPolicyService] =
>> "https://"+host+":7010/cmis/services101/PolicyService";
>>
>>
>> parameters[DotCMIS.SessionParameter.WebServicesRelationshipService] =
>> "https://"+host+":7010/cmis/services101/RelationshipService";
>>
>>
>> parameters[DotCMIS.SessionParameter.WebServicesVersioningService] =
>> "https://"+host+":7010/cmis/services101/VersioningService";
>>
>>
>> parameters[DotCMIS.SessionParameter.WebServicesEnableUnsecuredRespons
>> e
>> ] = "true";
>>
>>             parameters[SessionParameter.User] = "admin";
>>             parameters[SessionParameter.Password] = "password";
>>             parameters[SessionParameter.RepositoryId] = "RepositoryOS1";
>>             parameters[SessionParameter.ConnectTimeout] = "-1";
>>
>>             SessionFactory factory = SessionFactory.NewInstance();
>>             ISession session = factory.CreateSession(parameters);
>>
>>             IDictionary<string, object> properties = new
Dictionary<string, object>();
>>             properties[PropertyIds.Name] = "Hello World Document";
>>             properties[PropertyIds.ObjectTypeId] = "Document";
>>
>>             byte[] content = UTF8Encoding.UTF8.GetBytes("Hello
>> World!");
>>
>>             System.IO.FileInfo fileinfo = new
>> System.IO.FileInfo("C:\\test\\test.zip");
>>
>>             DotCMIS.Data.Impl.ContentStream contentStream = new
DotCMIS.Data.Impl.ContentStream();
>>             contentStream.FileName = fileinfo.Name;
>>             contentStream.MimeType = "application/zip";
>>             contentStream.Length = fileinfo.Length;
>>             contentStream.Stream = fileinfo.OpenRead();
>>
>>             IFolder myFolder =
>> (IFolder)session.GetObjectByPath("/temp");
>>
>>             IDocument myDoc1 = myFolder.CreateDocument(properties,
>> contentStream, DotCMIS.Enums.VersioningState.Major);
>>
>>         }
>>
>>     }
>> }
>>
>> Any ideas what could be the issue?
>>
>> Thanks
>> Wentao
>>
>>
>>
>> ________________________________
>> This email and its attachments are intended solely for the personal use
of the individual or entity named above. Any use of this communication by
an unintended recipient is strictly prohibited. If you have received this
email in error, any publication, use, reproduction, disclosure or
dissemination of its contents is strictly prohibited. Please immediately
delete this message and its attachments from your computer and servers. We
would also appreciate if you would contact us by a collect call or return
email to notify us of this error. Thank you for your cooperation.
>> -BCHydroDisclaimerID5.2.8.1541
>>



RE: DotCMIS create document failed with "The socket connection was aborted"

Posted by "Lu, Wentao" <We...@bchydro.com>.
Thanks Florian.

We have not go through all web services binding functions yet, we use IBM CMIS for FileNet, do you know if there are any known issues for using DotCMIS against it?

I am trying to convince other team members to use atompub....  :-)

Regards,
Wentao

-----Original Message-----
From: Florian Müller [mailto:fmui@apache.org] 
Sent: 2014, September 28 3:30 AM
To: Lu, Wentao
Cc: dev@chemistry.apache.org
Subject: Re: DotCMIS create document failed with "The socket connection was aborted"

Hi Wentao,

Some older SOAP stacks and stacks that don't handle MTOM correctly don't work with DotCMIS.
Do you have specific repository or SOAP stack that doesn't work for you?

Btw. You should avoid the Web Services binding if you can...


- Florian


> Hi Florian,
> 
> From readme file https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk/README it said " Not all CMIS Web Services endpoints are compatible with the .NET framework for a number of reasons",  do you have a list which endpoints are not compatible?
> 
> 
> Thanks
> Wentao
> 
> -----Original Message-----
> From: Florian Müller [mailto:fmui@apache.org]
> Sent: 2014, September 22 1:43 PM
> To: dev@chemistry.apache.org
> Cc: Lu, Wentao
> Subject: Re: DotCMIS create document failed with "The socket connection was aborted"
> 
> Hi Wentao,
> 
> Check your server and network setup. Some Web Services stacks (for example .Net) have (configurable) limits.
> There is nothing the client can do if the server closes the connection.
> 
> 
> - Florian
> 
> 
>> Hi,
>>
>> We are testing DotCMIS with Web Service binding (atompub works fine so far, but in some use cases we have to use web service binding).
>>
>> We get below exceptions with createDocument function, the sample "test.zip" file is only 400KB.
>>
>> {"Unable to write data to the transport connection: An existing 
>> connection was forcibly closed by the remote host."}
>>
>> StackTrace as below
>>
>>       at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
>>    at System.Net.Security._SslStream.StartWriting(SplitWritesState splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)
>>    at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
>>    at System.Net.TlsStream.MultipleWrite(BufferOffsetSize[] buffers)
>>    at System.Net.PooledStream.MultipleWrite(BufferOffsetSize[] buffers)
>>    at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
>>    at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
>>    at System.ServiceModel.Channels.BytesReadPositionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
>>    at
>> System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.WebReque
>> s tOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
>>
>> Here is our sample code:
>> using System;
>> using System.Collections.Generic;
>> using System.Linq;
>> using System.Text;
>> using DotCMIS;
>> using DotCMIS.Client;
>> using DotCMIS.Client.Impl;
>>
>> namespace ConsoleApplication1
>> {
>>     class Program
>>     {
>>         static void Main(string[] args)
>>         {
>>             
>> System.Net.ServicePointManager.ServerCertificateValidationCallback = 
>> delegate { return true; };
>>
>>             Dictionary<string, string> parameters = new Dictionary<string, string>();
>>             parameters[SessionParameter.BindingType] = BindingType.WebServices;
>>             String host = "myhost";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesRepositoryService] = 
>> "https://"+host+":7010/cmis/services101/RepositoryService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesAclService]
>> = "https://"+host+":7010/cmis/services101/ACLService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesDiscoveryService] = 
>> "https://"+host+":7010/cmis/services101/DiscoveryService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesMultifilingService] = 
>> "https://"+host+":7010/cmis/services101/MultiFilingService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesNavigationService] = 
>> "https://"+host+":7010/cmis/services101/NavigationService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesObjectService] = 
>> "https://"+host+":7010/cmis/services101/ObjectService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesPolicyService] = 
>> "https://"+host+":7010/cmis/services101/PolicyService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesRelationshipService] = 
>> "https://"+host+":7010/cmis/services101/RelationshipService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesVersioningService] = 
>> "https://"+host+":7010/cmis/services101/VersioningService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesEnableUnsecuredRespons
>> e
>> ] = "true";
>>
>>             parameters[SessionParameter.User] = "admin";
>>             parameters[SessionParameter.Password] = "password";
>>             parameters[SessionParameter.RepositoryId] = "RepositoryOS1";
>>             parameters[SessionParameter.ConnectTimeout] = "-1";
>>
>>             SessionFactory factory = SessionFactory.NewInstance();
>>             ISession session = factory.CreateSession(parameters);
>>
>>             IDictionary<string, object> properties = new Dictionary<string, object>();
>>             properties[PropertyIds.Name] = "Hello World Document";
>>             properties[PropertyIds.ObjectTypeId] = "Document";
>>
>>             byte[] content = UTF8Encoding.UTF8.GetBytes("Hello 
>> World!");
>>
>>             System.IO.FileInfo fileinfo = new 
>> System.IO.FileInfo("C:\\test\\test.zip");
>>
>>             DotCMIS.Data.Impl.ContentStream contentStream = new DotCMIS.Data.Impl.ContentStream();
>>             contentStream.FileName = fileinfo.Name;
>>             contentStream.MimeType = "application/zip";
>>             contentStream.Length = fileinfo.Length;
>>             contentStream.Stream = fileinfo.OpenRead();
>>
>>             IFolder myFolder =
>> (IFolder)session.GetObjectByPath("/temp");
>>
>>             IDocument myDoc1 = myFolder.CreateDocument(properties,
>> contentStream, DotCMIS.Enums.VersioningState.Major);
>>
>>         }
>>
>>     }
>> }
>>
>> Any ideas what could be the issue?
>>
>> Thanks
>> Wentao
>>
>>
>>
>> ________________________________
>> This email and its attachments are intended solely for the personal use of the individual or entity named above. Any use of this communication by an unintended recipient is strictly prohibited. If you have received this email in error, any publication, use, reproduction, disclosure or dissemination of its contents is strictly prohibited. Please immediately delete this message and its attachments from your computer and servers. We would also appreciate if you would contact us by a collect call or return email to notify us of this error. Thank you for your cooperation.
>> -BCHydroDisclaimerID5.2.8.1541
>>

Re: DotCMIS create document failed with "The socket connection was aborted"

Posted by Florian Müller <fm...@apache.org>.
Hi Wentao,

Some older SOAP stacks and stacks that don't handle MTOM correctly don't
work with DotCMIS.
Do you have specific repository or SOAP stack that doesn't work for you?

Btw. You should avoid the Web Services binding if you can...


- Florian


> Hi Florian,
> 
> From readme file https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk/README it said " Not all CMIS Web Services endpoints are compatible with the .NET framework for a number of reasons",  do you have a list which endpoints are not compatible?
> 
> 
> Thanks
> Wentao
> 
> -----Original Message-----
> From: Florian Müller [mailto:fmui@apache.org] 
> Sent: 2014, September 22 1:43 PM
> To: dev@chemistry.apache.org
> Cc: Lu, Wentao
> Subject: Re: DotCMIS create document failed with "The socket connection was aborted"
> 
> Hi Wentao,
> 
> Check your server and network setup. Some Web Services stacks (for example .Net) have (configurable) limits.
> There is nothing the client can do if the server closes the connection.
> 
> 
> - Florian
> 
> 
>> Hi,
>>
>> We are testing DotCMIS with Web Service binding (atompub works fine so far, but in some use cases we have to use web service binding).
>>
>> We get below exceptions with createDocument function, the sample "test.zip" file is only 400KB.
>>
>> {"Unable to write data to the transport connection: An existing 
>> connection was forcibly closed by the remote host."}
>>
>> StackTrace as below
>>
>>       at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
>>    at System.Net.Security._SslStream.StartWriting(SplitWritesState splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)
>>    at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
>>    at System.Net.TlsStream.MultipleWrite(BufferOffsetSize[] buffers)
>>    at System.Net.PooledStream.MultipleWrite(BufferOffsetSize[] buffers)
>>    at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
>>    at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
>>    at System.ServiceModel.Channels.BytesReadPositionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
>>    at 
>> System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.WebReques
>> tOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
>>
>> Here is our sample code:
>> using System;
>> using System.Collections.Generic;
>> using System.Linq;
>> using System.Text;
>> using DotCMIS;
>> using DotCMIS.Client;
>> using DotCMIS.Client.Impl;
>>
>> namespace ConsoleApplication1
>> {
>>     class Program
>>     {
>>         static void Main(string[] args)
>>         {
>>             
>> System.Net.ServicePointManager.ServerCertificateValidationCallback = 
>> delegate { return true; };
>>
>>             Dictionary<string, string> parameters = new Dictionary<string, string>();
>>             parameters[SessionParameter.BindingType] = BindingType.WebServices;
>>             String host = "myhost";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesRepositoryService] = 
>> "https://"+host+":7010/cmis/services101/RepositoryService";
>>
>>             parameters[DotCMIS.SessionParameter.WebServicesAclService] 
>> = "https://"+host+":7010/cmis/services101/ACLService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesDiscoveryService] = 
>> "https://"+host+":7010/cmis/services101/DiscoveryService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesMultifilingService] = 
>> "https://"+host+":7010/cmis/services101/MultiFilingService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesNavigationService] = 
>> "https://"+host+":7010/cmis/services101/NavigationService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesObjectService] = 
>> "https://"+host+":7010/cmis/services101/ObjectService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesPolicyService] = 
>> "https://"+host+":7010/cmis/services101/PolicyService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesRelationshipService] = 
>> "https://"+host+":7010/cmis/services101/RelationshipService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesVersioningService] = 
>> "https://"+host+":7010/cmis/services101/VersioningService";
>>
>>             
>> parameters[DotCMIS.SessionParameter.WebServicesEnableUnsecuredResponse
>> ] = "true";
>>
>>             parameters[SessionParameter.User] = "admin";
>>             parameters[SessionParameter.Password] = "password";
>>             parameters[SessionParameter.RepositoryId] = "RepositoryOS1";
>>             parameters[SessionParameter.ConnectTimeout] = "-1";
>>
>>             SessionFactory factory = SessionFactory.NewInstance();
>>             ISession session = factory.CreateSession(parameters);
>>
>>             IDictionary<string, object> properties = new Dictionary<string, object>();
>>             properties[PropertyIds.Name] = "Hello World Document";
>>             properties[PropertyIds.ObjectTypeId] = "Document";
>>
>>             byte[] content = UTF8Encoding.UTF8.GetBytes("Hello 
>> World!");
>>
>>             System.IO.FileInfo fileinfo = new 
>> System.IO.FileInfo("C:\\test\\test.zip");
>>
>>             DotCMIS.Data.Impl.ContentStream contentStream = new DotCMIS.Data.Impl.ContentStream();
>>             contentStream.FileName = fileinfo.Name;
>>             contentStream.MimeType = "application/zip";
>>             contentStream.Length = fileinfo.Length;
>>             contentStream.Stream = fileinfo.OpenRead();
>>
>>             IFolder myFolder = 
>> (IFolder)session.GetObjectByPath("/temp");
>>
>>             IDocument myDoc1 = myFolder.CreateDocument(properties, 
>> contentStream, DotCMIS.Enums.VersioningState.Major);
>>
>>         }
>>
>>     }
>> }
>>
>> Any ideas what could be the issue?
>>
>> Thanks
>> Wentao
>>
>>
>>
>> ________________________________
>> This email and its attachments are intended solely for the personal use of the individual or entity named above. Any use of this communication by an unintended recipient is strictly prohibited. If you have received this email in error, any publication, use, reproduction, disclosure or dissemination of its contents is strictly prohibited. Please immediately delete this message and its attachments from your computer and servers. We would also appreciate if you would contact us by a collect call or return email to notify us of this error. Thank you for your cooperation.
>> -BCHydroDisclaimerID5.2.8.1541
>>

RE: DotCMIS create document failed with "The socket connection was aborted"

Posted by "Lu, Wentao" <We...@bchydro.com>.
Hi Florian,

>From readme file https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk/README it said " Not all CMIS Web Services endpoints are compatible with the .NET framework for a number of reasons",  do you have a list which endpoints are not compatible?


Thanks
Wentao

-----Original Message-----
From: Florian Müller [mailto:fmui@apache.org] 
Sent: 2014, September 22 1:43 PM
To: dev@chemistry.apache.org
Cc: Lu, Wentao
Subject: Re: DotCMIS create document failed with "The socket connection was aborted"

Hi Wentao,

Check your server and network setup. Some Web Services stacks (for example .Net) have (configurable) limits.
There is nothing the client can do if the server closes the connection.


- Florian


> Hi,
> 
> We are testing DotCMIS with Web Service binding (atompub works fine so far, but in some use cases we have to use web service binding).
> 
> We get below exceptions with createDocument function, the sample "test.zip" file is only 400KB.
> 
> {"Unable to write data to the transport connection: An existing 
> connection was forcibly closed by the remote host."}
> 
> StackTrace as below
> 
>       at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
>    at System.Net.Security._SslStream.StartWriting(SplitWritesState splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)
>    at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
>    at System.Net.TlsStream.MultipleWrite(BufferOffsetSize[] buffers)
>    at System.Net.PooledStream.MultipleWrite(BufferOffsetSize[] buffers)
>    at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
>    at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
>    at System.ServiceModel.Channels.BytesReadPositionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
>    at 
> System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.WebReques
> tOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
> 
> Here is our sample code:
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using System.Text;
> using DotCMIS;
> using DotCMIS.Client;
> using DotCMIS.Client.Impl;
> 
> namespace ConsoleApplication1
> {
>     class Program
>     {
>         static void Main(string[] args)
>         {
>             
> System.Net.ServicePointManager.ServerCertificateValidationCallback = 
> delegate { return true; };
> 
>             Dictionary<string, string> parameters = new Dictionary<string, string>();
>             parameters[SessionParameter.BindingType] = BindingType.WebServices;
>             String host = "myhost";
> 
>             
> parameters[DotCMIS.SessionParameter.WebServicesRepositoryService] = 
> "https://"+host+":7010/cmis/services101/RepositoryService";
> 
>             parameters[DotCMIS.SessionParameter.WebServicesAclService] 
> = "https://"+host+":7010/cmis/services101/ACLService";
> 
>             
> parameters[DotCMIS.SessionParameter.WebServicesDiscoveryService] = 
> "https://"+host+":7010/cmis/services101/DiscoveryService";
> 
>             
> parameters[DotCMIS.SessionParameter.WebServicesMultifilingService] = 
> "https://"+host+":7010/cmis/services101/MultiFilingService";
> 
>             
> parameters[DotCMIS.SessionParameter.WebServicesNavigationService] = 
> "https://"+host+":7010/cmis/services101/NavigationService";
> 
>             
> parameters[DotCMIS.SessionParameter.WebServicesObjectService] = 
> "https://"+host+":7010/cmis/services101/ObjectService";
> 
>             
> parameters[DotCMIS.SessionParameter.WebServicesPolicyService] = 
> "https://"+host+":7010/cmis/services101/PolicyService";
> 
>             
> parameters[DotCMIS.SessionParameter.WebServicesRelationshipService] = 
> "https://"+host+":7010/cmis/services101/RelationshipService";
> 
>             
> parameters[DotCMIS.SessionParameter.WebServicesVersioningService] = 
> "https://"+host+":7010/cmis/services101/VersioningService";
> 
>             
> parameters[DotCMIS.SessionParameter.WebServicesEnableUnsecuredResponse
> ] = "true";
> 
>             parameters[SessionParameter.User] = "admin";
>             parameters[SessionParameter.Password] = "password";
>             parameters[SessionParameter.RepositoryId] = "RepositoryOS1";
>             parameters[SessionParameter.ConnectTimeout] = "-1";
> 
>             SessionFactory factory = SessionFactory.NewInstance();
>             ISession session = factory.CreateSession(parameters);
> 
>             IDictionary<string, object> properties = new Dictionary<string, object>();
>             properties[PropertyIds.Name] = "Hello World Document";
>             properties[PropertyIds.ObjectTypeId] = "Document";
> 
>             byte[] content = UTF8Encoding.UTF8.GetBytes("Hello 
> World!");
> 
>             System.IO.FileInfo fileinfo = new 
> System.IO.FileInfo("C:\\test\\test.zip");
> 
>             DotCMIS.Data.Impl.ContentStream contentStream = new DotCMIS.Data.Impl.ContentStream();
>             contentStream.FileName = fileinfo.Name;
>             contentStream.MimeType = "application/zip";
>             contentStream.Length = fileinfo.Length;
>             contentStream.Stream = fileinfo.OpenRead();
> 
>             IFolder myFolder = 
> (IFolder)session.GetObjectByPath("/temp");
> 
>             IDocument myDoc1 = myFolder.CreateDocument(properties, 
> contentStream, DotCMIS.Enums.VersioningState.Major);
> 
>         }
> 
>     }
> }
> 
> Any ideas what could be the issue?
> 
> Thanks
> Wentao
> 
> 
> 
> ________________________________
> This email and its attachments are intended solely for the personal use of the individual or entity named above. Any use of this communication by an unintended recipient is strictly prohibited. If you have received this email in error, any publication, use, reproduction, disclosure or dissemination of its contents is strictly prohibited. Please immediately delete this message and its attachments from your computer and servers. We would also appreciate if you would contact us by a collect call or return email to notify us of this error. Thank you for your cooperation.
> -BCHydroDisclaimerID5.2.8.1541
> 

Re: DotCMIS create document failed with "The socket connection was aborted"

Posted by Florian Müller <fm...@apache.org>.
Hi Wentao,

Check your server and network setup. Some Web Services stacks (for
example .Net) have (configurable) limits.
There is nothing the client can do if the server closes the connection.


- Florian


> Hi,
> 
> We are testing DotCMIS with Web Service binding (atompub works fine so far, but in some use cases we have to use web service binding).
> 
> We get below exceptions with createDocument function, the sample "test.zip" file is only 400KB.
> 
> {"Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host."}
> 
> StackTrace as below
> 
>       at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
>    at System.Net.Security._SslStream.StartWriting(SplitWritesState splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)
>    at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
>    at System.Net.TlsStream.MultipleWrite(BufferOffsetSize[] buffers)
>    at System.Net.PooledStream.MultipleWrite(BufferOffsetSize[] buffers)
>    at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
>    at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
>    at System.ServiceModel.Channels.BytesReadPositionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
>    at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.WebRequestOutputStream.Write(Byte[] buffer, Int32 offset, Int32 count)
> 
> Here is our sample code:
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using System.Text;
> using DotCMIS;
> using DotCMIS.Client;
> using DotCMIS.Client.Impl;
> 
> namespace ConsoleApplication1
> {
>     class Program
>     {
>         static void Main(string[] args)
>         {
>             System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
> 
>             Dictionary<string, string> parameters = new Dictionary<string, string>();
>             parameters[SessionParameter.BindingType] = BindingType.WebServices;
>             String host = "myhost";
> 
>             parameters[DotCMIS.SessionParameter.WebServicesRepositoryService] = "https://"+host+":7010/cmis/services101/RepositoryService";
> 
>             parameters[DotCMIS.SessionParameter.WebServicesAclService] = "https://"+host+":7010/cmis/services101/ACLService";
> 
>             parameters[DotCMIS.SessionParameter.WebServicesDiscoveryService] = "https://"+host+":7010/cmis/services101/DiscoveryService";
> 
>             parameters[DotCMIS.SessionParameter.WebServicesMultifilingService] = "https://"+host+":7010/cmis/services101/MultiFilingService";
> 
>             parameters[DotCMIS.SessionParameter.WebServicesNavigationService] = "https://"+host+":7010/cmis/services101/NavigationService";
> 
>             parameters[DotCMIS.SessionParameter.WebServicesObjectService] = "https://"+host+":7010/cmis/services101/ObjectService";
> 
>             parameters[DotCMIS.SessionParameter.WebServicesPolicyService] = "https://"+host+":7010/cmis/services101/PolicyService";
> 
>             parameters[DotCMIS.SessionParameter.WebServicesRelationshipService] = "https://"+host+":7010/cmis/services101/RelationshipService";
> 
>             parameters[DotCMIS.SessionParameter.WebServicesVersioningService] = "https://"+host+":7010/cmis/services101/VersioningService";
> 
>             parameters[DotCMIS.SessionParameter.WebServicesEnableUnsecuredResponse] = "true";
> 
>             parameters[SessionParameter.User] = "admin";
>             parameters[SessionParameter.Password] = "password";
>             parameters[SessionParameter.RepositoryId] = "RepositoryOS1";
>             parameters[SessionParameter.ConnectTimeout] = "-1";
> 
>             SessionFactory factory = SessionFactory.NewInstance();
>             ISession session = factory.CreateSession(parameters);
> 
>             IDictionary<string, object> properties = new Dictionary<string, object>();
>             properties[PropertyIds.Name] = "Hello World Document";
>             properties[PropertyIds.ObjectTypeId] = "Document";
> 
>             byte[] content = UTF8Encoding.UTF8.GetBytes("Hello World!");
> 
>             System.IO.FileInfo fileinfo = new System.IO.FileInfo("C:\\test\\test.zip");
> 
>             DotCMIS.Data.Impl.ContentStream contentStream = new DotCMIS.Data.Impl.ContentStream();
>             contentStream.FileName = fileinfo.Name;
>             contentStream.MimeType = "application/zip";
>             contentStream.Length = fileinfo.Length;
>             contentStream.Stream = fileinfo.OpenRead();
> 
>             IFolder myFolder = (IFolder)session.GetObjectByPath("/temp");
> 
>             IDocument myDoc1 = myFolder.CreateDocument(properties, contentStream, DotCMIS.Enums.VersioningState.Major);
> 
>         }
> 
>     }
> }
> 
> Any ideas what could be the issue?
> 
> Thanks
> Wentao
> 
> 
> 
> ________________________________
> This email and its attachments are intended solely for the personal use of the individual or entity named above. Any use of this communication by an unintended recipient is strictly prohibited. If you have received this email in error, any publication, use, reproduction, disclosure or dissemination of its contents is strictly prohibited. Please immediately delete this message and its attachments from your computer and servers. We would also appreciate if you would contact us by a collect call or return email to notify us of this error. Thank you for your cooperation.
> -BCHydroDisclaimerID5.2.8.1541
>