Content Type application/soap+xml; charset=utf-8 was not supported by service

后端 未结 17 2327
长发绾君心
长发绾君心 2020-12-15 02:54

I am getting the error below while trying to add WCF service to WCFTestClient. I went through a number of solutions on the web but I couldn\'t get it to work.

Can

17条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-15 03:07

    My problem was our own collection class, which was flagged with [DataContract]. From my point of view, this was a clean approach and it worked fine with XmlSerializer but for the WCF endpoint it was breaking and we had to remove it. XmlSerializer still works without.

    Not working

    [DataContract]
    public class AttributeCollection : List>
    

    Working

    public class AttributeCollection : List>
    

提交回复
热议问题