<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Xml</title>
        <link>http://www.agilior.pt/blogs/pedro.rainho/category/48.aspx</link>
        <description>Xml</description>
        <language>pt-PT</language>
        <copyright>Pedro Rainho</copyright>
        <managingEditor>pedro.rainho@agilior.pt</managingEditor>
        <generator>Subtext Version 1.9.0.27</generator>
        <item>
            <title>Remove tempuri from WCF service</title>
            <link>http://agilior.pt/blogs/pedro.rainho/archive/2009/01/12/6661.aspx</link>
            <description>&lt;p&gt;If any one ever want was remove all &lt;a href="http://tempuri.org"&gt;http://tempuri.org&lt;/a&gt; namespaces from wcf service I really recommend all to check this two posts in &lt;a href="http://www.pluralsight.com/community/blogs/kirillg/archive/2006/06/18/28380.aspx" title="http://www.pluralsight.com/community/blogs/kirillg/archive/2006/06/18/28380.aspx"&gt;http://www.pluralsight.com/community/blogs/kirillg/archive/2006/06/18/28380.aspx&lt;/a&gt; and &lt;a href="http://cglessner.blogspot.com/2008/07/kill-tempuri-in-wcf-services.html" title="http://cglessner.blogspot.com/2008/07/kill-tempuri-in-wcf-services.html"&gt;http://cglessner.blogspot.com/2008/07/kill-tempuri-in-wcf-services.html&lt;/a&gt;. Helped me solve my problems.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;One other thing I found when I was removing the &lt;a href="http://tempuri.org"&gt;http://tempuri.org&lt;/a&gt; namespaces.&lt;/p&gt;
&lt;p&gt;If I want this:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&amp;lt;wsdl:definitions name="MyWCFService" &lt;strong&gt;targetNamespace="http://MyCompany/mywcfservice/"&lt;/strong&gt;&amp;gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I need to do this:&lt;/p&gt;
&lt;p&gt;[ServiceBehavior(Namespace="http://MyCompany/mywcfservice/")]&lt;/p&gt;
&lt;p&gt;public class MyWCFService : IMyWCFServiceContract&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Or do this:&lt;/p&gt;
&lt;p&gt;public class MyWCFService : IMyWCFServiceContract&lt;/p&gt;
&lt;p&gt;and inside MyServiceHost do:&lt;/p&gt;
&lt;p&gt;this.Description.Namespace = “http://MyCompany/mywcfservice/”;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;don’t try this because it will not remove tempuri:&lt;/p&gt;
&lt;p&gt;ServiceBehaviorAttribute serviceBehaviorAtribute = this.Description.Behaviors.Find&amp;lt;ServiceBehaviorAttribute&amp;gt;();&lt;/p&gt;
&lt;p&gt;serviceBehaviorAtribute.Namespace = “http://MyCompany/mywcfservice/”;&lt;/p&gt;
&lt;p&gt;This was my first choice until I realize my mistake.&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/pedro.rainho/aggbug/6661.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Pedro Rainho</dc:creator>
            <guid>http://agilior.pt/blogs/pedro.rainho/archive/2009/01/12/6661.aspx</guid>
            <pubDate>Mon, 12 Jan 2009 14:30:43 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/pedro.rainho/comments/6661.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/pedro.rainho/archive/2009/01/12/6661.aspx#feedback</comments>
            <slash:comments>33</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/pedro.rainho/comments/commentRss/6661.aspx</wfw:commentRss>
        </item>
        <item>
            <title>xmlns:xsi with Linq to XML</title>
            <link>http://agilior.pt/blogs/pedro.rainho/archive/2008/05/30/4694.aspx</link>
            <description>&lt;p&gt;If someone needs to add a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" to a xml element using Linq to XML all you have to do is something like this&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;XNamespace &lt;/span&gt;xsi = &lt;span style="color: #a31515"&gt;"http://www.w3.org/2001/XMLSchema-instance"&lt;/span&gt;;
&lt;span style="color: #2b91af"&gt;XDocument &lt;/span&gt;doc = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;XDocument&lt;/span&gt;(
    &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;XElement&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"Root"&lt;/span&gt;,
        &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;XAttribute&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;XNamespace&lt;/span&gt;.Xmlns + &lt;span style="color: #a31515"&gt;"xsi"&lt;/span&gt;, xsi)));&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;maybe it's not very intuitive but works :)&lt;/p&gt;&lt;img src="http://agilior.pt/blogs/pedro.rainho/aggbug/4694.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Pedro Rainho</dc:creator>
            <guid>http://agilior.pt/blogs/pedro.rainho/archive/2008/05/30/4694.aspx</guid>
            <pubDate>Fri, 30 May 2008 07:54:53 GMT</pubDate>
            <wfw:comment>http://agilior.pt/blogs/pedro.rainho/comments/4694.aspx</wfw:comment>
            <comments>http://agilior.pt/blogs/pedro.rainho/archive/2008/05/30/4694.aspx#feedback</comments>
            <slash:comments>19</slash:comments>
            <wfw:commentRss>http://agilior.pt/blogs/pedro.rainho/comments/commentRss/4694.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
