<?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: Generated WebSeviceProxy Bug?</title><link>http://forums.asp.net/thread/1803671.aspx</link><pubDate>Sat, 14 Jul 2007 15:19:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1803671</guid><dc:creator>KaziManzurRashid</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1803671.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=1803671</wfw:commentRss><description>&lt;p&gt;Steve,&lt;br /&gt;&lt;br /&gt;I have already solved it check my blog from the above link, The Issue was why the Proxy is generated like this, is it intentional, if so what is the reason, if not then it must be a bug which needs to be fixed in future version or a patch must be released.&lt;/p&gt;
&lt;p&gt;Again thanks for your effort.&lt;/p&gt;</description></item><item><title>Re: Generated WebSeviceProxy Bug?</title><link>http://forums.asp.net/thread/1803602.aspx</link><pubDate>Sat, 14 Jul 2007 12:54:27 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1803602</guid><dc:creator>Steve Marx</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1803602.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=1803602</wfw:commentRss><description>&lt;p&gt;Oh, sorry, I was confused... now I see the code you&amp;#39;re talking about.&lt;/p&gt;
&lt;p&gt;Strange, this seemed familiar, but I couldn&amp;#39;t remember what the solution was.&amp;nbsp; I searched on the web for it and came across a page (&lt;a href="http://blogs.msdn.com/irenak/archive/2007/03/19/sysk-309-how-to-cancel-a-web-service-request.aspx"&gt;http://blogs.msdn.com/irenak/archive/2007/03/19/sysk-309-how-to-cancel-a-web-service-request.aspx&lt;/a&gt;) which suggested using &amp;quot;new MyService().MethodX(...)&amp;quot; instead of &amp;quot;MyService.MethodX(...)&amp;quot;, since that will return the request object.&amp;nbsp; Oddly enough, the bottom of the post says &amp;quot;Special thanks to Steve Marx for the information,&amp;quot; so that must be why I vaguely remember it. :-)&lt;/p&gt;
&lt;p&gt;Unfortunately, I don&amp;#39;t remember the details of why this is the case.&lt;/p&gt;</description></item><item><title>Re: Generated WebSeviceProxy Bug?</title><link>http://forums.asp.net/thread/1803321.aspx</link><pubDate>Sat, 14 Jul 2007 01:48:50 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1803321</guid><dc:creator>KaziManzurRashid</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1803321.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=1803321</wfw:commentRss><description>&lt;p&gt;A complete sample can be download from my blog &lt;a href="http://geekswithblogs.net/rashid/archive/2007/07/14/Cancel-a-Web-Service-Call-in-Asp.net-Ajax.aspx"&gt;http://geekswithblogs.net/rashid/archive/2007/07/14/Cancel-a-Web-Service-Call-in-Asp.net-Ajax.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: Generated WebSeviceProxy Bug?</title><link>http://forums.asp.net/thread/1803242.aspx</link><pubDate>Fri, 13 Jul 2007 22:34:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1803242</guid><dc:creator>KaziManzurRashid</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1803242.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=1803242</wfw:commentRss><description>&lt;p&gt;Yes I am&lt;/p&gt;</description></item><item><title>Re: Generated WebSeviceProxy Bug?</title><link>http://forums.asp.net/thread/1803207.aspx</link><pubDate>Fri, 13 Jul 2007 21:53:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1803207</guid><dc:creator>Steve Marx</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1803207.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=1803207</wfw:commentRss><description>&lt;p&gt;Are you using ASP.NET AJAX 1.0?&amp;nbsp; I just took a look at the proxy for one of my methods, and it looked very different and did indeed return the object you need.&lt;/p&gt;</description></item><item><title>Re: Generated WebSeviceProxy Bug?</title><link>http://forums.asp.net/thread/1803197.aspx</link><pubDate>Fri, 13 Jul 2007 21:48:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1803197</guid><dc:creator>KaziManzurRashid</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1803197.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=1803197</wfw:commentRss><description>&lt;p class="MsoNormal" style="MARGIN:0in 0in 10pt;"&gt;&lt;font face="Calibri" size="3"&gt;Can anyone form MS Ajax Team shade a light on this?&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Generated WebSeviceProxy Bug?</title><link>http://forums.asp.net/thread/1801346.aspx</link><pubDate>Thu, 12 Jul 2007 23:23:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1801346</guid><dc:creator>KaziManzurRashid</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1801346.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1009&amp;PostID=1801346</wfw:commentRss><description>&lt;p&gt;I am not sure whether it is intentional or not, but it certainly needs some attention.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;My actual goal was to abort a Web Method Call after it has been invoked. We know that all kinds of Client Side Web Service Proxy are inherited from &lt;strong&gt;Sys.Net.WebServiceProxy&lt;/strong&gt; class. This class contains a single method &lt;strong&gt;invoke&lt;/strong&gt; which is used to call the server side method. The &lt;a class="" href="http://ajax.asp.net/docs/ClientReference/Sys.Net/WebServiceProxyClass/WebServiceProxyInvokeMethod.aspx"&gt;Ajax Documentation&lt;/a&gt; specifies that invoke method returns a &lt;strong&gt;Sys.Net.WebRequest&lt;/strong&gt; class, which is used to call the method as well as aborting the call. So I came with following code: &lt;pre class="coloredcode"&gt;var _webRequest = null;

function invokeMethod()
{
    _webRequest = DataService.LongOperation  (  10000, //10 seconds
                                                function(result)
                                                {
                                                    alert(result);
                                                    $get(&amp;#39;btnInvoke&amp;#39;).disabled = false;
                                                    $get(&amp;#39;btnAbort&amp;#39;).disabled = true;
                                                },
                                                function(exception)
                                                {
                                                    alert(exception.get_message());
                                                    $get(&amp;#39;btnInvoke&amp;#39;).disabled = false;
                                                    $get(&amp;#39;btnAbort&amp;#39;).disabled = true;
                                                }
                                            );
    //_webRequest is undefined here !!!!
    $get(&amp;#39;btnInvoke&amp;#39;).disabled = true;
    $get(&amp;#39;btnAbort&amp;#39;).disabled = false;
}

function abortMethod()
{
    if (_webRequest != null)
    {
        var executor = _webRequest.get_executor();

        if (executor.get_started())
        {
            executor.abort();
        }

        $get(&amp;#39;btnInvoke&amp;#39;).disabled = false;
        $get(&amp;#39;btnAbort&amp;#39;).disabled = true;
    }
}&lt;/pre&gt;&lt;br /&gt;But unfortunatly I found that the _webRequest is undefined. So I did a /js thing to generate the proxy: &lt;br /&gt;&lt;pre class="coloredcode"&gt;var DataService=function() {
DataService.initializeBase(&lt;span class="kwd"&gt;this&lt;/span&gt;);
&lt;span class="kwd"&gt;this&lt;/span&gt;._timeout = 0;
&lt;span class="kwd"&gt;this&lt;/span&gt;._userContext = &lt;span class="kwd"&gt;null&lt;/span&gt;;
&lt;span class="kwd"&gt;this&lt;/span&gt;._succeeded = &lt;span class="kwd"&gt;null&lt;/span&gt;;
&lt;span class="kwd"&gt;this&lt;/span&gt;._failed = &lt;span class="kwd"&gt;null&lt;/span&gt;;
}
DataService.prototype={
LongOperation:function(miliseconds,succeededCallback, failedCallback, userContext)
{
	&lt;span class="kwd"&gt;return this&lt;/span&gt;._invoke(DataService.get_path(), &lt;span class="st"&gt;&amp;#39;LongOperation&amp;#39;&lt;/span&gt;,&lt;span class="kwd"&gt;false&lt;/span&gt;,{miliseconds:miliseconds},succeededCallback,failedCallback,userContext);}
}
DataService.registerClass(&lt;span class="st"&gt;&amp;#39;DataService&amp;#39;&lt;/span&gt;,Sys.Net.WebServiceProxy);
DataService._staticInstance = &lt;span class="kwd"&gt;new&lt;/span&gt; DataService();&lt;br /&gt;//Removed the other parts for clarity
DataService.LongOperation= function(miliseconds,onSuccess,onFailed,userContext)
{
	DataService._staticInstance.LongOperation(miliseconds,onSuccess,onFailed,userContext);
}
&lt;/pre&gt;&lt;br /&gt;What I understand looking at the above code, the proxy contains a self instance as _staticInstance which is basically used to invoke the method (The Prototype seciton) and it returns the WebRequest properly. But what I do not understand why override function does not inculde the return keyword. it should be like this:&lt;br /&gt;&lt;pre class="coloredcode"&gt;DataService.LongOperation= function(miliseconds,onSuccess,onFailed,userContext)
{
	&lt;span class="kwd"&gt;return&lt;/span&gt; DataService._staticInstance.LongOperation(miliseconds,onSuccess,onFailed,userContext);
}&lt;/pre&gt;&lt;br /&gt;So to get the WebRequest I have to call the DataService._staticInstance.LongOperation instead of DataService.LongOperation().&lt;br /&gt;&lt;br /&gt;Can any of the Ajax Team members shed a light on this? Is it a bug or intentional, if it is intentional then what is the reason?</description></item></channel></rss>