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

☆樱花仙子☆ 提交于 2020-02-01 04:34:05

问题


I have a few Wcf service library projects (not Wcf service application) in my solution. I have to give the .wsdl files of the projects to my collegue who will consume the services.

How can I do that?

Thanks in advance,


回答1:


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).

WcfSvcHost's syntax is the following:

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



回答2:


Follow these steps:

  1. Go to IIS add new application under the default web site.(alias:test physicalPath: c:\test), dont press test connection
  2. On your wcf project right click and run publish choose your new application on IIS.
  3. Goto IIS to test application, right click on the svc file and browse - its open IE.
  4. On the url address on the IE add to the address ?wsdl. and ENTER it.

good luck



来源:https://stackoverflow.com/questions/9128672/how-to-generate-a-wsdl-file-of-a-wcf-service-library-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!