I'm developing a web application using MVC4 with C#.
I need to send PDFs via AJAX, so I convert them to base64 and send them to a function in C#. That function is going to call another function that is on a web service.
The problem is, the web service function is not getting the base64 string because it's very large, but not TOO large, its about 111,000 characters, like 70kb. I get error 413
pdfCony is my base64 string
I have already set the maxRecievedMesage in my web.config on the web service:
<bindings>
<basicHttpBinding>
<binding name="basicHttpsBinding" maxReceivedMessageSize="524288000" />
<binding name="mexHttpBinding" maxReceivedMessageSize="524288000" />
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ServicioCCMasAvalBehavior" name="ServicioCCMasAval.ServicioCCMasAval">
<endpoint address="/" binding="basicHttpBinding" contract="ServicioCCMasAval.IServicioCCMasAval" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
So i don't know what is the problem. Help please.
Thanks a lot. But I found the solution looking in another web.config example
This was my web.config:
<bindings>
<basicHttpBinding>
<binding name="basicHttpsBinding" maxReceivedMessageSize="524288000" />
<binding name="mexHttpBinding" maxReceivedMessageSize="524288000" />
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ServicioCCMasAvalBehavior" name="ServicioCCMasAval.ServicioCCMasAval">
<endpoint address="/" binding="basicHttpBinding" contract="ServicioCCMasAval.IServicioCCMasAval" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
I was missing the bindingConfiguration on the enpoint. Now this is my working webconfig:
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding" maxReceivedMessageSize="524288000" />
<binding name="mexHttpBinding" maxReceivedMessageSize="524288000" />
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ServicioCCMasAvalBehavior" name="ServicioCCMasAval.ServicioCCMasAval">
<endpoint address="/" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding" contract="ServicioCCMasAval.IServicioCCMasAval" />
</service>
</services>
Realy really thanks a lot.