<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>How To Consume WCF Using AJAX Without ASP.NET</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx</link><description>How to consume WCF services directly from Html client? How to add AJAX-like functionally to application that does not natively support ASP.NET AJAX like classic ASP, ASP.NET 1.1, or PHP? WCF that ships with .Net 3.5 provides capability to consume it from</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: How To Consume WCF Using AJAX Without ASP.NET</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx#7789097</link><pubDate>Tue, 19 Feb 2008 11:45:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7789097</guid><dc:creator>Tamas Varga</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;is this working in Mozilla too?&lt;/p&gt;
&lt;p&gt;for me the Microsoft.XmlHttp is very strange?&lt;/p&gt;
&lt;p&gt;Isn't there a more 'standard' &amp;nbsp;way?:)&lt;/p&gt;
&lt;p&gt;Tamas&lt;/p&gt;</description></item><item><title>re: How To Consume WCF Using AJAX Without ASP.NET</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx#7790088</link><pubDate>Tue, 19 Feb 2008 13:29:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7790088</guid><dc:creator>alikl</dc:creator><description>&lt;p&gt;Good point, Tamas!&lt;/p&gt;
&lt;p&gt;The focus of the post is about server side - how WCF exposes itself to AJAX clients, but your comment is valid and very relevant.&lt;/p&gt;
&lt;p&gt;Any client that can issue such HTTP request can consume WCF services that exposes itself via webHttpBinding. I am not in the know how it is done with Mozila in &amp;quot;standard way&amp;quot;, but in IE Microsoft.XmlHttp is the way to do. Search the web and you will find plenty code samples I am sure. Once you found the sample construct the following HTTP request using your code. I captured it using Fiddler. Make sure you substitute few details relevant to your environment.&lt;/p&gt;
&lt;p&gt;POST /Service1.svc/ajaxEndpoint/Sum2Integers HTTP/1.1&lt;/p&gt;
&lt;p&gt;Accept: */*&lt;/p&gt;
&lt;p&gt;Accept-Language: en-us&lt;/p&gt;
&lt;p&gt;Referer: &lt;a rel="nofollow" target="_new" href="http://localhost.:56966/WCFConsumer.htm"&gt;http://localhost.:56966/WCFConsumer.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Content-Type: application/json&lt;/p&gt;
&lt;p&gt;UA-CPU: x86&lt;/p&gt;
&lt;p&gt;Accept-Encoding: gzip, deflate&lt;/p&gt;
&lt;p&gt;User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SU 3.011; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 3.5.21022; MS-RTC LM 8)&lt;/p&gt;
&lt;p&gt;Host: localhost.:56966&lt;/p&gt;
&lt;p&gt;Content-Length: 15&lt;/p&gt;
&lt;p&gt;Proxy-Connection: Keep-Alive&lt;/p&gt;
&lt;p&gt;Pragma: no-cache&lt;/p&gt;
&lt;p&gt;{&amp;quot;n1&amp;quot;:1,&amp;quot;n2&amp;quot;:2}&lt;/p&gt;
</description></item><item><title>re: How To Consume WCF Using AJAX Without ASP.NET</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx#7806039</link><pubDate>Wed, 20 Feb 2008 03:14:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7806039</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;Very interesting - but I wish you had written this post last week when I was trying to figure this out!! &amp;nbsp;What is the best way to secure these services (reasonably secure but not requiring a whole lot more Javascript code) so that unauthenticated requests are not accepted?&lt;/p&gt;</description></item><item><title>re: How To Consume WCF Using AJAX Without ASP.NET</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx#7811669</link><pubDate>Wed, 20 Feb 2008 09:24:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7811669</guid><dc:creator>alikl</dc:creator><description>&lt;p&gt;Nick!&lt;/p&gt;
&lt;p&gt;Great to hear you found it interesting. I am going to address security and other details, like JASON vs XML encoding, in my next posts.&lt;/p&gt;
&lt;p&gt;Basically speaking - there should be nothing special about authenticaion. In case of windows integrated or other type of authentication XmlHttp was used for long ago before WCF and it &amp;quot;knows&amp;quot; how to pick up on right athentication scheme already in use. No extra JavaScript is requred. Do you struggle with any particula issue that you want to share? Would love to hear about it.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;alikl&lt;/p&gt;
</description></item><item><title>推荐系列：2008年第06期 总8期</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx#7819294</link><pubDate>Wed, 20 Feb 2008 18:20:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7819294</guid><dc:creator>TerryLee</dc:creator><description>&lt;p&gt;概述春节后的第一期推荐系列文章，共有10篇文章：1.ASP.NETMVCExampleApplicationoverNorthwindwiththeEntityFramework...&lt;/p&gt;</description></item><item><title>【收藏】推荐系列：2008年第06期 总8期 </title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx#7826840</link><pubDate>Thu, 21 Feb 2008 04:33:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7826840</guid><dc:creator>Jacky_Xu</dc:creator><description>&lt;p&gt;概述 春节后的第一期推荐系列文章，共有10篇文章： 1.ASP.NETMVCExampleApplicationoverNorthwindwiththeEntityFr...&lt;/p&gt;</description></item><item><title>WCF Security Resources</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx#8407572</link><pubDate>Fri, 18 Apr 2008 14:22:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8407572</guid><dc:creator>alik levin's</dc:creator><description>&lt;p&gt;This is a digest of WCF Security resources I was collecting for some time. Drop me a comment in case&lt;/p&gt;</description></item><item><title>re: How To Consume WCF Using AJAX Without ASP.NET</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx#8408666</link><pubDate>Fri, 18 Apr 2008 21:22:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8408666</guid><dc:creator>Mariusz</dc:creator><description>&lt;p&gt;Great post! Can you put up an example or do you have and example of calling a svc from a different domain?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;</description></item><item><title>WCF Security Resources</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx#8410944</link><pubDate>Sun, 20 Apr 2008 07:28:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8410944</guid><dc:creator>alik levin's</dc:creator><description>&lt;p&gt;This is a digest of WCF Security resources I was collecting for some time. Drop me a comment in case&lt;/p&gt;
</description></item><item><title>WCF Security Resources</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx#8540480</link><pubDate>Fri, 23 May 2008 20:47:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8540480</guid><dc:creator>J.D. Meier's Blog</dc:creator><description>&lt;p&gt;If you're building Web services or if you're implementing SOA on the Microsoft platform , then you're&lt;/p&gt;
</description></item><item><title>ASP.NET Performance: Fast AJAX, Faster AJAX</title><link>http://blogs.msdn.com/alikl/archive/2008/02/18/how-to-consume-wcf-using-ajax-without-asp-net.aspx#9021019</link><pubDate>Wed, 29 Oct 2008 00:45:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9021019</guid><dc:creator>Alik Levin's</dc:creator><description>&lt;p&gt;&amp;amp;#160; &amp;amp;#160;&amp;amp;#160;&amp;amp;#160; AJAX improves significantly both user experience and performance. It can be&lt;/p&gt;
</description></item></channel></rss>