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
>