简体   繁体   中英

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

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>

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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