« Cannot get latest BizTalk Services SDK (May 2) working? | Main | Problem with svcutil.exe in Orcas Beta 2 »



Feed You can follow this conversation by subscribing to the comment feed for this post.

Micha#235;l Hompus

This works like a charm if you have only one endpoint. But if I have multiple endpoints the types node will get empty.

Christian Weyer

@ Michael Hompus: Yes, I have an improved version which spits out an exception if there are some 'circumstances' in which there simply cannot be produced a flat WSDL.


Hello Actually I don't really understand the problem here. The basicHttpBinding is fully ws-i compliant to the basic profile 1.1. I checked it myself with soapUI and the ws-i testing tools (http://www.ws-i.org). The schema referencing (therefore not a flatfile) is also defined by the standard and should be understood by soa technogolies which claim to be interoperable... Therefore I would never violate my WSDL with the FlatFileEndpoint...

Ronan Egan

Great example. Now I'm trying to get axis to consume a wsdl when I use wsHttpBinding... I'm currently weighing up if it's best to use WCF or your excellent WSCF project to build a WS for consumption by java clients, any thoughts yourself?

Mark J. Easton

What an excellent example of how to solve a common WCF problem. It's articles like this that make blogs such a useful resource. Good work. M

Ron Cordell

Came across this today in while trying to help a client consume WCF WSDL with their Java stack. Awesome article, many many thanks!

Martin Oss

Thank you very much for the FlatWsdl example. Unfortunately, when i try to generate a proxy using collection type Generic.List, the setting will be ignored, i always get Arrays. Do you have an idea how to fix that? Thanks, Martin.

Christian Weyer

Please get in touch with me via the Contact form and leave your email - we will sort this out.

Tobias Manthey

To use FlatWSDL in a IIS based WebServices a few lines of code must be added. See http://my-tech-talk.blogspot.com/2008/07/adding-flatwsdl-to-wcf-webservice.html


Thanks C, this looks great. But what should the contents of the FlatWSDL class be?

Graham MacDonald

I'm attempting to use this approach to overwrite the published endpoint address for my service. The service is hosted on machine behind a load balancer and I need to change both the address and port (address can be managed by host headers but I can't find a solution for the port). Is the address contained in the exporter's GeneratedWsdlDocuments, and if so, can you point me to it? Thanks!


Has helped a lot: we have a customer who needs one file only, and he needs (needed thanks to you) it ASAP.


Is there an update available that supports multiple endpoints for IIS based hosting?

Inder Singh

Thanks for such a goodt post, I was able to get XSD schema generated inline with the code you provided but I had a hard time getting rid of wsdl:import../ statement. I kept getting two WSDL files with the second WSDL file containig XSD schema inline. I have tried to document the details on my blog post: http://isinghblog.blogspot.com/2009/03/wcf-service-and-adobe-livecycle_10.html

Christian Weyer

Please make sure that the ServiceContract namespace, the ServiceBehavior namespace and the binding namespace have the exact same value.

Christian Weyer

@HJS: please get in touch with me via the Contact from - thx!


Hi. It's great but seems to be not fully correct. I start using this extension for my services and run into fail on getting wsdl. Getting wsdl for the first service always works, but for the next fails due to types dublication.

John Xu

There is an incident occurred to my client that the WCF interface generate a recursive reference. WSDL imports a XSD and the XSD points to this WSDL URL.

I am wondering in which version of the VS that this issue got addressed and user can chosse by web.config that can demand no xsd imported from WSDL? Also, import XSD in WSDL may cause problem in enterprise environment because of firewall if WSDl has import attributes to XSD.

Christian Weyer

Hi John,

are you talking about a problem using FlatWsdl or just complain about Visual Studio? :)
If you can give me more details I would be happy to help out.



After implementing the flat wsdl design. Svcutil.exe now generates string instead of Guid, and Duration. Which was not the case with the wsdl containing the import's. Any ideas why this is so?

TY for a great post.

Christian Weyer

Brian, can you get in touch with me via email? I think I may have an idea... Thanks!


I have a problem that I think this would help with: I'm implementing a service using the Declarative WCF Workflow Service in .NET 4.0 beta 2. I'm struggling to work out how to implement this, given that I have no code - it's all in a .xamlx file. Have you any experience with this?

Christian Weyer

Hi Simon,

yes, this is unfortuantely "the way to go" in WF4 for now. It is all implicit contracts in XAML, if you will...
The WF team is working on a story and some tooling to enable a better contract-first experience with WF.

Shweta D

Hi... Thanks a lot for this article.. it helped me to get a single wsdl for IIS hosted wcf. :-)


Hi. Please, help me with my problem: when I tried to use FlatWsdl as behavior for my service, I had two WSDL documents again. There is two endpoints in the service, but situation (2 wsdl's) wasn'n change when I removed one of them.

And addition: in main wsdl there is
wsdl:import namespace="http://ServiceSample" location="http://localhost:8000/service?wsdl=wsdl0"
xsd:import schemaLocation="http://localhost:7777/WSCF?xsd=xsd0" namespace="http://www.thinktecture.com/services/restaurant/2006/12"

("wsdl:import ... ?wsdl=wsdl0" instead "xsd:import ... ?xsd=xsd0")
Maybe, it is a reason? But I don't understand what is a solution in this case too.

I am writing a Delphi6-client for MS's sample "Hosting a WCF Service in WPF" http://msdn.microsoft.com/en-us/library/ms756474.aspx for check compability our project with olg clients.


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment

Comments are moderated, and will not appear until the author has approved them.

Your Information

(Name is required. Email address will not be displayed with the comment.)

IMPORTANT: This is archived - and quite likely outdated - content, only kept online for reference purposes

Please visit thinktecture.com for up-to-date technical content.