I am coding a WCF service using json that is currently executing in a console app for debugging/testing. Once completed this WCF service will be executing as a Windows Service. The WCF service will be consumed by a Windows Form app and an Android app.
My latest change added 2 operation contracts that will pass image data in request and reply messages.
During testing of these new operation contracts, if I attempt to pass a large image file, I receive this exception:
'The remote server returned an error: (413) Request Entity Too Large.'
In researching this exception I found lots of threads explaining how to correct it. During my initial debugging/testing, I was not specifying an endpoint in my app.config file. To add the basicHttpBinding information to increase the size limits, I found that I also needed to add an endpoint. Once I did this, I started receiving this exception for ALL of my operation contracts:
System.Net.WebException: 'The remote server returned an error: (400) Bad Request.'
I do not understand why I receiving this 400 Bad Request exception.
Here is the servicemodel section from my app.config.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="MyBasic" maxReceivedMessageSize="2147483647"
maxBufferPoolSize="2147483647" maxBufferSize="2147483647" />
</basicHttpBinding>
</bindings>
<services>
<service name="StampTrackerServiceLibrary.StampTrackerService">
<endpoint address="http://LocalHost:9091/StampTrackerService" binding="basicHttpBinding"
bindingConfiguration="MyBasic" contract="StampTrackerServiceLibrary.IStampTrackerServiceLibrary"/>
</service>
</services>
</system.serviceModel>
Can anyone provide any assistance in determining what I am doing incorrectly?
I have researched both 413 and 400 exceptions and attempted to solve my issues.