2014-09-03 66 views
0

我将我的Silverlight应用程序移动到新服务器。 Silverlight应用程序调用wcf服务。我第一次拨打wcf服务时出现错误。错误是:将Silverlight应用程序连接到wcf服务

尝试向URI发出请求时发生错误'http://deviis202/wcfITGEPS/svcITGEPS.svc'.这可能是由于尝试以跨域方式访问服务而没有适当的跨域策略,或者存在以下策略:不适合SOAP服务。您可能需要联系服务的所有者以发布跨域策略文件,并确保它允许发送与SOAP相关的HTTP头。使用Web服务代理中的内部类型而不使用InternalsVisibleToAttribute属性也可能导致此错误。有关更多详细信息,请参阅内部例外。

它工作正常,如果我在本地使用wcf服务。

我GOOGLE了一个问题,我说它寻找clientaccesspolicy.xml和crossdomain.xml。这些如下所示。然后看看我。

clientaccesspolicy.xml

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

所述的crossdomain.xml

<?xml version="1.0" encoding="utf-8" ?> 
<cross-domain-policy> 
    <allow-http-request-headers-from domain="*" headers="*"/> 
</cross-domain-policy> 

任何提示将不胜感激。

回答

0

答案很简单,我需要在基地发布clientaccesspolicy.xml和crossdomain.xml。在我的情况下在C:\ inetpub \ wwwroot。

相关问题