Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RIA Services Domain Service Class web.config setting

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?

like image 940
Brent Lamborn Avatar asked Nov 25 '25 20:11

Brent Lamborn


1 Answers

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>
like image 86
Keith Adler Avatar answered Nov 28 '25 16:11

Keith Adler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!