这会偷走我的理智。我已经浏览了我在网上找到的几乎所有内容,并且没有向前迈进一步。无论我在做什么,挫折都不足以形容这个错误信息。CommunicationException从Silverlight中调用WCF时出现
但一个接一个。
我有VS 2008 SP1德语版64位W2008 Server机器,工具的Silverlight 3.0
我想从Silverlight应用程序消耗WCF的服务。而且,尽可能多的人,在调用结束时,我得到了非常令人沮丧的非描述性通信异常。
我创建了一个新的WCF服务,命名为Endpoint并将其绑定为basicHttpBinding。我添加的属性
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
到Service类,并在App.config
我离开一切,因为它是行
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
到system.serviceModel和测试服务通过WCF客户端成功。然后我把它发布到我的本地IIS7到http://localhost/WCFTest
在我的Silverlight应用程序,我使用http://europa.therestofmydomain/WCFTest/WcfTest.Service1.svc
添加服务到服务引用我下面的代码添加到客户端:
using OSMDeepEarthExample.ServiceReference1;
...
Service1Client s1 = new Service1Client();
s1.GetDataCompleted += new System.EventHandler<GetDataCompletedEventArgs>(s1_GetDataCompleted);
s1.GetDataAsync(20);
void s1_GetDataCompleted(object sender, GetDataCompletedEventArgs e)
{
CountFetchedData.Text = e.Result;
}
我加一个clientaccesspolicy.xml和A的crossdomain.xml到根目录(C:\的Inetpub \ wwwroot的)
clientaccesspolicy.xml:
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from>
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
的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-access-from domain="*" />
<allow-http-request-headers-from domain="*" headers="SOAPAction" />
</cross-domain-policy>
我重新启动IIS。两次。经常。
我安装了网站开发助手,可能会得到关于什么是错误的更有意义的信息。但是这会让IE崩溃。
我没有想法。并且很快就开始对我的硬件进行攻击。请帮助我的硬件!
正如约翰指出,我也忘了全ERRORMESSAGE这里说到:
Fehler BEIM萨登einer Anforderung的巢穴URI “http://europa.therestofmydomain/WCFTest/WcfTest.Service1.svc”。 Ursache istmöglicherweise,dass ohne die entsprechendedomänenübergreifendeRichtlinie oder mit einer nichtfürSOAP-Dienste geeigneten Richtliniedomänenübergreifendauf einen Dienst zugegriffen wurde。 MöglicherweisemüssenSie sich an den Besitzer des Diensts wenden,damit einedomänenübergreifendeRichtliniendateiveröffentlichtund das Senden von sich auf SOAP beziehenden HTTP-Headern zugelassen wird。 Dieser Fehler kann auch durch Verwendung von internen Typen im Webdienstproxy ohne das InternalsVisibleToAttribute-Attribut verursacht werden。 Weitere详细信息芬兰Siena in der inneren Ausnahme。
总之,它表示可能缺少一个域间规则。
在所有这些挫折之中,你没有发布过你收到的异常。完全的例外。 ex.ToString()的结果。 – 2009-08-21 14:15:20
你是对的,我在我的帖子 – Aaginor 2009-08-21 14:42:23