0

I have a web service that is used by third parties to access various bits of functionality for the company I work for. This web service is using another web service within the company to send email, and this is the error we're receiving on particularly long emails - "The maximum string content length quota (8192) has been exceeded while reading XML data."

I've already read through the question and answers here, but with no luck. I've modified the readerQuotas on the basicHttpBinding element of my web.config file, and I'm still receiving this error. Modifying the server's (where the web service I'm calling resides) is a no-go, since this issue isn't happening with any other clients using the service, and this is in an enterprise environment. I'm able to call this service outside of my own service, using the exact same content, with success. It's just when I'm calling my service which calls the email service that the error appears.

Does anyone have any suggestions at all? I'm at a standstill, and am tired of bashing my head against this. My only thought right now is to modify the config file for the email service, but there's only one within the company and it's a production service, so that's nigh impossible just to test and see if this resolves my issue.

Thanks,

T.J.

Edit: Relevant config sections

Client

<endpoint address="https://foo.domain/MailService.asmx"
    binding="basicHttpBinding" bindingConfiguration="MailServiceSoap"
    contract="MailService.MailServiceSoap" name="MailServiceSoap" />

<basicHttpBinding>      
    <binding name="MailServiceSoap"  maxReceivedMessageSize="2147483647"
        maxBufferSize="2147483647" openTimeout="00:10:00" receiveTimeout="00:10:00"
        sendTimeout="00:10:00" closeTimeout="00:10:00">
    <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647"
        maxNameTableCharCount="2147483647" />
    <security mode="Transport">
        <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
        <message clientCredentialType="UserName" algorithmSuite="Default"/>
    </security>
    </binding>
</basicHttpBinding>

Server

Working on this still. I don't have any access to it.

Community
  • 1
  • 1
tjsimmons
  • 733
  • 4
  • 10
  • 21
  • Show us the relevant sections of your config files (client and server). – EkoostikMartin Dec 02 '13 at 20:36
  • You need to post the web.config file with the client configuration. My guess is the client is not using the binding configuration. (Binding type not matching client binding, or names not matching bindingconfiguration param.) – Wouter Simons Dec 02 '13 at 20:41
  • Hi guys, just added in the relevant section from my client's config file. – tjsimmons Dec 02 '13 at 20:48
  • I know in TSQL have to user a Reader to get the XML in chunks. – paparazzo Dec 02 '13 at 20:50
  • My money is on the service's binding. The client config looks ok, but the binding defined in the client config has no effect on the binding used in the service's config - i.e,. you can set a high value for MaxStringContentLength in the client config, and the service could still be using the default value (8192). I'm curious to see how the service is configured. – Tim Dec 02 '13 at 22:35
  • The guy who has access to the service's config is apparently out. What I do know is that using a tool like Web Service Studio, I can call the service directly and I don't get this error. But when I call the service from my client, I get it. – tjsimmons Dec 03 '13 at 15:08

2 Answers2

0

Is it possible you might be overwriting your config settings programmatically, or have you tried setting them programmatically? Just a thought.

Miles Watson
  • 169
  • 1
  • 8
0

I found my solution, and it was here. I got so caught up in the thinking that it was between my service and the service I was calling, when it was actually completely separate. My service wasn't set up to handle messages that long. The top answer in the linked post had the information that clued me in - namely, the server deserializes data, while the client reads data. My error was around deserializing the data, meaning my server was the issue. I extended the length of the readerQuotas in the binding element for my service, and problem was solved.

Community
  • 1
  • 1
tjsimmons
  • 733
  • 4
  • 10
  • 21