I’m working with an existing Service and can’t sort out why its not using a custom configuration.
My service class looks like this:
[ServiceBehavior(Name = "MagicService",Namespace = Namespaces.NS_Magic_ADMIN_SERVICE, ConfigurationName = "MagicServiceConfiguration")]
public class MagicService : IMagicService
Service config:
<service name="MagicServiceConfiguration" behaviorConfiguration="MagicServiceBehavior">
<endpoint address=""
name="httpAdminServiceSEP"
binding="basicHttpBinding"
bindingName="basicMemberBinding"
bindingNamespace="http://magic-service.me.com/admin/2010/04/"
contract="Me.Manager.Magic.Contracts.Behavior.IMagicService">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
Binding:
<basicHttpBinding>
<binding name="basicMemberBinding"
receiveTimeout="00:10:00"
sendTimeout="00:10:00"
openTimeout="00:10:00"
closeTimeout="00:10:00"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647">
</binding>
</basicHttpBinding>
I keep getting the good old: “There was an error deserializing the object of type System.String. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 81, position 80”
Whenever I add a service reference it automatically adds uses the default 8196 lengths.
If I remove the service config nothing changes. Still throws out the length exception.
You need to reference your binding settings by using the
bindingConfiguration=attribute on your<endpoint>– not thebindingName=one: