Message or a type that has MessageContractAttribute and other parameters of different types

后端 未结 5 1093
-上瘾入骨i
-上瘾入骨i 2021-02-07 16:13

I\'m developing WCF services where some classes have the [MessageContract] attribute, and some don\'t.

When I try to run the services I get this error mess

5条回答
  •  离开以前
    2021-02-07 16:47

    If you have the issue with mixed types of primitive(such as string) and MessageContract as the other type, i.e. one class as return and a string parameter, one way I solved this was switching from MessageContract to DataContract.

    The other way to solve this would be to create a class to hold your primitive type as a property, so that both your return and parameter can implement MessageContract.

提交回复
热议问题