RIA 服务域服务类 web.config 设置

发布于 2024-10-23 18:59:03 字数 643 浏览 4 评论 0原文

我已将域服务类添加到 SL4 / EF / RIA 服务应用程序的服务器端项目中。我已成功创建 web.config 部分所需的所有必要元素。 (顺便说一句,为什么在我创建域服务类时没有为我生成这个?)

我现在缺少的是在端点元素的契约属性中放入的内容:

<service behaviorConfiguration="XXX.Web.RIAServices.MyServiceBehavior" name="XXX.Web.RIAServices.MyService">
    <endpoint address="http://localhost:6400/ClientBin/XXX-Web-RIAServices-MyService.svc" binding="basicHttpBinding" bindingConfiguration="LargeData" contract="???">
      <identity>
      </identity>
    </endpoint>
  </service>

我认为它应该类似于 XXX.Web.RIAServices.IMyService 但该接口在我生成的代码中不存在。

我在合约属性中放置什么?

I've added a domain service class to the server side project of my SL4 / EF / RIA Services application. I've managed to create all the necessary elements needed in my web.config section. (Btw, why isn't this generated for me when I created my Domain Service Class?)

What I'm missing now is what to put in the contract attribute of my endpoint element:

<service behaviorConfiguration="XXX.Web.RIAServices.MyServiceBehavior" name="XXX.Web.RIAServices.MyService">
    <endpoint address="http://localhost:6400/ClientBin/XXX-Web-RIAServices-MyService.svc" binding="basicHttpBinding" bindingConfiguration="LargeData" contract="???">
      <identity>
      </identity>
    </endpoint>
  </service>

I would think it should be something like XXX.Web.RIAServices.IMyService but that interface does not exist in my generated code.

What do I put in the contract attribute?

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

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

发布评论

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

评论(3

永不分离 2024-10-30 18:59:03

对于那些可能使用此方法通过附加设置来配置 DomainService 的人来说,以下是如何增加 ObjectGraph 以允许 WCF RIA 服务在操作期间封送超过默认数量的对象:

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <services>
      <service name="ProjectName.Web.Services.YourDomainService" behaviorConfiguration="ProjectName-Web-Services-YourDomainService"></service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ProjectName-Web-Services-YourDomainService">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <!-- Increase ObjectGraph for larger results -->
          <dataContractSerializer maxItemsInObjectGraph="655360" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

Just for those out there who may use this as a way to config their DomainService with additional settings, here is how you would increase the ObjectGraph to allow WCF RIA Services to marshal more than the default # of objects during an operation:

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <services>
      <service name="ProjectName.Web.Services.YourDomainService" behaviorConfiguration="ProjectName-Web-Services-YourDomainService"></service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ProjectName-Web-Services-YourDomainService">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <!-- Increase ObjectGraph for larger results -->
          <dataContractSerializer maxItemsInObjectGraph="655360" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>
最初的梦 2024-10-30 18:59:03

我认为,合约应该是扩展 DomainService 的类。

The contract should be the class that extends DomainService, I think.

如梦初醒的夏天 2024-10-30 18:59:03

我通过完全删除端点元素解决了这个问题。所以它变成了:

<service behaviorConfiguration="XXX.Web.RIAServices.MyServiceBehavior" name="XXX.Web.RIAServices.MyService">

基本上我只需要让 enpoint 在运行时动态生成。

I solved it by removing the endpoint element entirely. So it became just:

<service behaviorConfiguration="XXX.Web.RIAServices.MyServiceBehavior" name="XXX.Web.RIAServices.MyService">

Basically I just need to let the enpoint get generated dynamically at runtime.

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