WCF: generic list serialized to array

后端 未结 5 863
醉话见心
醉话见心 2021-01-03 11:27

So I am working with WCF and my services return types that contain generic lists. WCF is currently converting these to arrays over the wire. Is there a way I configure WCF t

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-03 12:01

    In addition, take care not to have both arrays and generics in the classes from which you serialize the instances with WCF, because you'll get a problem during deserialization : everything will be converted either to ArrayOf (if you don't change the configuration) or to Collection Type.

    As result you will get errors during deserialization from the WCF code trying to assign an array where you wait a Collection and conversely.

    This was just my 2cent advice from what I learned during a small project with WCF. :)

提交回复
热议问题