消息合约对数据合同的优势是什么? [英] What is advantage of Message contract over data Contract

查看:73
本文介绍了消息合约对数据合同的优势是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



当我们已经拥有与服务交换参数的数据合同时,使用消息合同的优势是什么。我们可以使用数据集来代替使用消息合同。

1.为什么我们更喜欢消息合约而非数据合约?

2.为什么我们使用消息合约而不是数据集?

3.when去邮件合同?

4.如何在消息合约中定义ref和out参数?

解决方案

DataContracts用于描述服务使用的数据类型。由此可以实现互操作性,因为它在后台使用服务的元数据.DataContracts可用于描述参数或返回值。



MessageContracts用于SOAP格式。我们可以在这里有消息标题和其他元素



查看此链接以了解我们为什么必须使用消息合同。

http://izlooite.blogspot.in/2010/01/wcf-why-use-messagecontract -when.html [ ^ ]



http:// wcftutorial。 net / Message-Contract.aspx [ ^ ] < br $> b $ b

查看以下链接,了解如何在邮件合同中定义ref和out参数。

http://www.diranieh.com/net_wcf/serialization.htm [ ^ ]

这个问题与询问电机相对于齿轮箱有什么优势完全相同。除了你的问题,它没有意义:汽车不会去。 :-)



-SA


Hi Guys,

What is advantage of using message contract when we already have data contract for exchanging parameter with service.Instead of using message contract we can use dataset.
1.Why we prefer message contract over data contract?
2.why we use message contract instead of dataset?
3.when to go for message contract?
4.how to define ref and out parameter in message contract?

解决方案

DataContracts are used to descibe the data types used by a service. Interoperability is possible through this since it uses metadata of the services in background.DataContracts can be used to describe either parameters or return values.

MessageContracts are used for the SOAP formats. We can have message header and other elements over here

Check this link to know why we have to use message contract.
http://izlooite.blogspot.in/2010/01/wcf-why-use-messagecontract-when.html[^]

http://wcftutorial.net/Message-Contract.aspx[^]

Check the below link to know how to defin ref and out parameter in message contract.
http://www.diranieh.com/net_wcf/serialization.htm[^]


This question is exactly the same as asking "What is the advantage of the motor over the gear box". As well as your question, it does not make sense: the car won't go. :-)

—SA


这篇关于消息合约对数据合同的优势是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆