Which C# SOAP Client Library is easiest to use?

被刻印的时光 ゝ 提交于 2019-11-28 05:00:15

问题


I would like to connect to a SOAP web service using C#. Before I jump right in, trying anything Google throws at me I would like to ask what is the cleanest and best way to do it where most of the work is done for me.

I would like a high level method, where I give it a WSDL and it will basically handle a lot of things for me. I of course don't want to have to do any of the XML, except to see what it is doing to debug.

What is the nicest fanciest library/method that Microsoft has for doing this? Notice that I'm more concerned with optimizing developer time over performance, though there probably isn't much difference in this situation.

Here is a better explanation of what I'm trying to accomplish. a better OOP approach to multiple SOAP web services


回答1:


What Assaf said. You have the choice between using a Web reference (wrapper around WSDL.exe) and using a Service reference (wrapper around svcutil.exe). Service references are .NET 3.0+ and part of the WCF way of doing things.

Personally I still use Web references most of the time, but YMMV.

Edit: screenshot of the two menu options :)




回答2:


That's what Web References in C# projects do. When you add a web reference it parses the WSDL and creates strongly typed classes for the API.




回答3:


No need for any fancy library... This is built-in functionality... Just add a Service Reference to your project right from the context menu in Visual Studio.



来源:https://stackoverflow.com/questions/963794/which-c-sharp-soap-client-library-is-easiest-to-use

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!