通过域服务 (WCF RIA) 加载实体时出现 DomainOperationException

发布于 2024-10-18 09:12:08 字数 2254 浏览 5 评论 0原文

我有一个简单的 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=&quot;Data Source=usd-ctct-app-01.mydomain.net;Initial Catalog=BusinessProcess;Integrated Security=True;MultipleActiveResultSets=True&quot;" 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 不显示命中数据库服务器的查询。正如您所期望的那样,卡西尼号的一切都运转良好。这是我收到的错误弹出消息的显示。只是不确定我在这里做错了什么。我觉得这应该比现在更简单...

Error Dialog

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...

Error Dialog

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

徒留西风 2024-10-25 09:12:08

我将 添加到 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文