我试图建立一个概念证明Csla 3.7/Silverlight 3应用程序,并已通过我的方式通过Rocky's tutorials。这是一个非常简单的一种形式/一个业务对象数据编辑应用程序,并且一切都很好,直到我尝试配置Wcf以便Silverlight应用程序可以与数据门户进行通信。WCF/Csla地狱
我得到的错误是:
CommunicationException was unhandled by user code
An error occurred while trying to make a request to URI 'http://localhost:1406/WcfPortal.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.
我完全被这个迷惑,因为我是一个有点的n00b的Silverlight的& WCF。我的设置对于Csla Silverlight应用程序来说非常简单。我有4个项目:
- CslaSilverlight:Silverlight项目
- CslaSilverlight.Client:Silverlight的类库
- CslaSilverlight.Server:.NET类库
- CslaSilverlight.Web:ASPNET项目主办SL应用
所有东西都在我的笔记本电脑上在卡西尼本地运行。我想让DataPortal在Silverlight之外运行,以便可以访问SQL Server。我认为这个问题可能与我的WCF配置,其中在ServiceReferences.ClientConfig文件中指定的Silverlight应用程序:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IWcfPortal" maxBufferSize="65536"
maxReceivedMessageSize="65536" receiveTimeout="10" sendTimeout="10">
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:1406/WcfPortal.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfPortal"
contract="Csla.WcfPortal.IWcfPortal" name="BasicHttpBinding_IWcfPortal" />
</client>
</system.serviceModel>
</configuration>
我想知道如果端口号重要的是,当我改变它,我得到一个不同的错误。我也想知道端点地址的格式是否正确。
不知道它是很重要的,但是从ASPNET的web.config我serviceModel设置:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="WcfPortalBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="WcfPortalBehavior" name="Csla.Server.Hosts.Silverlight.WcfPortal">
<endpoint address="" binding="basicHttpBinding" contract="Csla.Server.Hosts.Silverlight.IWcfPortal">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
听起来合乎逻辑。我按照你的建议google了,并且我已经在根文件夹中的ASPNET web应用程序中添加了一个clientaccesspolicy.xml文件,但它没有任何作用! – Steve
我有我的直接在Web服务的.svc文件相同的位置。你有没有找到它? – Andrew
doh!它的工作,只是一次...突然我现在得到 “远程服务器返回一个错误:NotFound” 卡西尼已启动并在端口3405上运行。我的端点地址是http:// localhost:3405/WcfPortal.svc – Steve