(我看到幾個與我的問題有關的問題,但沒有解決方案適用於我,因爲我在生產中遇到此問題,而不是在本地開發期間,已經嘗試了所有建議的修補程序。)Silverlight WCF + SSL安全錯誤 - crossdomain.xml從未要求
我有一個使用由IIS託管的WCF服務的Silverlight 4應用程序。在生產中,這些服務通過HTTPS訪問。儘管有a valid crossdomain.xml文件我仍然獲得了著名的「安全錯誤」訪問服務時:
An error occurred while trying to make a request to URI 'https://MYDOMAIN/MYSERVICE.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details. ---> System.Security.SecurityException ---> System.Security.SecurityException: Security error...
使用招我可以看到,不要求發出的crossdomain.xml或clientaccesspolicy.xml。有一個連接請求到服務器,但這是全部。
我讀過這個錯誤,雖然它表明crossdomain.xml/clientaccesspolicy.xml的問題也可以在服務器發出無效證書時引發。這似乎並不是我的情況。
我敢肯定是正確設置如下:
1. crossdomain.xml的是有效的,並在現場
2.服務做工作的根本託管(我們在使用它們的各種技術的其他客戶端,其中包括依賴於crossdomain.xml的Adobe Flex)
3. Silverlight應用程序確實有效(它可以在共享開發服務器上使用本地服務和服務***)
4. Silverlight應用程序甚至沒有嘗試請求crossdomain.xml或clientaccesspolicy.xml(由Fiddler確認)
5. Silverlight應用程序使用適當的配置通過https訪問WCF。以下是配置:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMyServices" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://MYDOMAIN/MYSERVICE.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyServices" contract="Services.IMyServices" name="BasicHttpBinding_IMyServices" />
</client>
</system.serviceModel>
</configuration>
還有什麼會導致這種問題?是否因爲Web服務器負載均衡?或者我沒有注意到證書有問題嗎?如果你至少能指出我正確的方向,那將是非常值得讚賞的。我們在開發環境中遇到類似問題Silverlight應用程序無法訪問共享開發服務器上的WCF服務,儘管有適當的crossdomain.xml,並且沒有使用HTTPS 。我通過在IE中添加開發服務器作爲可信站點來解決這個問題,但是同樣的解決方法並不適用於生產環境,即使這樣也不是一個可以接受的解決方法。但事實是,我必須在開發環境讓我擔心我錯過了一些東西...)
連接請求到服務器的響應代碼是什麼?當我訪問您在瀏覽器中提供的鏈接時,出現「403 - 禁止訪問:拒絕訪問」響應 – wickedtreemonkey 2011-01-31 21:35:32