I have a WCF Service running fine on my local machine. I put it on the servers, and I am receiving the following error:
An error occurred while receiv
in my case
my service has function to download Files
and this error only shown up on trying to download Big Files
so I found this answer to Increase maxRequestLength
to needed value in web.config
I know that's weird, but problem solved
if you don't make any upload or download operations maybe this answer will not help you
I was facing the same issue and solved with below code. (if any TLS connectivity issue)
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
Please paste this line before open the client channel.
I've seen this error caused by a circular reference in the object graph. Including a pointer to the parent object from a child will cause the serializer to loop, and ultimately exceed the maximum message size.
I had this problem "This could be due to the service endpoint binding not using the HTTP protocol" and the WCF service would shut down (in a development machine)
I figured out: in my case, the problem was because of Enums,
I solved using this
[DataContract]
[Flags]
public enum Fruits
{
[EnumMember]
APPLE = 1,
[EnumMember]
BALL = 2,
[EnumMember]
ORANGE = 3
}
I had to decorate my Enums with DataContract, Flags and all each of the enum member with EnumMember attributes.
I solved this after looking at this msdn Reference:
I struggled with this for a couple of days and tried every answer from this post and many others and share my solution because symptoms were the same but the problem was different.
The problem was that the app pool was configured with a memory limit and it just get recycled after a variable period of time.
Hope this helps somebody else!
Greetings,
This could be due to many reasons; below are few of those:
If your data contract objects use inheritance, make sure all base classes has the DataContract and DataMember attributes. Also, you need to have the base classes specify the derived classes with the [KnownType(typeof(BaseClassType))] attribute ( check out more info here on this).
Make sure all your data contract object properties have both get and set properties.