问题
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:
- Go to IIS add new application under the default web site.(alias:test physicalPath: c:\test), dont press test connection
- On your wcf project right click and run publish choose your new application on IIS.
- Goto IIS to test application, right click on the svc file and browse - its open IE.
- 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