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

后端 未结 5 1099
-上瘾入骨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:40

    No, it means that you have multiple parameters on the method and some of them are not messages. Try posting the interface to your service.

    This blog post explains:

    ... problem is that message contracts cannot be used at the same time as other parameter types. In this case, the return value of the operation is a string. Return values are just another output parameter, so this operation is mixing a message contract message with a primitive parameter type. This fails because message contracts give you control of the layout of the SOAP message, preventing the system from melding in these additional parameters.

    Important note:

    By the way, the error message you get when you try to mix message contracts looks like this.

提交回复
热议问题