谁能向我解释"DataMember"的用途是什么? ServiceContrac接口内的属性 [英] Can anyone Explain to me What is the use of "DataMember" attribute inside a ServiceContrac interface
问题描述
在接口中,我可以编写属性而无需实现,但是在wcf中它会如何工作以及它的用途是什么.在客户端使用服务时 我只能访问以OperationContract装饰的方法.我无法访问DataMember属性.那么,服务合同中Datamember的用途是什么.
In interface i can write properties without implementation but in wcf how it will behave and what is its uses.In the client side while consuming the service i ca access only the methods which are decorated with operationcontract .I can'nt access the DataMember properties.Then what is the use of Datamember inside a servicecontract.
Latheesh K联系电话:+ 91-9747369936
Latheesh K Contact No:+91-9747369936
推荐答案
WCF不允许以您想要的方式使用属性,因为它违反了SOAP要求.
WCF does not allow to use properties the way you want because it breaches SOAP requirements.
您只能使用方法.
这篇关于谁能向我解释"DataMember"的用途是什么? ServiceContrac接口内的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!