WCF Service Reference - Getting “XmlException: Name cannot begin with the '<' character, hexadecimal value 0x3C” on Client Side

后端 未结 6 1624
醉梦人生
醉梦人生 2021-02-03 23:54

I have a smart client application communicating with its server via WCF. Data is created on the client and then sent over the service to be persisted. The server and client use

6条回答
  •  迷失自我
    2021-02-04 00:07

    Ok just came across another scenario on this one. I had a Serializable type used as a parameter for one of my Operation Contract methods.

    Commenting out this specific method from use allowed me to find the issue. In this case, the parameter was a model deserialized from a file, so I just replaced the implementation with a parameter of byte[] and ran deserialization logic at the other end.

    While not necessarily an answer for all, in the case of parameter types on your Operation Contract methods that are Serializable, you may run into this exception also. I would imagine decorating them with correct DataContract attributes would assist in rectifying this problem.

提交回复
热议问题