I am at a loss... not sure exactly why this is happening. I have gone through at least 50 pages in Google and scoured StackOverflow for this answer. When I run this code I keep getting the error message:
"There was a an error while trying to deserialize parameter http://tempuri.org/:message. The InnerException message was 'There was an error deserializing the object of type Application.Interfaces.Mail.MailMessage. 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.'"
Here is what I have on the WCF service (server):
<system.serviceModel>
<services>
<service behaviorConfiguration="SimpleServiceBehavior" name="Application.Services.Mail.Mailer">
<host>
<baseAddresses>
<add baseAddress="http://myapp.com/"/>
</baseAddresses>
</host>
<endpoint bindingConfiguration="BasicHttpBinding_IMailer" bindingName="BasicHttpBinding_IMailer" binding="basicHttpBinding" address="http://myapp.com/" contract="Application.Services.Local.Mail.IEmailer">
<identity>
<dns value="myapp.com"/>
</identity>
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="SimpleServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMailer" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="800000" maxBufferPoolSize="800000" maxReceivedMessageSize="800000" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="800000" maxStringContentLength="800000" maxArrayLength="800000" maxBytesPerRead="800000" maxNameTableCharCount="800000" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
And what I have on the client side:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMailer" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="5242880" maxBufferPoolSize="524288" maxReceivedMessageSize="5242880" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://myapp.com/Mail/Mailer.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMailer" contract="Interfaces.Mail.IEmailer" name="BasicHttpBinding_IMailer"/>
</client>
</system.serviceModel>