0

I've been following a whole bunch of tutorials on how to get overlays working in bing maps silverlight and they all appear to not even mention this problem of mine.

Example of tutorial: https://alastaira.wordpress.com/2011/01/07/accessing-a-wms-tile-server-from-bing-maps-silverlight/

What is happening is i set the tilesource to something like: "http://wms1.ccgis.de/cgi-bin/mapserv?map=/data/umn/germany/germany.map&&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&SRS=EPSG%3A4326&BBOX={0}&WIDTH=256&HEIGHT=256&LAYERS=Bundeslaender"

When i run the application and check the calls with fiddler not a single call is made to this service. If i change the source to start with https then the calls are seen in fiddler.

I also tried spinning up a webclient and doing a get request on http://google.com and fiddler actually recorded a call to http://google.com/clientaccesspolicy.xml which seems to be in line with how its supposed to work.

I have the following xml files in my website root.

ClientAccessPolicy.xml

    <?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="SOAPAction">
        <!-- IMPORTANT! Include these lines -->
        <domain uri="https://*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

crossdomain.xml

<cross-domain-policy>
    <allow-access-from domain="*.*" headers="SOAPAction"/>
    <allow-http-request-headers-from domain="*.*" headers="SOAPAction"/> 
    <site-control permitted-cross-domain-policies="master-only"/>
</cross-domain-policy>

Anyone have any ideas? It just seems like the bingmaps SDK just refuses to even attempt an http call.

Chris Rice
  • 728
  • 2
  • 9
  • 32

1 Answers1

0

If your own Silverlight app is hosted on https, it cannot make requests to any http sites. I assume this is the reason - otherwise it should work

dotMorten
  • 1,953
  • 1
  • 14
  • 10
  • Yes it is hosted over https but if this is true then why can the web client object make a request over http? And the regular Bingmap engine requests over http too. – Chris Rice Mar 30 '13 at 02:37
  • ??? It can't if the .xap is hosted on https. It can only request on https. If you monitor the traffic that Bing maps generate, it should switch to https to get data if .xap is hosted on https – dotMorten Apr 02 '13 at 05:57
  • Hmm you are right, after doing some more testing I determined that my sort of success was due to me enabling trusted mode on my computer and setting the setting for it in the silverlight 5 project properties. I didn't realize that this allows for cross calls but only if you call it using localhost. – Chris Rice Apr 05 '13 at 03:57