Good Evening Everyone,
I'm getting the following error when trying to call the Create method on a DocumentInfo objects:
LaserficheRepositoryException Laserfiche.RepositoryAccess.MalformedDataException: Received bad response from the server.
at Laserfiche.RepositoryAccess.EntryLock.ParseLockResponse(HttpResponse response)
at Laserfiche.RepositoryAccess.EntryLock.LockInternal(HttpUrl url, LockType type, Dictionary`2 additionalHeaders, String etag)
at Laserfiche.RepositoryAccess.EntryLock..ctor(EntryInfo info, EntryNameOption options)
at Laserfiche.RepositoryAccess.Entry.MakeDocFolderWithLock(EntryInfo info, EntryNameOption options)
at Laserfiche.RepositoryAccess.DocumentInfo.Create(FolderInfo parent, String name, EntryNameOption options)
I have a sample harness and our actual application that's using the same test code. It works fine in the sample harness; however, in our application, the test code fails. Both are running on the same server. Any ideas what could cause this? Again, this is hard coded test code, and every thing is the same between both. Below is the code. Any help would be really appreciated. Thank you.
Session session = new Session(); try { session.IsSecure = true; var repositoryRegistration = new RepositoryRegistration("CompanyWebsiteRemovedForSecurity.com", "companyRepositoryRemovedForSecurity", 80, 443); session.LogIn("UsernameRemovedForSecurity", "PasswordRemovedForSecurity", repositoryRegistration); var pdfBytes = File.ReadAllBytes("c:\\temp\\sample.pdf"); var documentInfo = new DocumentInfo(session); var myFolder = Folder.GetFolderInfo("\\Customer Files\\Client Services", session); documentInfo.Create(myFolder, "Create By Document Builder", EntryNameOption.AutoRename); string documentHeader = "application/pdf"; string documentExtension = "pdf"; using (MemoryStream buffer = new MemoryStream(pdfBytes)) { using (Stream eDocStream = documentInfo.WriteEdoc(documentHeader, buffer.ToArray().LongLength)) { documentInfo.Extension = documentExtension; documentInfo.Comment = "Comment added here"; eDocStream.Write(buffer.ToArray(), 0, buffer.ToArray().Length); } } documentInfo.Save(); } catch (LaserficheRepositoryException ex) { LogInfo($"LaserficheRepositoryException {ex}"); session.LogOut(); session.Close(); }