简体   繁体   English

宁静的WCF和绑定

[英]restful wcf and bindings

have some below question about wcf,though visited tones of web pages but could not get the reliable answers. 尽管访问了网页的提示音,但仍无法获得可靠的答案,但对wcf有一些疑问。

it would be great if someone help me out in understanding these concepts. 如果有人帮助我理解这些概念,那就太好了。

a.) what is the valid comparison (REST with SOAP) OR (REST with XML.)? a。)有效的比较是什么(REST与SOAP)或OR(与XML REST)? , as per my understanding (REST with SOAP) is a valid comparison but some posts believes in the later one too. 据我了解(REST with SOAP)是一个有效的比较,但有些帖子也相信后面的内容。

b.) if Rest can use both Json/XML why Soap can not use Json? b。)如果Rest可以同时使用Json / XML,为什么Soap无法使用Json? , since Json is a Notation only. 因为Json仅是一种符号。

c.)in nettcpbinding binding first response will be serialized into Soap(XML) envelope and then encoded into binary format OR there will be no Soap envelope ? c。)在nettcpbinding绑定中,第一个响应将序列化为Soap(XML)信封,然后编码为二进制格式,否则将没有Soap信封? (basically wants to understand difference between serialization and encoding ) (基本上是想了解序列化和编码之间的区别)

Any Example/Link will be highly appreciated. 任何示例/链接将不胜感激。

Thanks In Advance 提前致谢

Without any tons of explanations, here are my answers. 没有任何解释,这是我的答案。

a.) what is the valid comparison (REST with SOAP) OR (REST with XML.)? a。)有效的比较是什么(REST与SOAP)或OR(与XML REST)?

REST VS SOAP. REST VS SOAP。 It's a great debate today. 今天是一场伟大的辩论。 What is important to understand is that they are two completely differents approaches for web services. 重要的是要了解它们是Web服务的两种完全不同的方法。 Both are valid. 两者均有效。 REST seems to be a bit more popular, especially for interop. REST似乎更受欢迎,尤其是对于互操作性。 XML is simply a file format. XML只是一种文件格式。

b.) if Rest can use both Json/XML why Soap can not use Json? b。)如果Rest可以同时使用Json / XML,为什么Soap无法使用Json?

Soap is a contract-based approach. 肥皂是一种基于合同的方法。 Soap introduces WSDL (Web Services Description Language) : this describes your service and its operations - what is the service called, which methods does it offer, what kind of in parameters and return values do these methods have. Soap引入了WSDL(Web服务描述语言):它描述了您的服务及其操作-所谓的服务,提供的方法,这些方法具有什么样的输入参数和返回值。 The best way to ensure message validity& coherence is to use Xml and Xsd. 确保消息有效性和一致性的最佳方法是使用Xml和Xsd。 Json does not provide this feature. Json不提供此功能。 It was also designed around 2000 where Xml was popular. 它也是在2000年左右Xml流行的地方设计的。

c.)in nettcpbinding binding first response will be serialized into Soap(XML) envelope and then encoded into binary format OR there will be no Soap envelope ? c。)在nettcpbinding绑定中,第一个响应将序列化为Soap(XML)信封,然后编码为二进制格式,否则将没有Soap信封?

In every WCF (Soap) bindings, there is a soap enveloppe, because WCF is built on top of it. 在每个WCF(Soap)绑定中,都有一个soap信封,因为WCF是建立在它之上的。 Binary/Text is releveant to message encoding. 二进制/文本不依赖于消息编码。 This specifies how to transfer data across a network between endpoints. 这指定了如何在端点之间通过网络传输数据。 A good explanation is here . 一个很好的解释在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM