﻿<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://developers.de/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>WCF 4.0 REST Samples (German)</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/16/wcf-4-0-rest-samples-german.aspx<description>Die meisten REST Features von WCF konnte man bisher ausschließlich im WCF Starter Kit finden. Ab .NET 4.0 sind diese überwiegend zum festen Bestandteil von WCF 4.0 geworden. Um ein REST Service zu erstellen am einfachsten ist es im Visual Studio 2010</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>re: WCF 4.0 REST Samples (German)</title><link />http://developers.de/blogs/damir_dobric/archive/2010/05/16/wcf-4-0-rest-samples-german.aspx#704524<pubdate>Thu, 05 Dec 2013 20:07:07 GMT</pubdate><guid ispermalink="false">7e491611-45ad-4dae-a68f-c4cb64439510:704524</guid><dc:creator>Hussein</dc:creator><description>&lt;p&gt;I had some problems with desarializetion (due to namespaces in xml).after adding Contract to SampleItem: &amp;nbsp; &amp;nbsp;[DataContract(Namespace = &amp;quot;&amp;quot;, IsReference = false)] &amp;nbsp; &amp;nbsp;public class SampleItem &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[DataMember] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public int Id { get; set; } one can simply deserialize: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string xmlString2 = client.DownloadString( SampleService?id=1 ); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XElement xml2 = XElement.Parse(xmlString2); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;XmlSerializer xs = new XmlSerializer(typeof(SampleItem)); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SampleItem obj = (SampleItem)xs.Deserialize(new StringReader(xmlString2)); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Console.WriteLine( a: {0} {1} , obj.Id, obj.StringValue)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://developers.de/aggbug.aspx?PostID=704524" width="1" height="1"&gt;</description></item></channel></rss>