消费托管的iis Web服务 [英] Consuming hosted iis web services
本文介绍了消费托管的iis Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我想知道如何在.net中使用托管的iis Web服务(打印pdf文件方法)
如果有人知道带有示例的帖子.
感谢U.
Hello every body
i want to know how to consuming hosted iis web service(print pdf file method) in .net
if any one know post with example.
Thank U.
推荐答案
通常,使用Web服务"的概念意味着充当服务的客户端/用户,并且不依赖于服务的方式托管或其他详细信息.重要的是URI,客户端使用的接口集和代理.
使用.NET客户端使用Web服务的基本步骤包括:
- 获取有关应如何使用服务的WSDL文件和文档.
请参见 http://en.wikipedia.org/wiki/WSDL [ ^ ].并不是真正需要WSDL语言知识.好的Web服务器可以从同一站点提供WSDL文件的下载,但这不是必需的.- 运行.NET实用程序WSDL.EXE可以为Web Service生成客户端代理.如果可以使用"Visual Studio命令提示符"( http://msdn.microsoft.com/zh-CN我们/library/ms229859.aspx [ ^ ]).
有关此实用程序的描述和命令行参数,请参见 ^ ].- WSDL的参数. EXE包含用于生成代理文件,名称空间和输出文件名的计算机语言.获得具有所需参数的源代码代理文件后,请将其包含在您的客户端项目中.
- 使用生成的代码的构造函数之一实例化服务的顶级对象.您可能需要将URI传递给构造函数或使用代理代码中生成的URL.在其他情况下,您可能需要格式化URI来设置身份验证参数(用户名,密码),以将参数化的URI传递给构造函数.这是一种不好的样式,但是某些服务是这样的.
- 利用您对从文档和其他来源中获取的特定Web Service语义的理解,调用在上一个构建的类实例上的方法.步骤.
- 获利!
Normally, the notion "consuming a Web Service" means acting as a client/user of a Service, and it does not depend on how the Service is hosted or other detail. What does matter is the URI, the set of interfaces and a proxy used on the client side.
Basic steps of consuming a Web Service using .NET client include:
- Obtain WSDL file(s) and documentation on how the Service(s) should be used.
See http://en.wikipedia.org/wiki/WSDL[^]. The knowledge of WSDL language is not really required. A nice Web Server can provide downloading of the WSDL file(s) from the same site, but this is not required.- Run the .NET utility WSDL.EXE to generate a client proxy for a Web Service; if can be done using "Visual Studio Command Prompt" (http://msdn.microsoft.com/en-us/library/ms229859.aspx[^]).
For description and command line parameters of this utility, see http://msdn.microsoft.com/en-us/library/7h3ystb6%28v=VS.100%29.aspx[^].- Parameters of WSDL.EXE include computer language to generate a proxy file, name space and output file name. When a source code proxy file with desired parameters is obtained, include it in your client project.
- Instantiate the top-level object of a service using one of the constructors of the generated code. You may need to pass URI to the constructor or use the URL generated in the code of the proxy. In other cases, you may need to format a URI to set up authentication parameters (user name, password) to pass the parametrized URI to the constructor. This is a bad style, but some Services are like that.
- Using your understanding of semantic of a particular Web Service taken from documentation and other sources, call the methods on the class instance(s) constructed on previous step.
- PROFIT!
通常正常工作.
这篇关于消费托管的iis Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文