如何使用本地 WSDL 文件使用 WCF 服务? [英] How can I consume a WCF service using a local WSDL file?

查看:31
本文介绍了如何使用本地 WSDL 文件使用 WCF 服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用基于(最好是单个)wsdl 文件的 WCF 服务.

I need to consume a WCF service based on a (preferably single) wsdl file.

环境是 VS-2008 (sp1),我将使用自定义的添加服务引用"宏来生成错误处理代理.我希望能够通过提供从服务提供商处获得的 WSDL 文件(我不想提供主机 URL)来做到这一点.

The environment is VS-2008 (sp1), and I will be using a customized "Add Service Reference" macro to generate an error handling proxy. I want to be able to do this, by supplying a WSDL file that I get from the service provider (I do not want to supply a host URL).

如何做到这一点?

推荐答案

当然 - 您可以复制 WSDL 的路径+文件名并将其粘贴到 Visual Studio 中的添加服务引用"对话框中(或者只需键入 int完整路径 + WSDL 文件名).

Sure - you can copy the path+filename for the WSDL and paste that into the "Add Service Reference" dialog box in Visual Studio (or just type int the full path + WSDL file name).

或者,您可以使用 svcutil.exe 命令行实用程序将 WSDL 文件转换为您的客户端代理类.

Alternatively, you can use the svcutil.exe command line utility to convert the WSDL file to your client proxy class.

这篇关于如何使用本地 WSDL 文件使用 WCF 服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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