<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using complex types to make calling services less&#8230; complex</title>
	<atom:link href="http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/feed/" rel="self" type="application/rss+xml" />
	<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/</link>
	<description>ASP.NET and AJAX code, ideas, and examples.</description>
	<lastBuildDate>Sun, 14 Mar 2010 18:14:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-38190</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Wed, 03 Mar 2010 02:29:40 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-38190</guid>
		<description>The &quot;ScriptService&quot; functionality handles that automatically.  It&#039;s similar to MVC&#039;s model binding approach.</description>
		<content:encoded><![CDATA[<p>The &#8220;ScriptService&#8221; functionality handles that automatically.  It&#8217;s similar to MVC&#8217;s model binding approach.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Stevens</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-38189</link>
		<dc:creator>Eric Stevens</dc:creator>
		<pubDate>Wed, 03 Mar 2010 02:18:47 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-38189</guid>
		<description>How does the web service handle the dto object?</description>
		<content:encoded><![CDATA[<p>How does the web service handle the dto object?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vijay anand</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-38071</link>
		<dc:creator>Vijay anand</dc:creator>
		<pubDate>Fri, 19 Feb 2010 08:29:06 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-38071</guid>
		<description>Great post. Really informative. I&#039;m a beginner. It&#039;s really useful for me. Great site!</description>
		<content:encoded><![CDATA[<p>Great post. Really informative. I&#8217;m a beginner. It&#8217;s really useful for me. Great site!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daivd</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-38047</link>
		<dc:creator>Daivd</dc:creator>
		<pubDate>Tue, 16 Feb 2010 15:54:51 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-38047</guid>
		<description>This does not work with the XMLDOM object.  I can get this to work using the old MS behaviors (HTC).  But stringify does not work on a XMLDOM object.  Is there another way to pass a XMLDOM as an XMLDOM object?</description>
		<content:encoded><![CDATA[<p>This does not work with the XMLDOM object.  I can get this to work using the old MS behaviors (HTC).  But stringify does not work on a XMLDOM object.  Is there another way to pass a XMLDOM as an XMLDOM object?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-37720</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Sat, 02 Jan 2010 17:27:58 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-37720</guid>
		<description>I&#039;m not familiar enough with Java to know specifically what its counterpart of this is, but there should definitely be one.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not familiar enough with Java to know specifically what its counterpart of this is, but there should definitely be one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashwatha</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-37679</link>
		<dc:creator>Ashwatha</dc:creator>
		<pubDate>Wed, 23 Dec 2009 09:02:34 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-37679</guid>
		<description>Great post, It changed my application architecture,
Dave Is there anything like this in Java Web Services?</description>
		<content:encoded><![CDATA[<p>Great post, It changed my application architecture,<br />
Dave Is there anything like this in Java Web Services?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dinesh K Mandal</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-36878</link>
		<dc:creator>Dinesh K Mandal</dc:creator>
		<pubDate>Fri, 23 Oct 2009 15:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-36878</guid>
		<description>It&#039;s really a great post. Thanks for your valuable post.</description>
		<content:encoded><![CDATA[<p>It&#8217;s really a great post. Thanks for your valuable post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jie Li</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-36707</link>
		<dc:creator>Jie Li</dc:creator>
		<pubDate>Sun, 11 Oct 2009 16:09:29 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-36707</guid>
		<description>Thanks for the reply. I really enjoy your articles.</description>
		<content:encoded><![CDATA[<p>Thanks for the reply. I really enjoy your articles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-36705</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Sun, 11 Oct 2009 04:39:41 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-36705</guid>
		<description>It would need to be static if it were a page method.  In this example, I&#039;m using an ASMX service method instead of a page method, so the static modifier isn&#039;t necessary.</description>
		<content:encoded><![CDATA[<p>It would need to be static if it were a page method.  In this example, I&#8217;m using an ASMX service method instead of a page method, so the static modifier isn&#8217;t necessary.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jie Li</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-36703</link>
		<dc:creator>Jie Li</dc:creator>
		<pubDate>Sun, 11 Oct 2009 03:17:18 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-36703</guid>
		<description>I think it may be too oblivious. This method needs to be static, right?

[WebMethod]
public static void AddPerson(Person NewPerson)</description>
		<content:encoded><![CDATA[<p>I think it may be too oblivious. This method needs to be static, right?</p>
<p>[WebMethod]<br />
public static void AddPerson(Person NewPerson)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aashish Gupta</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-36401</link>
		<dc:creator>Aashish Gupta</dc:creator>
		<pubDate>Sun, 06 Sep 2009 06:12:41 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-36401</guid>
		<description>Hi all,
I am using Linq to sql and DTO approach with WCF what i am able to achieve is direct object property transfer but what if i want to insert all the other dependent objects within the same call.
For example 
If my UserTable is related with EmployeeTable and i want to insert data in both the tables do i have to pass both objects from jQuery UI or i can do something like 
UserTable.Employee.FirstName = $(&#039;#tbFirstName&#039;).val();

and pass the user object to WCF call and in the WCF call what will have i to write to submit all the changes in the datacontext.My guess would be InsertAllOnSubmit.

If this is not the correct approach then what could be the best approach.

Thanks</description>
		<content:encoded><![CDATA[<p>Hi all,<br />
I am using Linq to sql and DTO approach with WCF what i am able to achieve is direct object property transfer but what if i want to insert all the other dependent objects within the same call.<br />
For example<br />
If my UserTable is related with EmployeeTable and i want to insert data in both the tables do i have to pass both objects from jQuery UI or i can do something like<br />
UserTable.Employee.FirstName = $(&#8216;#tbFirstName&#8217;).val();</p>
<p>and pass the user object to WCF call and in the WCF call what will have i to write to submit all the changes in the datacontext.My guess would be InsertAllOnSubmit.</p>
<p>If this is not the correct approach then what could be the best approach.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-36202</link>
		<dc:creator>Joel</dc:creator>
		<pubDate>Fri, 14 Aug 2009 07:06:18 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-36202</guid>
		<description>Thanks very much Dave.  I appreciate your advice.</description>
		<content:encoded><![CDATA[<p>Thanks very much Dave.  I appreciate your advice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-36201</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Fri, 14 Aug 2009 06:07:41 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-36201</guid>
		<description>If you can use a List&lt;CustomObject&gt; instead of your CustomObjectList, it will work.  Worst case, use a simple structure like that as a DTO and map that to your CustomObjectList in the service method.</description>
		<content:encoded><![CDATA[<p>If you can use a List<customobject> instead of your CustomObjectList, it will work.  Worst case, use a simple structure like that as a DTO and map that to your CustomObjectList in the service method.</customobject></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-36199</link>
		<dc:creator>Joel</dc:creator>
		<pubDate>Fri, 14 Aug 2009 04:30:19 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-36199</guid>
		<description>That first paragraph should end: &quot;The object I want to serialize contains a List&lt;CustomObject&gt;, where CustomObject contains a couple of primitive types.&quot;</description>
		<content:encoded><![CDATA[<p>That first paragraph should end: &#8220;The object I want to serialize contains a List&lt;CustomObject&gt;, where CustomObject contains a couple of primitive types.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://encosia.com/2009/04/07/using-complex-types-to-make-calling-services-less-complex/#comment-36195</link>
		<dc:creator>Joel</dc:creator>
		<pubDate>Thu, 13 Aug 2009 21:18:53 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/?p=849#comment-36195</guid>
		<description>Dave,
I&#039;ve been using the methods described in this article and I&#039;ve gotten to the point where my objects to serialize are a little more complex and I&#039;m running into errors trying to pass them between client and server.  The object I want to serialize contains a List, where CustomObject contains a couple of primitive types.

&lt;a href=&quot;http://sites.google.com/site/nomsbane/Home/ComplexDataType_JSON[Stage1].zip&quot; rel=&quot;nofollow&quot;&gt;Here is a link to a simplified demonstration of the problem&lt;/a&gt;

This was my initial attempt at jsonifying my client object.  It resulted in the error
&quot;The value &quot;System.Collections.Generic.Dictionary`2[System.String,System.Object]&quot; is not of type &quot;CustomObject&quot; and cannot be used in this generic collection. Parameter name: value&quot;

Next, I tried using System.Web.Script.Serialization.JavaScriptSerializer to serialize an instance of my class just to see how the that serializer would do it.  I noticed that the JavaScriptSerializer included a &quot;__type&quot; attribute and I copied that value into my client code as an attribute of the client-side object.

&lt;a href=&quot;http://sites.google.com/site/nomsbane/Home/ComplexDataType_JSON[Stage2].zip&quot; rel=&quot;nofollow&quot;&gt;Here&#039;s the same project modified to use the &quot;__type&quot; attribute.

This seems to get me closer to my goal, but now I get the error
&quot;Operation is not valid due to the current state of the object.&quot;

I&#039;d appreciate any advice you can offer me on properly jsonifying this data structure.</description>
		<content:encoded><![CDATA[<p>Dave,<br />
I&#8217;ve been using the methods described in this article and I&#8217;ve gotten to the point where my objects to serialize are a little more complex and I&#8217;m running into errors trying to pass them between client and server.  The object I want to serialize contains a List, where CustomObject contains a couple of primitive types.</p>
<p><a href="http://sites.google.com/site/nomsbane/Home/ComplexDataType_JSON[Stage1].zip" rel="nofollow">Here is a link to a simplified demonstration of the problem</a></p>
<p>This was my initial attempt at jsonifying my client object.  It resulted in the error<br />
&#8220;The value &#8220;System.Collections.Generic.Dictionary`2[System.String,System.Object]&#8221; is not of type &#8220;CustomObject&#8221; and cannot be used in this generic collection. Parameter name: value&#8221;</p>
<p>Next, I tried using System.Web.Script.Serialization.JavaScriptSerializer to serialize an instance of my class just to see how the that serializer would do it.  I noticed that the JavaScriptSerializer included a &#8220;__type&#8221; attribute and I copied that value into my client code as an attribute of the client-side object.</p>
<p><a href="http://sites.google.com/site/nomsbane/Home/ComplexDataType_JSON[Stage2].zip" rel="nofollow">Here&#8217;s the same project modified to use the &#8220;__type&#8221; attribute.</p>
<p>This seems to get me closer to my goal, but now I get the error<br />
&#8220;Operation is not valid due to the current state of the object.&#8221;</p>
<p>I&#8217;d appreciate any advice you can offer me on properly jsonifying this data structure.</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
