This could be due to the service endpoint binding not using the HTTP protocol

前端 未结 22 2332
梦谈多话
梦谈多话 2020-12-22 23:10

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

相关标签:
22条回答
  • 2020-12-22 23:56

    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

    0 讨论(0)
  • 2020-12-22 23:58

    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.

    0 讨论(0)
  • 2020-12-22 23:59

    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.

    0 讨论(0)
  • 2020-12-23 00:05

    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:

    0 讨论(0)
  • 2020-12-23 00:05

    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,

    0 讨论(0)
  • 2020-12-23 00:07

    This could be due to many reasons; below are few of those:

    1. If you are using complex data contract objects(that means custom object with more child custom objects), make sure you have all the custom objects decorated with DataContract and DataMember attributes
    2. 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).

    3. Make sure all your data contract object properties have both get and set properties.

    0 讨论(0)
提交回复
热议问题