通过域服务 (WCF RIA) 加载实体时出现 DomainOperationException
我有一个简单的 Silverlight 项目,它只是在 IIS 7.5 系统上获取一组实体 (EF 4)。这是我的网络配置:
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</modules>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<system.web>
<httpModules>
<add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
</system.web>
<connectionStrings>
<add name="BusinessProcessEntities" connectionString="metadata=res://*/ForecastModel.csdl|res://*/ForecastModel.ssdl|res://*/ForecastModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=usd-ctct-app-01.mydomain.net;Initial Catalog=BusinessProcess;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>
当我浏览到 http://forecasting 时。 mydomain.net/ClientBin/ForecastTool_2-Web-ForecastDomainSvc.svc?wsdl 我看到服务网页。 Fiddler 没有给我任何真正继续下去的东西。 SQL Profiler 不显示命中数据库服务器的查询。正如您所期望的那样,卡西尼号的一切都运转良好。这是我收到的错误弹出消息的显示。只是不确定我在这里做错了什么。我觉得这应该比现在更简单...
I have a simple Silverlight project that is just getting a set of entities (EF 4) on an IIS 7.5 system. Here is my web config:
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</modules>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<system.web>
<httpModules>
<add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
</system.web>
<connectionStrings>
<add name="BusinessProcessEntities" connectionString="metadata=res://*/ForecastModel.csdl|res://*/ForecastModel.ssdl|res://*/ForecastModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=usd-ctct-app-01.mydomain.net;Initial Catalog=BusinessProcess;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>
When I browse to http://forecasting.mydomain.net/ClientBin/ForecastTool_2-Web-ForecastDomainSvc.svc?wsdl I see the service web page. Fiddler has given me nothing to really go on. SQL Profiler does not show the query hitting the DB server. As you would expect, everything works briliantly with Cassini. Here is a show of the popup message I get for the error. Just not sure what I have done wrong here. I feel this should be simpler than it is right now...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将
添加到 web.config,并使用[RequiresRole()]
来限制对所需方法的访问。不知道为什么我对此感到如此困难。这基本上就是我在常规 WCF 中所做的事情。I added
<identity impersonate="false" />
to the web.config and I am using[RequiresRole()]
to limit access to the methods as required. Not sure why I was having such a hard time with this. It is basically what I would have done in regular WCF.