<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Flatten your WSDL with this Custom ServiceHost for WCF</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/09/23/flatten-your-wsdl-with-this-custom-servicehost-for-wcf.aspx</link><description>Yesterday I mentioned using a custom service host to flatten the WSDL that is generated by a WCF service. This is something Christian showed us all how to do a long while ago, to improve interoperability between WCF-implemented services and consumers</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>  Flatten your WSDL with this Custom ServiceHost for WCF : EasyCoded</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/09/23/flatten-your-wsdl-with-this-custom-servicehost-for-wcf.aspx#8962365</link><pubDate>Tue, 23 Sep 2008 18:38:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962365</guid><dc:creator>  Flatten your WSDL with this Custom ServiceHost for WCF : EasyCoded</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.easycoded.com/flatten-your-wsdl-with-this-custom-servicehost-for-wcf/"&gt;http://www.easycoded.com/flatten-your-wsdl-with-this-custom-servicehost-for-wcf/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Flatten your WSDL with this Custom ServiceHost for WCF</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/09/23/flatten-your-wsdl-with-this-custom-servicehost-for-wcf.aspx#8962610</link><pubDate>Tue, 23 Sep 2008 21:48:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8962610</guid><dc:creator>Natasa Manousopoulou</dc:creator><description>&lt;p&gt;In order to make the exporter work correctly if there are more than one endpoints defined for the service, ExportEndpoint() must be slightly changed:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public void ExportEndpoint(&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WsdlExporter exporter,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WsdlEndpointConversionContext context&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XmlSchemaSet schemaSet = exporter.GeneratedXmlSchemas;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (WsdlDescription wsdl in exporter.GeneratedWsdlDocuments)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;List&amp;lt;XmlSchema&amp;gt; importsList = new List&amp;lt;XmlSchema&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (XmlSchema schema in wsdl.Types.Schemas)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AddImportedSchemas(schema, schemaSet, importsList);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (importsList.Count == 0)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;wsdl.Types.Schemas.Clear();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (XmlSchema schema in importsList)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RemoveXsdImports(schema);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;wsdl.Types.Schemas.Add(schema);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
</description></item><item><title>re: Flatten your WSDL with this Custom ServiceHost for WCF</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/09/23/flatten-your-wsdl-with-this-custom-servicehost-for-wcf.aspx#9057196</link><pubDate>Mon, 10 Nov 2008 13:55:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9057196</guid><dc:creator>Massimo</dc:creator><description>&lt;p&gt;I've been searching far and wide, with no success, for a snippet showing how to flatten a wsdl+(several xsd) files to a single wsdl file I can feed to the wsdl2php utility from WSO2. I'm no WCF programmer, but your code looks promising ... only problem is, can it be adapted to read its input from a set of files?&lt;/p&gt;
&lt;p&gt;From what I understand, at a minimum one needs to replace the exporter.GeneratedXmlSchemas and exporter.GeneratedWsdlDocuments with something that can fill an XmlSchemaSet and a WsdlDescription objects, but I have no idea how.&lt;/p&gt;
&lt;p&gt;Thank you in advance for any advice you can give,&lt;/p&gt;
&lt;p&gt;Massimo &lt;/p&gt;
</description></item><item><title>re: Flatten your WSDL with this Custom ServiceHost for WCF</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/09/23/flatten-your-wsdl-with-this-custom-servicehost-for-wcf.aspx#9120282</link><pubDate>Wed, 19 Nov 2008 00:30:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9120282</guid><dc:creator>DaveK</dc:creator><description>&lt;p&gt;This is very useful, thanks. Under what license may this be used?&lt;/p&gt;
&lt;p&gt;Looks like it has a bug. This:&lt;/p&gt;
&lt;p&gt;foreach (WsdlDescription wsdl in exporter.GeneratedWsdlDocuments)&lt;/p&gt;
&lt;p&gt;I think should be:&lt;/p&gt;
&lt;p&gt;foreach (ServiceDescription wsdl in exporter.GeneratedWsdlDocuments)&lt;/p&gt;
</description></item><item><title>How to flatten your WCF WSDL</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/09/23/flatten-your-wsdl-with-this-custom-servicehost-for-wcf.aspx#9517998</link><pubDate>Mon, 30 Mar 2009 08:53:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9517998</guid><dc:creator>AppliSec </dc:creator><description>&lt;P&gt;How to flatten WCF WSDL for interoperability purposes...&lt;/P&gt;</description></item><item><title>re: Flatten your WSDL with this Custom ServiceHost for WCF</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/09/23/flatten-your-wsdl-with-this-custom-servicehost-for-wcf.aspx#9539882</link><pubDate>Thu, 09 Apr 2009 12:44:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9539882</guid><dc:creator>Shane</dc:creator><description>&lt;p&gt;I am having difficulty getting this to work from within a windows service.&lt;/p&gt;
&lt;p&gt;Here is my code&lt;/p&gt;
&lt;p&gt;FlatWsdlServiceHost flatServiceHost = new FlatWsdlServiceHost(typeof(WSOrder), baseAddress);&lt;/p&gt;
&lt;p&gt;flatServiceHost.AddServiceEndpoint(typeof(IWSOrder), binding, registerAddress);&lt;/p&gt;
&lt;p&gt;flatServiceHost.Description.Behaviors.Add(metadataBehavior);&lt;/p&gt;
</description></item></channel></rss>