I use IMapDocument and its ActiveView.Output to export a bitmap from an MXD documen to a bitmap. This works just fine with an MXD with local data. However, when exporting from an MXD connected to an ArcGIS Server Map Service, the output method seems to time out, and nothing is exported to the bitmap.
Looking at the jobs folder on the arcgisserver, I can see new cache images are crated for the extent I exported. If I zoom out one level, and back in, I get the map image. So in other words I have to export to every extent twice to get an exported map.
What is the reason for this? Is there a timeout setting I have yet to find? The code for exporting is pretty much what you see on different threads here. I do not believe it is the actual code used to export which is the problem.
I use ArcObjects 9.3. I've seen in version 10 there is an ITrackCancel2 interface which has a Timeout property, which might be something I'm looking for. But I hope there is a different way of allowing the Output to wait a bit longer for result from the MapServer service.