This project has moved. For the latest updates, please go here.

WSDL Extensions

Configuration

1. Declare that you're using the WSDL Extras extension by adding this section to your config file:

<behaviorExtensions>
  <add name="wsdlExtensions" type="WCFExtrasPlus.Wsdl.WsdlExtensionsConfig, WCFExtrasPlus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</behaviorExtensions>


2. Add an endpointBehavior section and give it a name. Inside the behavior, add a wsdlExtensions node and configure the options you want to use. Without any options, WCFExtrasPlus will import external references to reduce the number of separate files that defined your WSDL. This is similar to the single file option, but will work for WSDLs with more than one namespace.
  • To override the endpoint URL, set the location attribute to a url of your choice.
  • To render the WSDL file so that it does not contain external references and is defined in a single file, set the singleFile attribute to true.

<endpointBehaviors>
  <behavior name="Sample.WsdlSampleEndpointBehavior">
    <wsdlExtensions location="http://127.0.0.1/Sample/WsdlSample.svc" singleFile="true"/>
  </behavior>
</endpointBehaviors>


3. Configure your endpoint(s) to use the endpoint behavior:

<service behaviorConfiguration="Sample.WsdlSampleBehavior" name="Sample.WsdlSample">
  <endpoint address="" behaviorConfiguration="Sample.WsdlSampleEndpointBehavior" ... />
</service>


See the Web.config file in the SampleServer for a sample configuration.

Last edited Apr 17, 2011 at 5:34 AM by crjansen, version 2

Comments

hellosri Dec 6, 2016 at 9:10 AM 
Step 1 looks like this for the latest version as of Dec 2016.
<behaviorExtensions>
<add name="wsdlExtensions" type="WCFExtrasPlus.Wsdl.WsdlExtensionsConfig, WCFExtrasPlus, Version=2.4.0.6, Culture=neutral, PublicKeyToken=f8633fc5451b43fc" />
</behaviorExtensions>

RaduTerec Sep 30, 2016 at 2:45 PM 
And now, the tag should look like this: <add name="wsdlExtensions" type="WCFExtrasPlus.Wsdl.WsdlExtensionsConfig, WCFExtrasPlus, Version=4.0.30319.0, Culture=neutral, PublicKeyToken=f8633fc5451b43fc" />

mellamokb Apr 24, 2014 at 5:39 PM 
Step 1 is incorrect. It actually needs to be <add name="wsdlExtensions" type="WCFExtrasPlus.Wsdl.WsdlExtensionsConfig, WCFExtrasPlus, Version=2.3.1.8201, Culture=neutral, PublicKeyToken=f8633fc5451b43fc"/>