Select to view content in your preferred language

Creating a Proxy Page for the Map Resources

849
4
09-13-2010 12:29 PM
JacekSobolewski
Deactivated User
Hi,
I have been working on an application (in SL4) which purpose is to create a PDF file from a visual. The visual (among other things) contains maps that can come from cross domain resources. I use WriteableBitmap class to create a bitmap out of the visual. Unfortunately, WriteableBitmap has a limitation where it will refuse to give pixels of images that come from a domain that is different from the application. I have seen some suggestions that perhaps using a proxy page for the cross domained resources can solve this problem. So my question is: how does one set up a proxy page?
Any suggestions, answers will be greatly appreciated.

Regards,
Jacek Sobolewski
0 Kudos
4 Replies
DarinaTchountcheva
Frequent Contributor
Hi Jacek,

Here is how you set up a proxy page:

http://help.arcgis.com/en/webapi/silverlight/help/Secure_services.htm

It is under "Using ArcGIS Server" topic in the Silverlight API help:

http://help.arcgis.com/en/webapi/silverlight/help/index.html

Once you set up your proxy page (config and ashx), add proxyUrl to your services.
I haven't used proxy page for your purpose, but I it is worth to give it a try. I think, it will work.

Good Luck!
0 Kudos
JacekSobolewski
Deactivated User
Thank you!

Jacek
0 Kudos
stefanschlaefli
Regular Contributor
Hi Jacek

I am also trying to create an image of the current map control state. And I experienced the same cross domain issue with the WriteableBitmap class, because of the ArcGIS Online background layers I'm using in the map. Did the approach with the proxy page work?

Cheers
Stefan
0 Kudos
JacekSobolewski
Deactivated User
Stefan,
Yes it did.
Basically, you will do something like this:
http://servername/../proxy.ashx?http://servername/../ServiceName/MapService.

Of course, make sure that your proxy allows a particular service. You can configure a proxy through its configuration file.
Let me know if you have any questions about it.

Jacek

Hi Jacek

I am also trying to create an image of the current map control state. And I experienced the same cross domain issue with the WriteableBitmap class, because of the ArcGIS Online background layers I'm using in the map. Did the approach with the proxy page work?

Cheers
Stefan
0 Kudos