A collection of useful WCF extensions including Soap Header support, WSDL documentation and more.
The WCF platform is very extensible and allows you to easily add features that are not part of the core product.
This project contains some extensions I needed in a WCF based project:
- SOAP Header support for WCF
- Adding WSDL Documentation from Source Code XML Comments
- Override SOAP Address Location URL
- Single WSDL file for better compatibility with older SOAP tools.
SOAP Header support for WCF
WCF does not directly support the SOAP Header model introduced by asmx web services. Altough WCF allows you to work with SOAP headers using a message contract based programming model, it is sometimes easier to keep the more intuitive operation contract model but still expose SOAP headers and be able to access them inside WCF calls. The SoapHeader attribute introduced in the project allows you to use SOAP headers in code while still using the Operation Contract based model. Release 2.0 also includes a client side WSDL importer that customizes the WSDL import process and creates a client proxy which greatly simplifies the process of sending and receiving Soap Headers.
Adding WSDL Documentation from Source Code XML Comments
This extension allows you to add WSDL documentation (annotaiton) directly from XML comments in your source file. These comments will be published as part of the WSDL and are available for WSDL tools that know how to take advantage of them (e.g. Apache Axis wsdl2java and others). Release 2.0 also includes a client side WSDL importer that will turn those WSDL comments to XML comments in the generated proxy code.
Override SOAP Address Location URL
The need for this extensions came from a specific scenario where an IIS hosted WCF service was located behind a load balancer\SSL accelerator (F5 in this case) which handled the SSL traffic and passed all communication in http to the web server. After all configrations were done and the service was working correctly when accessed by client talking to the F5 box, the only problem left was that the resulting WSDL file contained an endpoint with an HTTP address instead of HTTPS. This extensions allows you to set the URL that will be rendered in the WSDL (in this case to simply replace the http url with an https url).
Single WSDL file
Some older SOAP toolkits fail when trying to import a WSDL file that contains references to external .xsd files. This extensions simply merges the external types into the wsdl file and produces a single flat wsdl file that contains all the definitions it needs.