Connecting to WMS through local proxy

5402
7
03-11-2011 02:56 AM
TorbjørnDalløkken
New Contributor II
Hi!
I'm trying to create a webapplication with the ArcGIS API for Silverlight, which uses an WMS-service from the Norwegian Mapping Authority. The service is as far as I can see published with Mapserver, and doesn't have any clientaccesspolicy.xml or crossdomain.xml. There are about 168 different layers within this service. I have several questions about WMS and Silverlight API. Therefore I've been trying to use the proxyfiles which I found in the documentation for ArcGIS Server.

The WMS-URL is : http://openwms.statkart.no/skwms1/wms.topo2?request=GetCapabilities&service=wms&version=1.1.1

Several times when I run the application I get an "ArgumentOutofRangeException: Non-negative number required." within proxy.ashx during the initialization. Does anyone know what's the cause of this exception? It seems to be happening most of the time when I've used the full extent of the wms-service. The exception happens at the code
byte[] outb = br.ReadBytes((int)serverResponse.ContentLength);

When I use a smaller extent, which shows a DynamicMapServiceLayer; I don't get this error and fiddler seems to return a result, png-image. The image however doesn't show up on the page... when panning on the map, the wms-server sends images normally.

Can anyone help me with this?

Regards, Torbjørn
0 Kudos
7 Replies
DominiqueBroux
Esri Frequent Contributor
Look at this thread : http://forums.arcgis.com/threads/24183-password-protected-WMS-service, the proxy provided might been better for you.
0 Kudos
TorbjørnDalløkken
New Contributor II
Thank you! That proxy page works great! 🙂

Look at this thread : http://forums.arcgis.com/threads/24183-password-protected-WMS-service, the proxy provided might been better for you.
0 Kudos
GuillermoLópez
New Contributor
Look at this thread : http://forums.arcgis.com/threads/24183-password-protected-WMS-service, the proxy provided might been better for you.


Hi,
we have problems with this wms service from spain (http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx? )
We use the proxy page correctly with others services without crossdomain/clientacces.
With this proxy, the server service send -1 to the ContentLenght value.
Please, any suggestion?

Thanks
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Your WMS service seems not working even without proxy page.

I tested this Url : http://ovc.catastro.meh.es/Cartografia/WMS/ServidorWMS.aspx?service=WMS&request=GetCapabilities&vers... and got 'Service Unavailable'.
0 Kudos
GuillermoLópez
New Contributor
Hi,
the service is available with ArcGIS and other SW.
With the proxy page, I can get the capabilities file and a blank image.
At line 110 of proxy.ashx if (serverResponse.ContentLength> 0) is negative and exits.
I know I have to change that part of the proxy code on the page to resolve this problem but not how.
any ideas?

thanks
0 Kudos
JohnBurak
New Contributor
This may or may not be a solution to your problem, but I wanted to post for others who land here from Google. I got this exception from my Silverlight implementation because I had configured to use a proxy and was also using a port number in my map service URL. I have to use one or the other (proxy or port number) but not both.
0 Kudos
JB2
by
New Contributor
This may or may not be a solution to your problem, but I wanted to post for others who land here from Google. I got this exception from my Silverlight implementation because I had configured to use a proxy and was also using a port number in my map service URL. I have to use one or the other (proxy or port number) but not both.
0 Kudos