HTML Viewer Service / chi.ce = CE_OTHER

T

Tobias Krautkremer

Hi,

I installed the html viewer on my computer. The Html Viewer Service and Load
Balancing service are both launched. When I tried to call the service as
below, the last line always return: chi.ce =CE_OTHER and couldn't get the
html result. It was working well when I run in the batch mode, so I think
the problem is on the service or the input parameters. Is there anybody
have some ideas about this.

This are my sample input parameters for the function below:

response = this.Response;
strLoadBalancerUri = "http://localhost:8093/HtmlTrLoadBalancer";
strDocument = "test.doc";
rgbData = fileToConvertContents;

Thanks in advance
Tobias

// taken from sps sdk
void DisplayHtml(System.Web.HttpRes­ponse response, string
strLoadBalancerUri, string strDocument, byte[] rgbData)
{
//generate a task name based off of the document name
string strTask = strDocument;


//create the load balancer object
IHtmlTrLoadBalancer htmlTrLoadBalancer = (IHtmlTrLoadBalancer)
System.Activator.GetObject( typeof(IHtmlTrLoadBalancer),
strLoadBalancerUri);


//get the uri for the launcher object
string strLauncherUri = htmlTrLoadBalancer.StrGetLaunc­her(strTask);


//create the launcher object at the uri specified by the load balancer
IHtmlTrLauncher htmlTrLauncher = (IHtmlTrLauncher)
System.Activator.GetObject(typ­eof(IHtmlTrLauncher),
strLauncherUri);


//call the launcher to create the html
CreateHtmlInfo chi = htmlTrLauncher.CHICreateHtml(s­trLauncherUri,
rgbData, BrowserType.BT_IE4, strDocument, strTask, 90 /*timeout*/,
true);


//ensure that the load balancer knows that the task has completed
htmlTrLoadBalancer.LauncherTas­kCompleted(strLauncherUri, strTask);


//check for errors and output the results
if(chi.ce == CreationErrorType.CE_NONE && chi.fHasMainFile)
response.BinaryWrite(chi.rgbMa­inFile);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top