RIA Services Domain Service Class web.config setting

落爺英雄遲暮 提交于 2019-12-06 03:53:40

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>

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!