Question

My application is deployed to a web farm that does not use sticky sessions (unfortunately this is not an option). I would like to write the chart image to a web service and read it from there as the client browser does not always get redirected to the same server the image has been rendered to. I cannot use a file server due to security restrictions and do not have access to a database from the IIS service directly only to a wcf service.

Was it helpful?

Solution

So you are asking:

client -> WS Call -> ?? -> HTTPHandler that generates chart?

I'm not sure why you need the web service part.

You can use an HTTPHandler to generate the image this can work really well. Just instantiate your chart object and write it to the output stream.

Some sample code about saving to a stream from the nets.

Response.ContentType = "image/png";
//Response.AddHeader("Content-Disposition", "attachment; filename=test.png"); // You only want this to save as attachment
Chart4.SaveImage(Response.OutputStream, ChartImageFormat.Png);        
Response.End();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top