zoukankan      html  css  js  c++  java
  • silverlight地图出错问题A security exception occured while trying to connect to the REST endpoint.Make sure you have a cross...

    今天,做的差不多的程序,一直在本机跑着,突然,叫同事访问看web,问题来了:

    第一反应就是按以下方式检查

    A:C:\inetpub\wwwroot 下已经放了clientaccesspolicy.xml与crossdomain.xml的两个文件;

    B:并且IIS中已经配置了添加MIME映射:
         (1).xaml   application/xaml+xml  (2).xap    application/x-silverlight-app
    当然,win7系统下已经有了这个设置。
    但是还是提示图示或以下文字错误:
    地图服务器出错:A security exception occured while trying to connect to the REST endpoint.Make sure you have a cross domain

    policy file available at the root for your server that allows for requests from this application.

    怎么办?

    四处搜索,http://msdn.microsoft.com/zh-cn/library/cc645032(v=vs.95).aspx看这个配置等等,都解决不了;后来才发现以下内容。
    解决办法:(如map:http://computername/ArcGIS/rest/services/namemap/MapServermachine,web:http://IP/webname)让computername与IP都一样即可。
    1、检查地图服务发布和链接是否与访问web页面的方式一样,如一个是机器名,另一个是IP的方式原因。
    2、让程序配置中的地图发布地址与web程序访问中的网段一样即可(要么都用机器名,要么都有IP)。

    解决,大功告成。不过,我难以理解:silverlight对配置的地图服务与web访问(computername与IP)不一样,为什么不能认,反而认为是跨域了?

    望高人指点,谢谢!

  • 相关阅读:
    5.2-5.3
    5.1封装
    阅读《构建之法》 5-7章
    做汉堡
    阅读《构建之法》1-5章
    结对 四则运算
    回答
    读后感
    提问*2
    提问1
  • 原文地址:https://www.cnblogs.com/lifuyun/p/lifuyun2012032801.html
Copyright © 2011-2022 走看看