如何从 Windows 客户端使用 JSON Web 服务

发布于 2024-07-09 05:08:44 字数 98 浏览 6 评论 0原文

是否可以从标准代理客户端(即不是 JavaScript)使用启用 JSON 的 WCF Web 服务?

基本上我想最小化 2 个 Web 服务之间的有效负载大小。

Is it possible to consume a JSON enabled WCF Web Service from a standard Proxy Client (i.e. not JavaScript)?

Basically I want to minimize the payload size between 2 web services.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静谧 2024-07-16 05:08:44

是的,如果客户端的服务接口定义设置正确(即操作契约上的 WebGet/WebInvoke 属性的 RequestFormat/ResponseFormat 属性设置为 Json。另请记住,您需要使用 WebHttp 或 请注意,考虑到 WCF 中的当前实现,

JSon 不一定是最有效的;您需要做出一定的权衡,本文

Yes, it is, if the service interface definition on the client side is setup correctly (i.e. the RequestFormat/ResponseFormat properties of the WebGet/WebInvoke attribute on the operation contracts are set to Json. Also remember you'll need to use the WebHttp or WebScriptEnabled behaviors on your client.

Notice that JSon won't necessarily be most efficient given the current implementation in WCF; there are definite trade offs you'll be making. There's a good overview of it on this article.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文