如何从webservice中检索数据 [英] How to retrive data from webservice
本文介绍了如何从webservice中检索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好!
有人可以向我解释如何从桌面应用程序中的SAOP webservice中检索数据!
我有一段代码但是没有用!
网络服务包含搜索数据的查询!
我不知道怎么做?
请帮帮我?
解决方案
请参阅我对该问题的评论。你的代码没有任何意义。
你需要:
- 使用WDSL.EXE创建一个C#中服务的代理代码: http://msdn.microsoft.com/en-us/library/ 7h3ystb6.aspx [ ^ ];
- 在生成的代码中,找到派生自类
System.Web.Services.Protocols.SoapHttpClientProtocol
的类;这是您需要实例化的类;- 实例化它;
- 通过代理实例,调用Web方法。
如果问题不明确,请在询问下一个问题之前:
- 搜索: http://bit.ly/T24XqT [ ^ ];
- 了解Web服务:
http://en.wikipedia.org/wiki/Web_services [ ^ ],
http://en.wikipedia.org/wiki/SOAP [ ^ ],
< a href =http://en.wikipedia.org/wiki/WSDL> http://en.wikipedia.org/wiki/WSDL [ ^ ];- l至少获得编程的基础知识:类型和实例(对象);类,结构和接口,接口实现,以及......更多。
-SA
Hello !
Can some one explain me how to retrive data from SAOP webservice in desktop app!
I have a piece of code but is not working!
the web service contain a query for search the data!
I don''t know how to make?
Please help me?
解决方案
Please see my comments to the question. Nothing makes any sense in your code.
You would need to:
- Use WDSL.EXE to create a proxy code for a service in C#: http://msdn.microsoft.com/en-us/library/7h3ystb6.aspx[^];
- In the generated code, locate the class derived from the class
System.Web.Services.Protocols.SoapHttpClientProtocol
; this is the class you need to instantiate;- Instantiate it;
- Through the instance of the proxy, invoke Web methods.
If something is not clear, before asking your next question:
- Search: http://bit.ly/T24XqT[^];
- Learn about Web services:
http://en.wikipedia.org/wiki/Web_services[^],
http://en.wikipedia.org/wiki/SOAP[^],
http://en.wikipedia.org/wiki/WSDL[^];- learn at least the very basics of programming: types and instances (object); classes, structures and interfaces, interface implementations, and… a lot more.
—SA
这篇关于如何从webservice中检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文