tags:

views:

74

answers:

2

Hi All,

Kindly let me know how to create WSDL for a WCF service programmatically.

Thanks & Regards, Priya.R

A: 

I don't think this is possible, other than programmatically using svcutil.exe to achieve the task.

Chris O
A: 

You can use the MetadataSet and WsdlImporter classes to do this if you have a mex endpoint exposed for whatever service it is that you are trying to generate WSDL against.

If the service you are trying to generate WSDL for is compiled code, you should be able to make use of svcutil for that.

MattK
Thanks for your reply. Could you please elaborate on creating a wsdl using wsdlimporter or a link to the document on the same.
priya
If you take a look on the MSDN page for WsdlImporter, the sample they have should show you how to get the metadata from the endpoint. After that, the WsdlDocuments property on the importer should be what you are looking for (http://msdn.microsoft.com/en-us/library/system.servicemodel.description.wsdlimporter.wsdldocuments(v=VS.100).aspx).
MattK