简体   繁体   English

如何生成wcf服务库项目的wsdl文件?

[英]How to generate a wsdl file of a wcf service library project?

I have a few Wcf service library projects (not Wcf service application) in my solution. 我的解决方案中有一些Wcf服务库项目(不是Wcf服务应用程序)。 I have to give the .wsdl files of the projects to my collegue who will consume the services. 我必须将项目的.wsdl文件提供给我的同事,他们将使用这些服务。

How can I do that? 我怎样才能做到这一点?

Thanks in advance, 提前致谢,

You can use the WCF Service Host to start a new instance of your service, and then add ?wsdl to the service address to access the wsdl ( http://localhost:1234/MyService.svc?wsdl for instance). 您可以使用WCF服务主机启动服务的新实例,然后将?wsdl添加到服务地址以访问wsdl(例如, http://localhost:1234/MyService.svc?wsdl )。

WcfSvcHost's syntax is the following: WcfSvcHost的语法如下:

WcfSvcHost.exe /service:<PathToServiceDLL> /config:<PathToServiceConfig>

Follow these steps: 跟着这些步骤:

  1. Go to IIS add new application under the default web site.(alias:test physicalPath: c:\\test), dont press test connection 转到IIS在默认网站下添加新应用程序。(别名:test physicalPath:c:\\ test),不要按测试连接
  2. On your wcf project right click and run publish choose your new application on IIS. 在您的wcf项目上右键单击并运行发布,在IIS上选择您的新应用程序。
  3. Goto IIS to test application, right click on the svc file and browse - its open IE. 转到IIS测试应用程序,右键单击svc文件并浏览 - 它打开IE。
  4. On the url address on the IE add to the address ?wsdl. 在IE上的url地址添加到地址?wsdl。 and ENTER it. 并输入它。

good luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM