Why am I getting this WCF Error Message?

后端 未结 4 1288
长发绾君心
长发绾君心 2021-01-12 04:54

I am getting the error below when I call my WCF service. What am I missing here?

\'System.String[]\' with data contract name
\'ArrayOfstring:http://schemas.         


        
4条回答
  •  北荒
    北荒 (楼主)
    2021-01-12 05:31

    Yes. As explained in the previous post, The issue occurs if you pass an array of a Type(which is defined as a DataContract]). you will need to define the array of this class as a seperate type and mark it as data contract.

    Wont Work`

    [DataContract]
    Public class ABC{
    }
    
    ...
    
    SendData(ABC[])
    

    `

    What will work:

    Public class Data{ public ABC[] prop{get;set;}}
    ...
    SendData(Data);
    

提交回复
热议问题