Question

I have a wcf web service and I need to provide the client with the wsdl files.

Previously I used svcutil on the .dll and everything was fine.

However, recently I implemented the factory to Flaten the wsdl file (re: http://wcfextras.codeplex.com/).

My questions is this: Is there anyway of either using svcutil on the .svc to extract the Flattened .WSDL files or maybe somehow hit up the web service when it is running in the local webdev server to retrieve the .WSDL files?

As far as I'm aware, if I was to navigate to my local web dev server (http://localhost:2916/Service.svc?wsdl) and if i was to view source and saved that as .wsdl that this is wrong and would not provide all the relevant information.

note: See below for how the Factory is used in the .svc file....

<% @ServiceHost Factory="CompanyName.ServiceModel.Extensions.Description.FlatWsdlServiceHostFactory" language=c# Service="CompanyName.WebServices.Service"%> 

Thanks, Steven

Was it helpful?

Solution

Yes, you should still be able to use svcutil to extract the WSDL from your service, even if you have an extension installed that will flatten the WSDL.

To download the metadata document(s) from your running service, use this command:

svcutil /t:metadata http://service/metadataEndpoint

You need to point your URL to the metadata endpoint defined in your config, e.g. the endpoint that's defined to use "mexHttpBinding" or "mexTcpBinding" and the "IMetadataExchange" contract.

If you don't have any metadata exchange endpoints defined, you won't be able to retrieve that information, obviously.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top