I have a WCF service, part of which is to allow documents to be linked via email to users who do not have a TRIM client install.
For example, the link http://myserver/service/Documents.aspx?RecordNumber=00001 would allow the user to download the document attached to record with record number '00001'.
This works great in most cases. The issue is that, for some documents, this call never returns. The calling user sees the following exception:
"This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details."
The server logs suggest that the service has thrown an unhandled exception and was terminated by the server.
Application: w3wp.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.AccessViolationException Stack: at <Module>.RECimp.getDocumentEx(RECimp*, APPerror*, EDMextractTaskData*, sstring*, IStream**, stringArray*) at HP.HPTRIM.SDK.Record.GetDocument(System.String, Boolean, System.String, System.String)
For most documents, the call works as expected and downloads a copy of the document for the user.
For invalid record numbers or records with no documents, the call returns an appropriate exception from TRIM.
The "corrupt" documents which fail to download fail consistently; but they all worked when they were initially saved to TRIM. When looked at through the TRIM client, these documents open and seem perfectly fine.
The relevant C# code is below:
_logger.Info(@"I write successfully");
var record = new Record(TrimDB, RecordNumber);
docLoc = record.GetDocument(TempFileLocation + @"\" + record.SuggestedFileName, false, "", TempFileLocation);
_logger.Info(@"I am never reached for corrupt documents.");
_logger.Info(@"Exception; this line is never reached for corrupt documents");
Any thoughts or insight would be extremely appreciated, even if it's basically a shot in the dark.
1. Are you setting TrimApplication.servicestype = service or webservice when instating TRIM database 2. Verify the appdata/localappdata paths for webservice application is configured correctly with full read/write permissions for impersonated user or dedicated user. 3. handle webservice recycling conditions when an IIS worker process is being re-initialized/recycled 4. Not ideal, trap the error/exception and re-generate same webservice request again. 5. Explicitly purge local cached documents either through code, schedule task, TRIM System options or if your web services app can be configured to run on its own workgroup server is another option or basesobject.refreshcarche 6. try baseobject.extract or baseobject.getextractdoc ....etc