經歷了這麼多[R & d的,我得到了解決工作中的窗口Silverlight和WCF服務8環境。我回答我的問題,如果它可能有幫助的任何人陷入這種類型的錯誤..
實際原因:
No communication is creating in between CVT Service(WCF service) and CVT pages(silver light application) as client side. Whenever it compiled in windows 8 environment . Then the error caught was 「 An error occurred while trying to make a request to URI ‘http://localhost:8283. 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. Please see the inner exception for more details. 「.
分辨率:
The actual problem is present in WCF service . Below steps to be followed to run the WCF service successfully and make it communicate properly with silver light application in windows 8 environment. In windows 7 and previous versions the settings related to WCF service work will be enabled by default but in win 8 few features might not be enabled in that case you can follow these below steps.
第1步: 創建和添加兩個XML文件到wwwroot文件夾。該文件夾位於此路徑「C:\ inetpub \ wwwroot」中。 a)。
a)。 clientaccesspolicy.xml:
<xml version="1.0" encoding="utf-8">
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
</xml>
b)。 crossdomain.xml:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain- policy.dtd">
<cross-domain-policy>
<allow-http-request-headers-from domain="*" headers="SOAPAction,Content-Type"/>
</cross-domain-policy>
步驟2:如果此功能未激活,請按以下步驟啓用此功能。
點擊Windows + x。 選擇程序和功能(列表中的第一項)。 選擇左側打開或關閉Windows功能。 展開.Net Framework 4.5高級服務。 展開WCF服務。 啓用HTTP激活。
第3步:添加MIME類型和新的託管處理
WCF服務,不要在IIS 8默認配置運行,因爲Web服務器不知道,該如何處理傳入的請求針對的.svc文件。你可以分兩步教: 請參考下面的鏈接: https://gyorgybalassy.wordpress.com/2012/09/24/
第4步:應用程序應編譯在Windows 8環境。 我們需要按照以下步驟在Windows 8環境中運行此應用程序。