在.Net中调用外部Web服务 [英] Calling External Web service in .Net

查看:101
本文介绍了在.Net中调用外部Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我最近开始从事网络服务.并在使用它时遇到一些问题.

1.如果Web服务位于Remote Ftp上,那么我们如何使用/使用它?
2. FTP是否支持SOAP协议?
3. WCFservice和Web服务哪个更好?
4.我们可以从Web服务中调用外部Web服务吗?

谢谢.

Hi,,

I am started working on web service recently. and facing some problems while working with it.

1. If Web service is on Remote Ftp then how we can consume / use it?
2. Does FTP supports SOAP protocol?
3. WCFservice and web service which is better?
4. Can we call external web service from within a web service?

Thanks.

推荐答案

请查看我的答案:

Please see my answers:

  1. 问题不是很清楚.什么是"在远程FTP上的服务"? Web服务本身基于HTTP,该协议与FTP在相同的应用程序级别上(请参阅下面的参考资料).如果只是说要使用FTP来部署或支持Web服务代码和数据,则此问题与服务本身无关;请参阅使用FTP".这完全取决于提供商的设置或相关主机(包括一台正在运行的HTTP服务器)上自己的设置.
  2. 否. SOAP协议是 Application Level 的协议,请参阅:
    http://en.wikipedia.org/wiki/Application_Layer [ http://en.wikipedia.org/wiki/SOAP [ http://en.wikipedia.org/wiki/FTP [
  3. 这是无法比较的另一个例子. Microsoft坚持认为,对于新开发,每个人都应切换到WCF.我同意,您只能使用CLR(.NET,也可以是Mono, http://en.wikipedia .org/wiki/Mono_%28software%29 [ ^ ]).因此,您只使用.NET和Mono,就可以轻松创建应用程序,因为它可以创建分布式多平台(因为Mono实现WCF并支持许多平台,包括Windows,Linux,Max OS X,Android和其他便携式系统,等等).与Web服务相比,具有更好的灵活性和可维护性,并且开销更少.

    但是,在遗留系统和情况下,不能选择.NET或Mono.在这种情况下,您将不得不使用目前越来越普及的Web服务.
  4. 当然,为什么不呢?也许在许多情况下,您需要确保使用外部Web服务的速度足够快,以使您的呼叫服务保持足够的响应速度.
  1. The question is not quite clear. What is "service is on Remote FTP"? The Web service itself is based on HTTP, a protocol on the same Application Level as FTP (please see the references below). If you simply mean using FTP for deployment or support of your Web service code and data, this question is unrelated to the service itself; it totally depends on what your provider''s settings or on your own settings on the related hosts including the one running HTTP server.
  2. No. SOAP protocol is the protocol of the Application Level, please see:
    http://en.wikipedia.org/wiki/Application_Layer[^],
    http://en.wikipedia.org/wiki/SOAP[^].

    FTP is on the application level, too. Please see http://en.wikipedia.org/wiki/FTP[^].

    There for, the problem is not that FTP cannot "implement" SOAP, the problem is that the question does not make certain sense. What would it be? Just having some files served by FTP (this is what FTP does, nothing else; FTP is just like a kind of a file system, remotely accessed) in the SOAP format? This is not what could be called a protocol.
  3. This is yet another example of things which can not compare. Microsoft maintains that for new development everyone should switch to WCF. I agree as soon as you can use only CLR (.NET but can also be Mono, http://en.wikipedia.org/wiki/Mono_%28software%29[^]). So, it you use just .NET and Mono, you can create a distributed multi-platform (because Mono implements WCF and supports many platfroms including Windows, Linux, Max OS X, Android and other portable systems and more) applications much easier, with much better flexibility and maintainability and less overhead than with Web services.

    Nevertheless, there are legacy systems and situation when having .NET or Mono is not an option. In this case, you are bound to Web services which are way more widespread right now.
  4. Sure, why not? Perhaps in many case you need to be sure that using the external Web service is fast enough to keep your calling service responsive enough.



而已.谢谢您的关注.

—SA



That''s it. Thank you for attention.

—SA


这篇关于在.Net中调用外部Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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