<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/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>ASP.NET AJAX Networking and Web Services</title><link>http://forums.asp.net/1009.aspx</link><description>Discuss your issues with the client and server interaction in AJAX using web services and other transports used by AJAX</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Modify objects returned by WebService</title><link>http://forums.asp.net/thread/2137694.aspx</link><pubDate>Mon, 28 Jan 2008 19:04:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2137694</guid><dc:creator>RTernier</dc:creator><author>RTernier</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2137694.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2137694</wfw:commentRss><description>&lt;p&gt;That&amp;#39;s one thing I was thinking. It&amp;#39;s strange though that I can create a class of that type, but yea, it would be nice if they used an actual object that can be recreated not an array of objects created on the fly.&amp;nbsp;&lt;/p&gt;&lt;p&gt;I was stepping into all the script created by MS Ajax, and sort of came to the same conclusion.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I guess i&amp;#39;ll just write my custom classes and when I get the result set, i&amp;#39;ll move the results into my own objects... won&amp;#39;t be that much work :)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks again.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Modify objects returned by WebService</title><link>http://forums.asp.net/thread/2137618.aspx</link><pubDate>Mon, 28 Jan 2008 18:26:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2137618</guid><dc:creator>gt1329a</dc:creator><author>gt1329a</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2137618.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2137618</wfw:commentRss><description>&lt;p&gt;I got your email and took a look at the JS proxy generated by your service.&amp;nbsp; I also did some testing with a similar service I have set up that returns a collection of custom objects and is called through the ScriptManager via that same type of JS proxy.&lt;/p&gt;&lt;p&gt;I ran into the same issues you&amp;#39;re describing.&amp;nbsp; After rooting around in the MicrosoftAjax.js code, it looks like the problem is that the JavaScript deserialize function just evals the JSON into an array and doesn&amp;#39;t actually instantiate a JavaScript object for each item.&amp;nbsp; So, the JavaScript OO stuff doesn&amp;#39;t behave as expected on those.&lt;/p&gt;For now, you could always set up a helper function on the client side that implicitly accepts the data structure returned by your service and returns the HTML you want.&amp;nbsp; It wouldn&amp;#39;t be as elegant a solution as what you&amp;#39;re after, but might be the only reasonable way to do it within the current confines of the framework.&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Modify objects returned by WebService</title><link>http://forums.asp.net/thread/2137388.aspx</link><pubDate>Mon, 28 Jan 2008 16:49:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2137388</guid><dc:creator>RTernier</dc:creator><author>RTernier</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2137388.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2137388</wfw:commentRss><description>&lt;p&gt;If I do this:&lt;br /&gt;&lt;b&gt;BicNet.Entities.GPSData.prototype.test = function()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &amp;#39;test&amp;#39;;&lt;br /&gt;}&lt;/b&gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;I can then do this:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;var d = new BicNet.Entities.GPSData();&lt;/b&gt;&lt;/p&gt;&lt;p&gt;which gives me an object of BicNet.Entities.GPSData however, any object returned in the resultset (which is of type BicNet.Entities.GPSData()) does not have this function on it.&amp;nbsp; I&amp;#39;m not registering any new namepsace for this. I&amp;#39;m using the same namespace already created by ASP.NET which resides in my webservice.asmx/js&amp;nbsp;&amp;nbsp; section.&lt;/p&gt;&lt;p&gt;&amp;nbsp;How can I get this function which I have above on those objects returned?&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Modify objects returned by WebService</title><link>http://forums.asp.net/thread/2134057.aspx</link><pubDate>Sat, 26 Jan 2008 00:39:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2134057</guid><dc:creator>RTernier</dc:creator><author>RTernier</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2134057.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2134057</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I&amp;#39;ve looked at it, but it&amp;#39;s still not working the way the example tells me it should.&lt;/p&gt;&lt;p&gt;Type.registerNamespace(&amp;#39;BicNet.Entities&amp;#39;);&lt;br /&gt;&lt;br /&gt;BicNet.Entities.GPSData = function()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.test = &amp;quot;testing&amp;quot;;&lt;br /&gt;} &lt;/p&gt;&lt;p&gt;&amp;nbsp;now BicNet.Entities.GPSData (the object i just scripted above) has a property called &lt;b&gt;test&lt;/b&gt;,&amp;nbsp; but this property cannot be accesed by the objects returned from my webservice (which are of type: BicNet.Entities.GPSData&amp;nbsp;&amp;nbsp;&amp;nbsp; C#).&lt;/p&gt;&lt;p&gt;When looking in FireBug the result comming back has a property:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _type=BicNet.Entities.GPSData&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Unfortunately&amp;nbsp; in JS you typeof(object) will return: object, string etc. not the actual type.&amp;nbsp; I wonder if the object returned from my WS is one I can&amp;#39;t get ahold of...&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;Thoughts?&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Modify objects returned by WebService</title><link>http://forums.asp.net/thread/2134000.aspx</link><pubDate>Fri, 25 Jan 2008 23:23:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2134000</guid><dc:creator>gt1329a</dc:creator><author>gt1329a</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2134000.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2134000</wfw:commentRss><description>&lt;p&gt;This tutorial might help:&amp;nbsp; &lt;a href="http://www.asp.net/AJAX/Documentation/Live/tutorials/IScriptControlTutorial1.aspx"&gt;http://www.asp.net/AJAX/Documentation/Live/tutorials/IScriptControlTutorial1.aspx&lt;/a&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Modify objects returned by WebService</title><link>http://forums.asp.net/thread/2133965.aspx</link><pubDate>Fri, 25 Jan 2008 22:57:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2133965</guid><dc:creator>RTernier</dc:creator><author>RTernier</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2133965.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2133965</wfw:commentRss><description>&lt;p&gt;It didn&amp;#39;t work as expected:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;My C# Webservice Function:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;public Entities.GPSData[] getMarkers() &lt;br /&gt;{...}&lt;/p&gt;&lt;p&gt;-----&lt;/p&gt;&lt;p&gt;GPSData is inside the namespace: &lt;/p&gt;&lt;p&gt;BicNet.Entities&lt;/p&gt;&lt;p&gt;so&amp;nbsp; BicNet.Entities.GPSData&lt;/p&gt;&lt;p&gt;----&lt;/p&gt;&lt;p&gt;I tried doing the following:&lt;/p&gt;&lt;p&gt;BicNet.Entities.GPSData.prototype.test = function()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return &amp;#39;test&amp;#39;;&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;which didn&amp;#39;t work. So I tried:&lt;br /&gt;&lt;br /&gt;GPSData.prototype.test = function()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &amp;#39;test&amp;#39;;&lt;br /&gt;} &lt;/p&gt;&lt;p&gt;&amp;nbsp;again didn&amp;#39;t work.&lt;/p&gt;&lt;p&gt;Any thoughts?&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Modify objects returned by WebService</title><link>http://forums.asp.net/thread/2133906.aspx</link><pubDate>Fri, 25 Jan 2008 22:14:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2133906</guid><dc:creator>RTernier</dc:creator><author>RTernier</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2133906.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2133906</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Exactly what I was looking for. I wasn&amp;#39;t sure if the objecft returned was the same name of the class you creatd. Thanks.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Modify objects returned by WebService</title><link>http://forums.asp.net/thread/2133795.aspx</link><pubDate>Fri, 25 Jan 2008 21:04:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2133795</guid><dc:creator>gt1329a</dc:creator><author>gt1329a</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2133795.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2133795</wfw:commentRss><description>&lt;p&gt;You can add that on the client side, through your object&amp;#39;s prototype.&amp;nbsp; For example, if your custom class is called MyClass, then:&lt;/p&gt;&lt;pre class="coloredcode"&gt;MyClass.prototype.getHTMLData = function() {&lt;br /&gt;  &lt;span class="kwd"&gt;return&lt;/span&gt; &lt;span class="st"&gt;&amp;#39;&amp;lt;div&amp;gt;&amp;#39;&lt;/span&gt; + &lt;span class="kwd"&gt;this&lt;/span&gt;.property1 + &lt;span class="kwd"&gt;this&lt;/span&gt;.property2 + &lt;span class="st"&gt;&amp;#39;&amp;lt;/div&amp;gt;&amp;#39;&lt;/span&gt;;&lt;br /&gt;}&lt;/pre&gt;&amp;nbsp;&amp;nbsp;</description></item><item><title>Re: Modify objects returned by WebService</title><link>http://forums.asp.net/thread/2133749.aspx</link><pubDate>Fri, 25 Jan 2008 20:34:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2133749</guid><dc:creator>RTernier</dc:creator><author>RTernier</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2133749.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2133749</wfw:commentRss><description>&lt;p&gt;that&amp;#39;s what I&amp;#39;m currently doing - I have my custom obejct that&amp;#39;s being returned... a large object... with a property that has an array that can have over 100,000 items.... But what about functions and methods?&lt;/p&gt;&lt;p&gt;&amp;nbsp;if I want to do:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;myResult.getHTMLData();&lt;/p&gt;&lt;p&gt;I need to have a getHTMLData() function on my object prototype don&amp;#39;t I?&amp;nbsp; Or... ?&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Modify objects returned by WebService</title><link>http://forums.asp.net/thread/2133506.aspx</link><pubDate>Fri, 25 Jan 2008 18:40:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2133506</guid><dc:creator>DisturbedBuddha</dc:creator><author>DisturbedBuddha</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2133506.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2133506</wfw:commentRss><description>&lt;p&gt;Just create a server-side class that has whatever methods and functions you want and make that your return type.&amp;nbsp; When it get&amp;#39;s serialized and returned, the javascript object will automatically match it.&lt;/p&gt;</description></item><item><title>Modify objects returned by WebService</title><link>http://forums.asp.net/thread/2133477.aspx</link><pubDate>Fri, 25 Jan 2008 18:27:28 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2133477</guid><dc:creator>RTernier</dc:creator><author>RTernier</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2133477.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=2133477</wfw:commentRss><description>&lt;p&gt;When an object is returned from an WebService that is called by javaScript, is it possible to either:&lt;/p&gt;&lt;p&gt;a) modify that object and add additional functions, and properties to it&lt;/p&gt;&lt;p&gt;or&lt;/p&gt;&lt;p&gt;b) have .NET use an object you&amp;#39;ve already designed in JavaScript as the return type?&lt;/p&gt;&lt;p&gt;&amp;nbsp;Any help would be appreciated.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>