2014-09-03 79 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。

相關問題