by Stever B
17. February 2010 08:02
I apologize it has taken so long for me to post this, but as promised, here is the .cs file for the wsdl flattener.
FlatWSDL.cs (10.75 kb)
To use it, you need to modify your web config and add a reference to the library in the behavior extensions section:
(YOUR ACTUAL ENTRIES MAY VARY)
<system.serviceModel>
<extensions>
<behaviorExtensions>
<add name="FlatWSDL" type="SteverB.Services.Extensions.FlattenWsdlBehavior, SteverB.Services.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=[something]" />
</behaviorExtensions>
<extensions>
And then to turn it on, modify the service behavior by adding the <FlatWSDL /> tag:
<behaviors>
<serviceBehaviors>
<behavior name="MyBehavior">
<serviceMetadata httpGetEnabled="true"/>
<FlatWSDL />
</behavior>
</serviceBehaviors>
</behaviors>
I hope that helps someone!