使用具有 WSDL 和 XSD 文件的 Web 服务 [英] Consuming webservice having WSDL and XSD files
问题描述
我们要求一家公司编写一个我们可以用来获取一些信息的网络服务.他们已经向我们发送了 WSDL 和 XSD 文件.你能告诉我如何使用这些文件来查询数据吗?如果我有一个指向网络服务的链接,我可以很容易地做到这一点.我只提供链接,Visual Studio 会为我生成 Web 参考.之后,我可以像使用普通类一样使用该引用.在这种情况下,我没有链接.上面提到的文件.谢谢.
We've requested a company to write a webservice that we can use to get some information.They have sent us WSDL and XSD files. Could you please tell me how I can use these files to query data? I can do it easily if I have a link to a webservice. I just provide the link and Visual Studio generates web reference for me. After that I can use that reference just like a normal class. In this case I have no link. Just above mentioned files. Thank you.
推荐答案
您可以从 wsdl 文件创建代理(在 Visual Studio 中添加服务引用).您可以在 http://msdn.microsoft.com/en-us 上阅读有关 svcutil 的信息/library/aa347733.aspx,但VS2010允许您在添加服务引用时将wsdl文件放在地址上.
You can create a proxy (add service reference in visual studio) from a wsdl file. You can read about svcutil at http://msdn.microsoft.com/en-us/library/aa347733.aspx, but VS2010 allow you to put a wsdl file on adress when adding service reference.
这篇关于使用具有 WSDL 和 XSD 文件的 Web 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!