简体   繁体   English

消耗ASP.net的WCF Soap / Rest服务

[英]ASP.net consuming WCF Soap/Rest Services

I have an ASP.net website which currently consumes a WCF service with a SOAP Protocol which is hosted to Azure Cloud Services. 我有一个ASP.net网站,该网站当前使用带有SOAP协议的WCF服务,该服务托管在Azure云服务中。

I have then exposed that WCF Service as both Rest and Soap. 然后,我将WCF服务同时作为Rest和Soap公开。 (for other clients that wanted Json) (对于其他需要Json的客户)

I have tried to configure the reference of the ASP.net site to support the existing soap endpoint of this WCF Service but I keep getting errors of missing object references, while my client calls work just fine. 我试图配置ASP.net站点的引用以支持此WCF服务的现有soap端点,但是当我的客户端调用正常运行时,我不断收到丢失对象引用的错误。

I ve done some research but still I dont have a clear view on this. 我已经做过一些研究,但是我对此仍然没有明确的看法。

Is this possible to maintain-stick to Soap Service Reference when a Rest coexists-or is it better to consume the Rest endpoint and modify my code according to Rest HTTP Requests? 当Rest共存时,是否可以坚持使用Soap Service Reference?还是更好地使用Rest终结点并根据Rest HTTP请求修改我的代码?

Beauty of WCF is to implement once and deploy (or host) in various protocol (as a different endpoint). WCF的优点是一次实现并以各种协议(作为不同的终结点)进行部署(或托管)。

In your case if you have ASP.Net app which is currently consuming the WCF service with SOAP, its totally possible to expose the existing WCF service as a REST service without affecting the existing ASP.net App. 在您的情况下,如果您有ASP.Net应用程序当前正在使用SOAP来使用WCF服务,则完全有可能将现有WCF服务公开为REST服务而不会影响现有ASP.net App。

I have personally made one WCF service which was consumed by 3 App and all were consumed in a different protocol. 我亲自制作了一项WCF服务,该服务由3 App占用,而所有服务都以不同的协议使用。 Windowp app consumed it in tcp, while asp.net did in REST and a Php app did in SOAP. Windowp应用程序在tcp中使用它,而asp.net在REST中使用,而Php应用在SOAP中使用。 Refer to this post to get more clarity. 请参阅这篇文章以获得更多的清晰度。

Share the specific inner exception of the issue you faced, so that I can help further. 分享您所遇到问题的特定内部例外情况,以便我提供进一步的帮助。

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

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