Customize a WCF RIA Services Endpoint

Posted by Andrew Garrison on Stack Overflow See other posts from Stack Overflow or by Andrew Garrison
Published on 2010-06-11T18:49:23Z Indexed on 2010/06/14 15:12 UTC
Read the original article Hit count: 388

Is it possible to customize the parameters of a WCF RIA Services endpoint? Specifically, I would like to create a custom binding for the endpoint and increase the maxReceivedMessageSize to allow sending the contents of a file that is a few megabytes in size.

I've tried meddling in the web.config, but I'm getting the following error:

[InvalidOperationException]: The contract name MyNamespace.MyService could not be found in the list of contracts implemented by the service MyNamespace.MyService

web.config

<system.serviceModel>
  <bindings>
    <customBinding>
      <binding name="CustomBinaryHttpBinding">
        <binaryMessageEncoding />
        <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
      </binding>
    </customBinding>
  </bindings>
  <services>
    <service name="MyNamespace.MyService">
      <endpoint address="" binding="wsHttpBinding" contract="MyNamespace.MyService" />
      <endpoint address="/binary" binding="customBinding" bindingConfiguration="CustomBinaryHttpBinding" contract="MyNamespace.MyService" />
    </service>
  </services>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>

© Stack Overflow or respective owner

Related posts about silverlight-4.0

Related posts about web.config