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

前端 未结 22 2346
梦谈多话
梦谈多话 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条回答
  •  -上瘾入骨i
    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.

提交回复
热议问题