UI Viewer 2.19: Error can't connect to server

Hello,
We are evaluating your product and are trying to implement the v2.19 UI viewer. I have successfully installed it on my development machine (win 7 pro 64bit, VS2015, .net 4.5.2). I have also successfully created a document consumer web site that uses the WebServiceProvidingViewer service. All works great locally. I’ve deployed the WebServiceProvidingViewer web service, the WDSL screen appears with the two methods, GetInlineDocumentScript and GetJavaScriptLibraries. Invoking either method is successful. However once I deployed the document consumer app, I get “Error can’t connect to server”. If I get on the server and run the document consumer app I get no error but not document is shown either. I’ve added the webServices-> protocols->HttpGet & HttpPost as described in “How to Build an ASP.NET WebForms HTML5 Document Viewer using web services”. Any way to get more error info so I can get this working?

Thanks,
Brian

Hi Brian,


Thank you for the question. You can set EnableStandardErrorHandling to true and you will get more info about the issue.

Also I want to notify you that the 2.x version is not supported any more - please migrate to the latest Viewer if possible.

Best regards.

Hi Pavel,


The exception I’m getting after moving code from local machine to the server is:

[NullReferenceException: Object reference not set to an instance of an object.]
Groupdocs.Web.UI.Handlers.BaseAspNetHandler.OnException(Exception exception, HttpContext context) +435
Groupdocs.Web.UI.Handlers.BaseAspNetHandler.ProcessRequest(HttpContext context) +55
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +188
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

What exactly is null here?
Using Fiddler I can see that the response header is: OPTIONS /document-viewer/ViewDocumentHandler HTTP/1.1
returning an HTTP result of 500.

Thanks,
Brian

Hi Brian,


Thank you for the question. Looks like you haven’t initialized the Viewer - please ensure that the Viewer.SetRootStoragePath() is called when you run the application on the server and ensure that the application has access (read/write privileges) to the folder which you set as a root storage.

If this will not help you - please share the project example with me that I can check it.

Best regards.
Hi Pavel,

That didn't help so here are my two projects and the file dir structure with a couple of pdfs.

The Attachments.zip file is my directory structure sitting on c:\inetpub\wwwroot.

WebServiceProvidingViewer: appPool = v4.0, Integrated, running as NetworkService.
Virtual Directory: /StrippedAttachments
Physical path: C:\inetpub\wwwroot\Attachments\Development\StrippedAttachments
Virtual Directory: /RootStoragePath
Physical path: C:\inetpub\wwwroot\Attachments\Development

DocumentConsumer: appPool = v4.0, Integrated, running as NetworkService.
Virtual Directory: /StrippedAttachments
Physical path: C:\inetpub\wwwroot\Attachments\Development\StrippedAttachments

WebServiceProviderViewer GetInLineDocumentScript-> Invoke (HolleyRebuildManual.pdf) returns:

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://xxxx-test:8008/"></string>

Hi Pavel,


This is from the application event log on the server:

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="ASP.NET 4.0.30319.0" />
<EventID Qualifiers="32768">1309</EventID>
<Level>3</Level>
<Task>3</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2016-07-29T18:53:08.000000000Z" />
<EventRecordID>145651</EventRecordID>
<Channel>Application</Channel>
<Computer>XXXX-TEST.local</Computer>
<Security />
</System>
- <EventData>
<Data>3005</Data>
<Data>An unhandled exception has occurred.</Data>
<Data>7/29/2016 2:53:08 PM</Data>
<Data>7/29/2016 6:53:08 PM</Data>
<Data>7d074d98109646849af54e54e37491d9</Data>
<Data>7</Data>
<Data>1</Data>
<Data>0</Data>
<Data>/LM/W3SVC/6/ROOT-1-131142919860738361</Data>
<Data>Full</Data>
<Data>/</Data>
<Data>C:\inetpub\wwwroot\DocumentServer\</Data>
<Data>XXXX-TEST</Data>
<Data />
<Data>6676</Data>
<Data>w3wp.exe</Data>
<Data>NT AUTHORITY\NETWORK SERVICE</Data>
<Data>NullReferenceException</Data>
<Data>Object reference not set to an instance of an object. at Groupdocs.Web.UI.Handlers.BaseAspNetHandler.OnException(Exception exception, HttpContext context) at Groupdocs.Web.UI.Handlers.BaseAspNetHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)</Data>
<Data>http://XXXX-test:2222/document-viewer/ViewDocumentHandler</Data>
<Data>/document-viewer/ViewDocumentHandler</Data>
<Data>10.99.1.170</Data>
<Data />
<Data>False</Data>
<Data />
<Data>NT AUTHORITY\NETWORK SERVICE</Data>
<Data>7</Data>
<Data>NT AUTHORITY\NETWORK SERVICE</Data>
<Data>False</Data>
<Data>at Groupdocs.Web.UI.Handlers.BaseAspNetHandler.OnException(Exception exception, HttpContext context) at Groupdocs.Web.UI.Handlers.BaseAspNetHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)</Data>
</EventData>
</Event>

Hi,


Thank you for the project examples. I have checked them and found several issues:

1. You should allow CrossOrigin requests - in the systemWebServer section add such module:

2. Also in the handlers add such handler:

Best regards.

Hi Pavel,


It turns out it’s an issue with chrome. It works fine under IE 11 but not chrome v 51.0

Brian

Hi Brian.


Thank you for coming back. Its a strange behavior - commonly the IE browser has issues and other browsers work well. Since that could you please share with me a screenshot of the Chrome browser console errors and screenshots of the failed requests from the Network tab of the browser console.

Thank you.

Hi Pavel,


Here are the screen shots as requested.

Thank you,

Brian

Hi Brian,


Thank you for the screenshots. This error means that you doesn’t configured the cross domain in the WebServiceProvidingViewer. Please insure that you have added configs mentioned here and rebuilded and redeployed the app.

Best regards.