<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>duncanMgunn.com</title>
    <link>http://www.duncangunn.me.uk/dasblog/</link>
    <description />
    <language>en-us</language>
    <copyright>Duncan M Gunn</copyright>
    <lastBuildDate>Wed, 07 Jul 2010 13:30:21 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>dasblog@example.com</managingEditor>
    <webMaster>dasblog@example.com</webMaster>
    <item>
      <trackback:ping>http://www.duncangunn.me.uk/dasblog/Trackback.aspx?guid=e20b05ea-9b67-4a0b-914f-d35250d82edc</trackback:ping>
      <pingback:server>http://www.duncangunn.me.uk/dasblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.duncangunn.me.uk/dasblog/PermaLink,guid,e20b05ea-9b67-4a0b-914f-d35250d82edc.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.duncangunn.me.uk/dasblog/CommentView,guid,e20b05ea-9b67-4a0b-914f-d35250d82edc.aspx</wfw:comment>
      <wfw:commentRss>http://www.duncangunn.me.uk/dasblog/SyndicationService.asmx/GetEntryCommentsRss?guid=e20b05ea-9b67-4a0b-914f-d35250d82edc</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">If you ever get into the situation where
you've set up Roles, Users etc. on a machine and then script the database over to
another machine, and suddenly the users can't login or aren't in the roles they should
be - make sure you have specified the applicationName property in BOTH the membershipProvider
and roleProvider sections in the web.config.<br /><br /><a href="http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx">http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx</a><br /><p></p><img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=e20b05ea-9b67-4a0b-914f-d35250d82edc" /></body>
      <title>ASP.NET Membership provider - certified works on my machine</title>
      <guid isPermaLink="false">http://www.duncangunn.me.uk/dasblog/PermaLink,guid,e20b05ea-9b67-4a0b-914f-d35250d82edc.aspx</guid>
      <link>http://www.duncangunn.me.uk/dasblog/2010/07/07/ASPNETMembershipProviderCertifiedWorksOnMyMachine.aspx</link>
      <pubDate>Wed, 07 Jul 2010 13:30:21 GMT</pubDate>
      <description>If you ever get into the situation where you've set up Roles, Users etc. on a machine and then script the database over to another machine, and suddenly the users can't login or aren't in the roles they should be - make sure you have specified the applicationName property in BOTH the membershipProvider and roleProvider sections in the web.config.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx&lt;/a&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=e20b05ea-9b67-4a0b-914f-d35250d82edc" /&gt;</description>
      <comments>http://www.duncangunn.me.uk/dasblog/CommentView,guid,e20b05ea-9b67-4a0b-914f-d35250d82edc.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.duncangunn.me.uk/dasblog/Trackback.aspx?guid=3aad13b9-1d61-40e2-a9aa-800e1432d053</trackback:ping>
      <pingback:server>http://www.duncangunn.me.uk/dasblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.duncangunn.me.uk/dasblog/PermaLink,guid,3aad13b9-1d61-40e2-a9aa-800e1432d053.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.duncangunn.me.uk/dasblog/CommentView,guid,3aad13b9-1d61-40e2-a9aa-800e1432d053.aspx</wfw:comment>
      <wfw:commentRss>http://www.duncangunn.me.uk/dasblog/SyndicationService.asmx/GetEntryCommentsRss?guid=3aad13b9-1d61-40e2-a9aa-800e1432d053</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">If we have a varchar column as a Primary
Key (don't ask - we also are not able to alter the schema) then we can still use Max
to generate IDs programmatically.<br /><br />
However, because the column is char, then SQL Server will determine that '9' is actually
greater than '1','0' [10] so we need to be a little bit smarter.<br /><br />
Use this:<br /><br /><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: Arial; font-size: 12px; line-height: 20px;">1.
DECLARE @Length INT<br />
2. SET @Length=(SELECT MAX(LEN(ID)) from test)<br />
3. SELECT TOP 1 ID FROM Test WHERE LEN(ID)=@Length ORDER BY ID DESC<br /><br />
Thanks to </span></span><a href="http://www.dotnetspider.com/forum/192995-Can-we-apply-Max-function-SQL-Query-for.aspx">http://www.dotnetspider.com/forum/192995-Can-we-apply-Max-function-SQL-Query-for.aspx</a><br /><br />
And if you want to call this using LINQ to SQL (or variant thereof), you could try:<br /><br /><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: Verdana,Geneva,Arial,Helvetica,sans-serif; font-size: 11px;">CREATE
PROCEDURE web_GetMaxCampaignCode 
<br />
(@maxcode int output)<br />
AS<br />
BEGIN<br />
    -- SET NOCOUNT ON added to prevent extra result sets from<br />
    -- interfering with SELECT statements.<br />
    SET NOCOUNT ON;<br /><br />
  DECLARE @Length INT<br />
  SET @Length=(SELECT MAX(LEN(campaign_code)) from ref_campaign_code)<br />
  SET @maxcode = (SELECT TOP 1 campaign_code FROM ref_campaign_code WHERE LEN(campaign_code)=@Length
ORDER BY campaign_code DESC)<br />
END<br />
GO<br /><br /><br />
Calling Code:<br /><br /><br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">static</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> GetFirstName(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">int</span> id)
{ <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">using</span> (MyDataContext
dataContext <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> MyDataContext())
{ <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> FirstName;
var query <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> dataContext.GetFirstName(id, <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">ref</span> FirstName); <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">return</span> FirstName;
} }</span></pre>
Then just drag your sproc onto the dbml and call it like above.<br /></span></span><p></p><img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=3aad13b9-1d61-40e2-a9aa-800e1432d053" /></body>
      <title>Useful SQL to get max from varchar column</title>
      <guid isPermaLink="false">http://www.duncangunn.me.uk/dasblog/PermaLink,guid,3aad13b9-1d61-40e2-a9aa-800e1432d053.aspx</guid>
      <link>http://www.duncangunn.me.uk/dasblog/2010/06/29/UsefulSQLToGetMaxFromVarcharColumn.aspx</link>
      <pubDate>Tue, 29 Jun 2010 13:26:15 GMT</pubDate>
      <description>If we have a varchar column as a Primary Key (don't ask - we also are not able to alter the schema) then we can still use Max to generate IDs programmatically.&lt;br&gt;
&lt;br&gt;
However, because the column is char, then SQL Server will determine that '9' is actually
greater than '1','0' [10] so we need to be a little bit smarter.&lt;br&gt;
&lt;br&gt;
Use this:&lt;br&gt;
&lt;br&gt;
&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial; font-size: 12px; line-height: 20px;"&gt;1.
DECLARE @Length INT&lt;br&gt;
2. SET @Length=(SELECT MAX(LEN(ID)) from test)&lt;br&gt;
3. SELECT TOP 1 ID FROM Test WHERE LEN(ID)=@Length ORDER BY ID DESC&lt;br&gt;
&lt;br&gt;
Thanks to &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.dotnetspider.com/forum/192995-Can-we-apply-Max-function-SQL-Query-for.aspx"&gt;http://www.dotnetspider.com/forum/192995-Can-we-apply-Max-function-SQL-Query-for.aspx&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
And if you want to call this using LINQ to SQL (or variant thereof), you could try:&lt;br&gt;
&lt;br&gt;
&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,Geneva,Arial,Helvetica,sans-serif; font-size: 11px;"&gt;CREATE
PROCEDURE web_GetMaxCampaignCode 
&lt;br&gt;
(@maxcode int output)&lt;br&gt;
AS&lt;br&gt;
BEGIN&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -- SET NOCOUNT ON added to prevent extra result sets from&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -- interfering with SELECT statements.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; SET NOCOUNT ON;&lt;br&gt;
&lt;br&gt;
&amp;nbsp; DECLARE @Length INT&lt;br&gt;
&amp;nbsp; SET @Length=(SELECT MAX(LEN(campaign_code)) from ref_campaign_code)&lt;br&gt;
&amp;nbsp; SET @maxcode = (SELECT TOP 1 campaign_code FROM ref_campaign_code WHERE LEN(campaign_code)=@Length
ORDER BY campaign_code DESC)&lt;br&gt;
END&lt;br&gt;
GO&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Calling Code:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;static&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; GetFirstName(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;int&lt;/span&gt; id)
{ &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;using&lt;/span&gt; (MyDataContext
dataContext &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;new&lt;/span&gt; MyDataContext())
{ &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; FirstName;
var query &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; dataContext.GetFirstName(id, &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;ref&lt;/span&gt; FirstName); &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; FirstName;
} }&lt;/span&gt;&lt;/pre&gt;
Then just drag your sproc onto the dbml and call it like above.&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=3aad13b9-1d61-40e2-a9aa-800e1432d053" /&gt;</description>
      <comments>http://www.duncangunn.me.uk/dasblog/CommentView,guid,3aad13b9-1d61-40e2-a9aa-800e1432d053.aspx</comments>
      <category>Database</category>
    </item>
    <item>
      <trackback:ping>http://www.duncangunn.me.uk/dasblog/Trackback.aspx?guid=b9c82a40-8cdc-43c3-8f03-62d080cdeb16</trackback:ping>
      <pingback:server>http://www.duncangunn.me.uk/dasblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.duncangunn.me.uk/dasblog/PermaLink,guid,b9c82a40-8cdc-43c3-8f03-62d080cdeb16.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.duncangunn.me.uk/dasblog/CommentView,guid,b9c82a40-8cdc-43c3-8f03-62d080cdeb16.aspx</wfw:comment>
      <wfw:commentRss>http://www.duncangunn.me.uk/dasblog/SyndicationService.asmx/GetEntryCommentsRss?guid=b9c82a40-8cdc-43c3-8f03-62d080cdeb16</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Using Apache's mod_rewrite, we can move
requests from an old domain to a new one very easily.<br /><br />
However - you may search on the internet and find this:<br /><br />
Redirect 301 / http://www.example.com/<br /><br /><br /><b>THIS WILL NOT WORK.</b><br /><br />
Certainly, in my experience, the original file that was requested was appended onto
the new domain, for example if the user types:<br /><br />
www.foo.com/file1.html<br /><br />
Then they were being redirected to<br /><br />
www.bar.com/file1.html<br /><br />
file1.html was always being appended, and resulting in a 404 (as I had completely
changed the structure of the site)<br /><br />
What you need is RewriteRule.<br /><br />
RewriteEngine on<br />
RewriteRule (.*) http://www.[newdomain].com/ [R=301,L]<br /><br />
And everything works.<br /><br />
So, create your .htaccess file (note: no prefix - it has to be .htaccess, so you may
need to create/rename the file on the server) in the root of the website.<br /><br /><p></p><img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=b9c82a40-8cdc-43c3-8f03-62d080cdeb16" /></body>
      <title>How to redirect one domain to another - the correct way</title>
      <guid isPermaLink="false">http://www.duncangunn.me.uk/dasblog/PermaLink,guid,b9c82a40-8cdc-43c3-8f03-62d080cdeb16.aspx</guid>
      <link>http://www.duncangunn.me.uk/dasblog/2010/06/05/HowToRedirectOneDomainToAnotherTheCorrectWay.aspx</link>
      <pubDate>Sat, 05 Jun 2010 11:43:07 GMT</pubDate>
      <description>Using Apache's mod_rewrite, we can move requests from an old domain to a new one very easily.&lt;br&gt;
&lt;br&gt;
However - you may search on the internet and find this:&lt;br&gt;
&lt;br&gt;
Redirect 301 / http://www.example.com/&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;THIS WILL NOT WORK.&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
Certainly, in my experience, the original file that was requested was appended onto
the new domain, for example if the user types:&lt;br&gt;
&lt;br&gt;
www.foo.com/file1.html&lt;br&gt;
&lt;br&gt;
Then they were being redirected to&lt;br&gt;
&lt;br&gt;
www.bar.com/file1.html&lt;br&gt;
&lt;br&gt;
file1.html was always being appended, and resulting in a 404 (as I had completely
changed the structure of the site)&lt;br&gt;
&lt;br&gt;
What you need is RewriteRule.&lt;br&gt;
&lt;br&gt;
RewriteEngine on&lt;br&gt;
RewriteRule (.*) http://www.[newdomain].com/ [R=301,L]&lt;br&gt;
&lt;br&gt;
And everything works.&lt;br&gt;
&lt;br&gt;
So, create your .htaccess file (note: no prefix - it has to be .htaccess, so you may
need to create/rename the file on the server) in the root of the website.&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=b9c82a40-8cdc-43c3-8f03-62d080cdeb16" /&gt;</description>
      <comments>http://www.duncangunn.me.uk/dasblog/CommentView,guid,b9c82a40-8cdc-43c3-8f03-62d080cdeb16.aspx</comments>
      <category>Web Design</category>
    </item>
    <item>
      <trackback:ping>http://www.duncangunn.me.uk/dasblog/Trackback.aspx?guid=45b88ca8-40f5-443a-ba27-af53c972e757</trackback:ping>
      <pingback:server>http://www.duncangunn.me.uk/dasblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.duncangunn.me.uk/dasblog/PermaLink,guid,45b88ca8-40f5-443a-ba27-af53c972e757.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.duncangunn.me.uk/dasblog/CommentView,guid,45b88ca8-40f5-443a-ba27-af53c972e757.aspx</wfw:comment>
      <wfw:commentRss>http://www.duncangunn.me.uk/dasblog/SyndicationService.asmx/GetEntryCommentsRss?guid=45b88ca8-40f5-443a-ba27-af53c972e757</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">A nice example of using Windbg to get to
the root of a problem:<br /><br /><a href="http://blogs.technet.com/b/markrussinovich/archive/2010/06/01/3335060.aspx">http://blogs.technet.com/b/markrussinovich/archive/2010/06/01/3335060.aspx</a><br /><p></p><img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=45b88ca8-40f5-443a-ba27-af53c972e757" /></body>
      <title>Windbg in action</title>
      <guid isPermaLink="false">http://www.duncangunn.me.uk/dasblog/PermaLink,guid,45b88ca8-40f5-443a-ba27-af53c972e757.aspx</guid>
      <link>http://www.duncangunn.me.uk/dasblog/2010/06/02/WindbgInAction.aspx</link>
      <pubDate>Wed, 02 Jun 2010 14:14:51 GMT</pubDate>
      <description>A nice example of using Windbg to get to the root of a problem:&lt;br&gt;
&lt;br&gt;
&lt;a href="http://blogs.technet.com/b/markrussinovich/archive/2010/06/01/3335060.aspx"&gt;http://blogs.technet.com/b/markrussinovich/archive/2010/06/01/3335060.aspx&lt;/a&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=45b88ca8-40f5-443a-ba27-af53c972e757" /&gt;</description>
      <comments>http://www.duncangunn.me.uk/dasblog/CommentView,guid,45b88ca8-40f5-443a-ba27-af53c972e757.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.duncangunn.me.uk/dasblog/Trackback.aspx?guid=ca6328e0-0914-4977-a11b-984114036565</trackback:ping>
      <pingback:server>http://www.duncangunn.me.uk/dasblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.duncangunn.me.uk/dasblog/PermaLink,guid,ca6328e0-0914-4977-a11b-984114036565.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.duncangunn.me.uk/dasblog/CommentView,guid,ca6328e0-0914-4977-a11b-984114036565.aspx</wfw:comment>
      <wfw:commentRss>http://www.duncangunn.me.uk/dasblog/SyndicationService.asmx/GetEntryCommentsRss?guid=ca6328e0-0914-4977-a11b-984114036565</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">This article presumes that you know the
backgrounds to REST and WCF, and provides a practical example of creating a RESTful
Web Service - without the help of the REST Starter Kit.<br /><br /><h1>Step 1 - Create your Web Service Library
</h1><br />
Good practice is to separate the actual service code from the service definition. 
I do this by creating two projects - a ServiceLibrary and the Service itself. 
I always start by creating the Library.<br /><br />
Create a Plain Old new C# Library.  
<br /><br />
Create your IService interface, like so:<br /><br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;">[ServiceContract] <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">interface</span> IService1
{ [OperationContract] <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> GetData(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">int</span> value);
[OperationContract] TestObject GetDataUsingDataContract(TestObject composite); [WebInvoke(UriTemplate=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"/users"</span>,
Method=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"POST"</span>)]
[OperationContract] <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">void</span> Submit(TestObject
eval); [OperationContract] [WebGet(UriTemplate=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"*"</span>)] <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> Test();
[OperationContract] [WebGet(UriTemplate <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"test2"</span>)] <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> Test2();
[OperationContract] [WebGet(UriTemplate=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"users"</span>)]
List&lt;TestObject&gt; Get(); [OperationContract] [WebGet(UriTemplate <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"users/{userid}"</span>)]
TestObject GetUser(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> userid);
[OperationContract] <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">void</span> Remove(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> id); <span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">//
TODO: Add your service operations here</span> } <span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">//
Use a data contract as illustrated in the sample below to add composite types to service
operations</span> [DataContract(Name=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"testobject"</span>,
Namespace <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">""</span>)] <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">class</span> TestObject
{ [DataMember] <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> Id
{ get; set; } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">bool</span> boolValue <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">true</span>; <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> stringValue <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Hello
"</span>; [DataMember] <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">bool</span> BoolValue
{ get { <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">return</span> boolValue;
} set { boolValue <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> value;
} } [DataMember] <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> StringValue
{ get { <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">return</span> stringValue;
} set { stringValue <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> value;
} } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span> TestObject()
{ } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span> TestObject(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> id, <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> val)
{ Id <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> id;
StringValue <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> val;
} }</span></pre><br />
I've also created my TestObject class here, which is the resource we will deal with
in our service.<br /><br />
As you can see, IService1 looks like a bog standard WCF service definition 
<br /><br />
Now create your concrete implementation, as so:<br /><br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;">[ServiceBehavior(InstanceContextMode <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> InstanceContextMode.Single)]
[AspNetCompatibilityRequirements(RequirementsMode <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> AspNetCompatibilityRequirementsMode.Allowed)] <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">class</span> Service1
: IService1 { List&lt;TestObject&gt; objects <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> List&lt;TestObject&gt;(); <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span> Service1()
{ objects.Add(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> TestObject(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"1"</span>, <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Duncan"</span>));
objects.Add(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> TestObject(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"2"</span>, <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Joe
Bloggs"</span>)); objects.Add(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">new</span> TestObject(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"3"</span>, <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Alice
Anderson"</span>)); } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> GetData(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">int</span> value)
{ <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">return</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span>.Format(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"You
entered: {0}"</span>, value); } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> Test()
{ <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">return</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Hello
World!"</span>; } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> Test2()
{ <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">return</span><span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"We
got some REST goin' on"</span>; } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span> TestObject
GetDataUsingDataContract(TestObject composite) { <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">if</span> (composite.BoolValue)
{ composite.StringValue += <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Suffix"</span>;
} <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">return</span> composite;
} <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">void</span> Submit(TestObject
eval) { eval.Id <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">=</span> Guid.NewGuid().ToString();
objects.Add(eval); } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span> List&lt;TestObject&gt;
Get() { <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">return</span> objects;
} <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span> TestObject
GetUser(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> userid)
{ <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">return</span> objects.Find(e
=&gt; e.Id.Equals(userid)); } <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">public</span><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">void</span> Remove(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">string</span> id)
{ objects.Remove(objects.Find(e =&gt; e.Id.Equals(id))); } }</span></pre><br />
What I've done here is create my service as a single instance, by using the InstanceContextMode
parameter in the ServiceBehaviour attribute.  This means that we can keep an
in-memory list of objects which will be preserved between calls to the service.<br /><br /><h1>Step 2 - Create your Service
</h1>
Okay, so that is the inner workings of the service created.  But all we have
is now a .NET assembly - it's still not a WCF service.  
<br /><br />
Create your service by adding a new project and selecting WCF Service Application,
like below:<h1><br /></h1><p></p><img src="http://www.duncangunn.me.uk/dasblog/content/binary/WCF_New_service.png" border="0" /><br /><br /><br />
Call it RESTService.<br /><br />
Delete everything except RESTService.svc - including the .cs files under RESTService.svc.<br /><br />
Add a project reference to the REST Service Library project you created in Step 1.<br /><br />
Edit the markup of RESTService.svc so that it looks like the following:<br /><br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;">&lt;%@
ServiceHost Language=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"C#"</span> Debug=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"true"</span> Service=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"RESTWCFLibrary.Service1"</span> Factory=<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"System.ServiceModel.Activation.WebServiceHostFactory"</span> %&gt;</span></pre><br /><h1>Step 3 - Install into IIS and edit the bindings
</h1><br />
Now the fiddly bit.<br /><br />
Edit the web.config so that your bindings look like (most important things to note
are in <font color="#ff0000">red</font>) :<br /><br /><br />
&lt;system.serviceModel&gt;<br />
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"
/&gt;<br />
      &lt;behaviors&gt;<br />
        &lt;endpointBehaviors&gt;<br />
          &lt;behavior name="RESTServiceBehavior"&gt;<br />
            <font color="#ff0000">&lt;webHttp
/&gt;</font><br />
          &lt;/behavior&gt;<br />
        &lt;/endpointBehaviors&gt;<br />
      &lt;/behaviors&gt;<br />
      &lt;services&gt;<br />
        &lt;service name="RESTWCFLibrary.Service1"&gt;<br />
          &lt;endpoint name="default"
address="" binding="basicHttpBinding" contract="RESTWCFLibrary.IService1"/&gt;<br />
          &lt;endpoint name="RESTEndpoint" <font color="#ff0000">address="REST"</font> behaviorConfiguration="RESTServiceBehavior"<br />
                  <font color="#ff0000">binding="webHttpBinding" </font><br />
                 
contract="RESTWCFLibrary.IService1"&gt;<br />
          &lt;/endpoint&gt;<br />
        &lt;/service&gt;<br />
      &lt;/services&gt;<br />
      &lt;bindings /&gt;<br />
      &lt;client /&gt;<br />
    &lt;/system.serviceModel&gt;<br /><br /><br />
REST WCF services will only work under the webHttp binding.  By adding a new
endpoint under the "REST" address, your service will be available (for REST calls)
under RestServiceName/REST/[resources here...]<br /><br />
Installing under IIS is easy.  Create a new website/vdir and point the physical
path to the directory that hosts your .svc file.  And that's it - hosted!<br /><br /><h1>Step 4 - Testing - GETs and POSTs
</h1><br />
Now to test your service.  Open a browser and enter a URL similar to the following:<br /><br /><font face="Courier New">http://localhost/restWCFSite/RESTservice.svc/rest</font><br /><br />
If you implemented your ServiceContract as above, this will hit the default method
on the Service - which is the method Test.  You should see an XML packet returned
with "Hello World!" as the string.<br /><br />
Entering the following<br /><br /><font face="Courier New">http://localhost/restWCFSite/RESTservice.svc/rest/users<br /><font face="Times New Roman"><br /><font face="Verdana">will list all the users in the 'database' and<br /><br /></font></font></font><font face="Courier New">http://localhost/restWCFSite/RESTservice.svc/rest/users/1</font><br /><font face="Courier New"><font face="Times New Roman"><font face="Verdana"><br />
will query that user by id - returning only that specified user.<br /><br />
To add data, you'll need to use Fiddler and construct the POST request yourself.<br /><br />
To do this, open up Fiddler, go to the Request Builder tab, and enter the following:<br /><br /></font></font></font><img src="http://www.duncangunn.me.uk/dasblog/content/binary/WCF_Fiddler_POST_request.png" border="0" /><br /><br /><br /><br />
Note that the attributes MUST be in upper-case, if you put &lt;stringvalue&gt; instead
of &lt;StringValue&gt; then it will not be able to parse these into the correct fields
of the testobject class.<br /><br />
Execute this request.<br /><br />
If you go back to your previous GET and list the users, you should see your new user
appear in the list.<br /><br />
That's it - your first REST service.<br /><br /><br /><br /><img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=ca6328e0-0914-4977-a11b-984114036565" /></body>
      <title>Building a RESTful service in WCF</title>
      <guid isPermaLink="false">http://www.duncangunn.me.uk/dasblog/PermaLink,guid,ca6328e0-0914-4977-a11b-984114036565.aspx</guid>
      <link>http://www.duncangunn.me.uk/dasblog/2010/05/28/BuildingARESTfulServiceInWCF.aspx</link>
      <pubDate>Fri, 28 May 2010 16:11:44 GMT</pubDate>
      <description>This article presumes that you know the backgrounds to REST and WCF, and provides a practical example of creating a RESTful Web Service - without the help of the REST Starter Kit.&lt;br&gt;
&lt;br&gt;
&lt;h1&gt;Step 1 - Create your Web Service Library
&lt;/h1&gt;
&lt;br&gt;
Good practice is to separate the actual service code from the service definition.&amp;nbsp;
I do this by creating two projects - a ServiceLibrary and the Service itself.&amp;nbsp;
I always start by creating the Library.&lt;br&gt;
&lt;br&gt;
Create a Plain Old new C# Library.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
Create your IService interface, like so:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;[ServiceContract] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;interface&lt;/span&gt; IService1
{ [OperationContract] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; GetData(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;int&lt;/span&gt; value);
[OperationContract] TestObject GetDataUsingDataContract(TestObject composite); [WebInvoke(UriTemplate=&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"/users"&lt;/span&gt;,
Method=&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"POST"&lt;/span&gt;)]
[OperationContract] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;void&lt;/span&gt; Submit(TestObject
eval); [OperationContract] [WebGet(UriTemplate=&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"*"&lt;/span&gt;)] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; Test();
[OperationContract] [WebGet(UriTemplate &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"test2"&lt;/span&gt;)] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; Test2();
[OperationContract] [WebGet(UriTemplate=&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"users"&lt;/span&gt;)]
List&amp;lt;TestObject&amp;gt; Get(); [OperationContract] [WebGet(UriTemplate &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"users/{userid}"&lt;/span&gt;)]
TestObject GetUser(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; userid);
[OperationContract] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;void&lt;/span&gt; Remove(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; id); &lt;span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;//
TODO: Add your service operations here&lt;/span&gt; } &lt;span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;//
Use a data contract as illustrated in the sample below to add composite types to service
operations&lt;/span&gt; [DataContract(Name=&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"testobject"&lt;/span&gt;,
Namespace &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;""&lt;/span&gt;)] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;class&lt;/span&gt; TestObject
{ [DataMember] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; Id
{ get; set; } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;bool&lt;/span&gt; boolValue &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;true&lt;/span&gt;; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; stringValue &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Hello
"&lt;/span&gt;; [DataMember] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;bool&lt;/span&gt; BoolValue
{ get { &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; boolValue;
} set { boolValue &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; value;
} } [DataMember] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; StringValue
{ get { &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; stringValue;
} set { stringValue &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; value;
} } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; TestObject()
{ } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; TestObject(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; id, &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; val)
{ Id &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; id;
StringValue &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; val;
} }&lt;/span&gt;&lt;/pre&gt;
&lt;br&gt;
I've also created my TestObject class here, which is the resource we will deal with
in our service.&lt;br&gt;
&lt;br&gt;
As you can see, IService1 looks like a bog standard WCF service definition 
&lt;br&gt;
&lt;br&gt;
Now create your concrete implementation, as so:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;[ServiceBehavior(InstanceContextMode &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; InstanceContextMode.Single)]
[AspNetCompatibilityRequirements(RequirementsMode &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; AspNetCompatibilityRequirementsMode.Allowed)] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;class&lt;/span&gt; Service1
: IService1 { List&amp;lt;TestObject&amp;gt; objects &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;new&lt;/span&gt; List&amp;lt;TestObject&amp;gt;(); &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; Service1()
{ objects.Add(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;new&lt;/span&gt; TestObject(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"1"&lt;/span&gt;, &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Duncan"&lt;/span&gt;));
objects.Add(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;new&lt;/span&gt; TestObject(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"2"&lt;/span&gt;, &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Joe
Bloggs"&lt;/span&gt;)); objects.Add(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;new&lt;/span&gt; TestObject(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"3"&lt;/span&gt;, &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Alice
Anderson"&lt;/span&gt;)); } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; GetData(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;int&lt;/span&gt; value)
{ &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt;.Format(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"You
entered: {0}"&lt;/span&gt;, value); } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; Test()
{ &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Hello
World!"&lt;/span&gt;; } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; Test2()
{ &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"We
got some REST goin' on"&lt;/span&gt;; } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; TestObject
GetDataUsingDataContract(TestObject composite) { &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;if&lt;/span&gt; (composite.BoolValue)
{ composite.StringValue += &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Suffix"&lt;/span&gt;;
} &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; composite;
} &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;void&lt;/span&gt; Submit(TestObject
eval) { eval.Id &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;=&lt;/span&gt; Guid.NewGuid().ToString();
objects.Add(eval); } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; List&amp;lt;TestObject&amp;gt;
Get() { &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; objects;
} &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; TestObject
GetUser(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; userid)
{ &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;return&lt;/span&gt; objects.Find(e
=&amp;gt; e.Id.Equals(userid)); } &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;void&lt;/span&gt; Remove(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;string&lt;/span&gt; id)
{ objects.Remove(objects.Find(e =&amp;gt; e.Id.Equals(id))); } }&lt;/span&gt;&lt;/pre&gt;
&lt;br&gt;
What I've done here is create my service as a single instance, by using the InstanceContextMode
parameter in the ServiceBehaviour attribute.&amp;nbsp; This means that we can keep an
in-memory list of objects which will be preserved between calls to the service.&lt;br&gt;
&lt;br&gt;
&lt;h1&gt;Step 2 - Create your Service
&lt;/h1&gt;
Okay, so that is the inner workings of the service created.&amp;nbsp; But all we have
is now a .NET assembly - it's still not a WCF service.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
Create your service by adding a new project and selecting WCF Service Application,
like below:&lt;h1&gt;
&lt;br&gt;
&lt;/h1&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://www.duncangunn.me.uk/dasblog/content/binary/WCF_New_service.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Call it RESTService.&lt;br&gt;
&lt;br&gt;
Delete everything except RESTService.svc - including the .cs files under RESTService.svc.&lt;br&gt;
&lt;br&gt;
Add a project reference to the REST Service Library project you created in Step 1.&lt;br&gt;
&lt;br&gt;
Edit the markup of RESTService.svc so that it looks like the following:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;&amp;lt;%@
ServiceHost Language=&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"C#"&lt;/span&gt; Debug=&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"true"&lt;/span&gt; Service=&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"RESTWCFLibrary.Service1"&lt;/span&gt; Factory=&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"System.ServiceModel.Activation.WebServiceHostFactory"&lt;/span&gt; %&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br&gt;
&lt;h1&gt;Step 3 - Install into IIS and edit the bindings
&lt;/h1&gt;
&lt;br&gt;
Now the fiddly bit.&lt;br&gt;
&lt;br&gt;
Edit the web.config so that your bindings look like (most important things to note
are in &lt;font color="#ff0000"&gt;red&lt;/font&gt;) :&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;lt;system.serviceModel&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"
/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;behaviors&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpointBehaviors&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;behavior name="RESTServiceBehavior"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#ff0000"&gt;&amp;lt;webHttp
/&amp;gt;&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/behavior&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/endpointBehaviors&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/behaviors&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;services&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;service name="RESTWCFLibrary.Service1"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint name="default"
address="" binding="basicHttpBinding" contract="RESTWCFLibrary.IService1"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endpoint name="RESTEndpoint" &lt;font color="#ff0000"&gt;address="REST"&lt;/font&gt; behaviorConfiguration="RESTServiceBehavior"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#ff0000"&gt;binding="webHttpBinding" &lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
contract="RESTWCFLibrary.IService1"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/endpoint&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/service&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/services&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bindings /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;client /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/system.serviceModel&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
REST WCF services will only work under the webHttp binding.&amp;nbsp; By adding a new
endpoint under the "REST" address, your service will be available (for REST calls)
under RestServiceName/REST/[resources here...]&lt;br&gt;
&lt;br&gt;
Installing under IIS is easy.&amp;nbsp; Create a new website/vdir and point the physical
path to the directory that hosts your .svc file.&amp;nbsp; And that's it - hosted!&lt;br&gt;
&lt;br&gt;
&lt;h1&gt;Step 4 - Testing - GETs and POSTs
&lt;/h1&gt;
&lt;br&gt;
Now to test your service.&amp;nbsp; Open a browser and enter a URL similar to the following:&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;http://localhost/restWCFSite/RESTservice.svc/rest&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
If you implemented your ServiceContract as above, this will hit the default method
on the Service - which is the method Test.&amp;nbsp; You should see an XML packet returned
with "Hello World!" as the string.&lt;br&gt;
&lt;br&gt;
Entering the following&lt;br&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;http://localhost/restWCFSite/RESTservice.svc/rest/users&lt;br&gt;
&lt;font face="Times New Roman"&gt;
&lt;br&gt;
&lt;font face="Verdana"&gt;will list all the users in the 'database' and&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;http://localhost/restWCFSite/RESTservice.svc/rest/users/1&lt;/font&gt;
&lt;br&gt;
&lt;font face="Courier New"&gt;&lt;font face="Times New Roman"&gt;&lt;font face="Verdana"&gt;
&lt;br&gt;
will query that user by id - returning only that specified user.&lt;br&gt;
&lt;br&gt;
To add data, you'll need to use Fiddler and construct the POST request yourself.&lt;br&gt;
&lt;br&gt;
To do this, open up Fiddler, go to the Request Builder tab, and enter the following:&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;img src="http://www.duncangunn.me.uk/dasblog/content/binary/WCF_Fiddler_POST_request.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Note that the attributes MUST be in upper-case, if you put &amp;lt;stringvalue&amp;gt; instead
of &amp;lt;StringValue&amp;gt; then it will not be able to parse these into the correct fields
of the testobject class.&lt;br&gt;
&lt;br&gt;
Execute this request.&lt;br&gt;
&lt;br&gt;
If you go back to your previous GET and list the users, you should see your new user
appear in the list.&lt;br&gt;
&lt;br&gt;
That's it - your first REST service.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=ca6328e0-0914-4977-a11b-984114036565" /&gt;</description>
      <comments>http://www.duncangunn.me.uk/dasblog/CommentView,guid,ca6328e0-0914-4977-a11b-984114036565.aspx</comments>
      <category>ASP.NET</category>
      <category>wcf</category>
    </item>
    <item>
      <trackback:ping>http://www.duncangunn.me.uk/dasblog/Trackback.aspx?guid=a2b75f34-420b-4ceb-b5ec-d13a8c53f957</trackback:ping>
      <pingback:server>http://www.duncangunn.me.uk/dasblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.duncangunn.me.uk/dasblog/PermaLink,guid,a2b75f34-420b-4ceb-b5ec-d13a8c53f957.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.duncangunn.me.uk/dasblog/CommentView,guid,a2b75f34-420b-4ceb-b5ec-d13a8c53f957.aspx</wfw:comment>
      <wfw:commentRss>http://www.duncangunn.me.uk/dasblog/SyndicationService.asmx/GetEntryCommentsRss?guid=a2b75f34-420b-4ceb-b5ec-d13a8c53f957</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Turns out this was a Facebook bug after
all.<br /><br />
We switched the Firewall back to the way it was, without changing the code, and hey
presto - all is well.<br /><br />
Not only that but the second step (email invites) was not displayed.<br /><br />
FB - All your base are belong to us.<br /><br /><p></p><img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=a2b75f34-420b-4ceb-b5ec-d13a8c53f957" /></body>
      <title>Facebook Cross Domain Communication and F5 Firewall/Load Balancer Part 2</title>
      <guid isPermaLink="false">http://www.duncangunn.me.uk/dasblog/PermaLink,guid,a2b75f34-420b-4ceb-b5ec-d13a8c53f957.aspx</guid>
      <link>http://www.duncangunn.me.uk/dasblog/2010/05/27/FacebookCrossDomainCommunicationAndF5FirewallLoadBalancerPart2.aspx</link>
      <pubDate>Thu, 27 May 2010 09:06:04 GMT</pubDate>
      <description>Turns out this was a Facebook bug after all.&lt;br&gt;
&lt;br&gt;
We switched the Firewall back to the way it was, without changing the code, and hey
presto - all is well.&lt;br&gt;
&lt;br&gt;
Not only that but the second step (email invites) was not displayed.&lt;br&gt;
&lt;br&gt;
FB - All your base are belong to us.&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=a2b75f34-420b-4ceb-b5ec-d13a8c53f957" /&gt;</description>
      <comments>http://www.duncangunn.me.uk/dasblog/CommentView,guid,a2b75f34-420b-4ceb-b5ec-d13a8c53f957.aspx</comments>
      <category>Facebook</category>
    </item>
    <item>
      <trackback:ping>http://www.duncangunn.me.uk/dasblog/Trackback.aspx?guid=1f37c387-cd42-4877-ab2f-964a9ab62b82</trackback:ping>
      <pingback:server>http://www.duncangunn.me.uk/dasblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.duncangunn.me.uk/dasblog/PermaLink,guid,1f37c387-cd42-4877-ab2f-964a9ab62b82.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.duncangunn.me.uk/dasblog/CommentView,guid,1f37c387-cd42-4877-ab2f-964a9ab62b82.aspx</wfw:comment>
      <wfw:commentRss>http://www.duncangunn.me.uk/dasblog/SyndicationService.asmx/GetEntryCommentsRss?guid=1f37c387-cd42-4877-ab2f-964a9ab62b82</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Right this way - <a href="http://codezest.com/archive/2008/09/06/fiddler-firefox-local-web-site-testing-easily-foxyproxy.aspx">http://codezest.com/archive/2008/09/06/fiddler-firefox-local-web-site-testing-easily-foxyproxy.aspx</a><br /><br /><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: Verdana,Arial,sans-serif; font-size: 12px; text-align: left;"><h2 style="font: bold 20px Arial,sans-serif; margin-top: 10px; margin-bottom: 1px;"><a id="viewpost_ascx_TitleUrl" title="Title of this entry." href="/archive/2008/09/06/fiddler-firefox-local-web-site-testing-easily-foxyproxy.aspx" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;">Using
Fiddler with Firefox for Local Web site Testing Easily with FoxyProxy</a></h2><div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:2ff6a1c9-0f3e-4f17-bbde-ae98ce0e4344" class="wlWriterSmartContent" style="padding: 0px; margin: 0px; display: inline;">Technorati
Tags:<span class="Apple-converted-space"> </span><a href="http://technorati.com/tags/FireFox" rel="tag" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;">FireFox</a>,<a href="http://technorati.com/tags/Tools" rel="tag" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;">Tools</a></div><p>
 
</p><p>
Fiddler is one of the best tools to analyze web requests sent from a web site and
much more. Normally, using Fiddler with FireFox is a huge pain and typically does
not work well out of the box when testing localhost requests or any requests for that
matter with Fiddler through Firefox.   But by using FoxyProxy which is just
a nice plug-in to FireFox, it allows you to setup different proxies in FireFox very
easily, and you can then hook into Fiddler's proxy quickly, and start to catch requests
over the wire when testing local web applications.
</p><p>
Here is how to set up FoxyProxy for Fiddler and FireFox:
</p><p>
1. If you have not already installed<span class="Apple-converted-space"> </span><a href="http://www.fiddlertool.com/" target="_blank" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;">Fiddler</a><span class="Apple-converted-space"> </span>or<span class="Apple-converted-space"> </span><a href="http://www.mozilla.com/en-US/firefox/" target="_blank" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;">Firefox</a>,
install these first.
</p><p>
2. Download &amp; install the<span class="Apple-converted-space"> </span><a href="https://addons.mozilla.org/en-US/firefox/addon/2464" target="_blank" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;">FoxyProxy</a><span class="Apple-converted-space"> </span>plug-in
for FireFox.
</p><p>
3. Now you will need to get to the FoxyProxy options.  In FireFox, at the right-hand
corner you should see FoxyProxy running:
</p><p>
   <span class="Apple-converted-space"> </span><a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step7_4.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"><img alt="foxyproxy_step7" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step7_thumb_1.jpg" style="border-width: 0px;" border="0" height="20" width="141" /></a></p><p>
     Here it's just saying that FoxyProxy is not using any proxies
at the moment.
</p><p>
     Now right click that bar and choose "Options".
</p><p>
 
</p><p>
4. Now click the "Add New Proxy" button.  We are going to create a new proxy
instance in FoxyProxy that simply points to Fiddler's proxy BowserPAC.js config file.
</p><p>
   <span class="Apple-converted-space"> </span><a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step1_web_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"><img alt="foxyproxy_step1_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step1_web_thumb.jpg" style="border-width: 0px;" border="0" height="278" width="408" /></a></p><p>
5. First though we need to create a new pattern for this proxy instance and base it
on a localhost wildcard so that any site that you run on localhost will be also caught
when this FoxyProxy instance is running later on.
</p><p>
    So click the<span class="Apple-converted-space"> </span><strong>Patterns
Tab</strong><span class="Apple-converted-space"> </span>then<span class="Apple-converted-space"> </span><strong>Add
New Pattern</strong><span class="Apple-converted-space"> </span>button, then
input the following:
</p><p>
 
</p><p>
   <span class="Apple-converted-space"> </span><strong>Pattern
Name</strong>: localhost
</p><p>
   <span class="Apple-converted-space"> </span><strong>URL Pattern</strong>:
*localhost*
</p><p>
    and then leave the default "Whitelist" and "Wildcards" options
as is
</p><p>
   <span class="Apple-converted-space"> </span><a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step5_web_4.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"><img alt="foxyproxy_step5_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step5_web_thumb_1.jpg" style="border-width: 0px;" border="0" height="278" width="407" /></a></p><p>
6. Now click on the<span class="Apple-converted-space"> </span><strong>Proxy
Details</strong><span class="Apple-converted-space"> </span>tab and select<span class="Apple-converted-space"> </span><strong>Automatic
Proxy Configuration</strong>.  Here is where we are going to browse to Fiddler's
proxy config file.
</p><p>
    a) In Windows XP, Browse and select the fiddler proxy config file
located at the path
</p><p>
       <span class="Apple-converted-space"> </span><a href="file:///c:/documents%20and%20settings/YOURNAMEHERE/my%20documents/Fiddler2/scripts/browserpac.js" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;">file:///c:/documents
and settings/YOURNAMEHERE/my documents/Fiddler2/scripts/browserpac.js</a></p><p>
    b) Enable only the Notification about proxy auto-configuration
file loads
</p><p>
   <span class="Apple-converted-space"> </span><a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step3_web_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"><img alt="foxyproxy_step3_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step3_web_thumb.jpg" style="border-width: 0px;" border="0" height="305" width="408" /></a></p><p>
7. Next, click on the<span class="Apple-converted-space"> </span><strong>General</strong><span class="Apple-converted-space"> </span>tab
and fill in the following to define a name for this Proxy instance:
</p><p>
   <span class="Apple-converted-space"> </span><strong>Proxy Name</strong>:
Fiddler
</p><p>
   <span class="Apple-converted-space"> </span><strong>Enabled</strong>:
checked
</p><p>
   <span class="Apple-converted-space"> </span><strong>Animate
icons when this proxy is in use</strong><span class="Apple-converted-space"> </span>(optional):
checked
</p><p>
   <span class="Apple-converted-space"> </span><strong>Include
this proxy</strong>: checked
</p><p>
   <span class="Apple-converted-space"> </span><a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step2_web_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"><img alt="foxyproxy_step2_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step2_web_thumb.jpg" style="border-width: 0px;" border="0" height="155" width="407" /></a></p><p>
    You've just created a proxy instance for Fiddler inside FoxyProxy.
</p><p>
8. Finally click OK and go back to the "Global Settings" tab then just change the
"Statusbar Activation" left-click option to "Cycles through
</p><p>
    modes"
</p><p>
   <span class="Apple-converted-space"> </span><a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step6_web_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"><img alt="foxyproxy_step6_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step6_web_thumb.jpg" style="border-width: 0px;" border="0" height="215" width="409" /></a></p><p>
9. Now we are ready to actually use this proxy instance that we have defined in FoxyProxy.
</p><p>
    So in Firefox, look at the right-hand corner and click once on<span class="Apple-converted-space"> </span><a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step7_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"><img alt="foxyproxy_step7" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step7_thumb.jpg" style="border-width: 0px;" border="0" height="20" width="141" /></a><span class="Apple-converted-space"> </span>. 
That's FoxyProxy running in FireFox. 
</p><p>
    Now click on it once.
</p><p>
    Notice it will change from being disabled to the pattern status<span class="Apple-converted-space"> </span><a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step8a_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"><img alt="step8a" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step8a_thumb.jpg" style="border-width: 0px;" border="0" height="22" width="132" /></a><span class="Apple-converted-space"> </span>.
</p><p>
    Now we need to tell FoxyProxy which proxy instance (that we just
defined in options) to start using.
</p><p>
    To do this, right-click the patterns box and choose the proxy instance
you created.  So select "Use proxy Fiddler for all URLs":
</p><p>
   <span class="Apple-converted-space"> </span><a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step8_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"><img alt="step8" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step8_thumb.jpg" style="border-width: 0px;" border="0" height="125" width="306" /></a></p><p>
10. FoxyProxy has now been configured for Fiddler as the proxy, and selected as the
instance inside FireFox and it's now running the Fiddler proxy.
</p><p>
      Now we can use fiddler to capture any requests made
from FireFox on any website with no problem.
</p><p>
      You should now be seeing results in Fiddler (example
shown below) after you click around on your localhost site. 
</p><p>
      Here's how mine looks now that fiddler is capturing
any clicks made on my ASP.NET localhost web site :
</p><p>
     <span class="Apple-converted-space"> </span><a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step10b_web_4.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"><img alt="step10b_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step10b_web_thumb_1.jpg" style="border-width: 0px;" border="0" height="105" width="597" /></a> 
</p><p>
      And now we are all set. As you can see above in my
example, now you can inspect a ton of things on any requests captured in Fiddler.
</p></span></span><br /><p></p><img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=1f37c387-cd42-4877-ab2f-964a9ab62b82" /></body>
      <title>Use FoxyProxy to watch HTTP traffic in Fiddler via FireFox</title>
      <guid isPermaLink="false">http://www.duncangunn.me.uk/dasblog/PermaLink,guid,1f37c387-cd42-4877-ab2f-964a9ab62b82.aspx</guid>
      <link>http://www.duncangunn.me.uk/dasblog/2010/05/26/UseFoxyProxyToWatchHTTPTrafficInFiddlerViaFireFox.aspx</link>
      <pubDate>Wed, 26 May 2010 15:10:04 GMT</pubDate>
      <description>Right this way - &lt;a href="http://codezest.com/archive/2008/09/06/fiddler-firefox-local-web-site-testing-easily-foxyproxy.aspx"&gt;http://codezest.com/archive/2008/09/06/fiddler-firefox-local-web-site-testing-easily-foxyproxy.aspx&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"&gt;&lt;span class="Apple-style-span" style="font-family: Verdana,Arial,sans-serif; font-size: 12px; text-align: left;"&gt;
&lt;h2 style="font: bold 20px Arial,sans-serif; margin-top: 10px; margin-bottom: 1px;"&gt;&lt;a id="viewpost_ascx_TitleUrl" title="Title of this entry." href="/archive/2008/09/06/fiddler-firefox-local-web-site-testing-easily-foxyproxy.aspx" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;Using
Fiddler with Firefox for Local Web site Testing Easily with FoxyProxy&lt;/a&gt;
&lt;/h2&gt;
&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:2ff6a1c9-0f3e-4f17-bbde-ae98ce0e4344" class="wlWriterSmartContent" style="padding: 0px; margin: 0px; display: inline;"&gt;Technorati
Tags:&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://technorati.com/tags/FireFox" rel="tag" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;FireFox&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Tools" rel="tag" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;Tools&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Fiddler is one of the best tools to analyze web requests sent from a web site and
much more. Normally, using Fiddler with FireFox is a huge pain and typically does
not work well out of the box when testing localhost requests or any requests for that
matter with Fiddler through Firefox.&amp;nbsp;&amp;nbsp; But by using FoxyProxy which is just
a nice plug-in to FireFox, it allows you to setup different proxies in FireFox very
easily, and you can then hook into Fiddler's proxy quickly, and start to catch requests
over the wire when testing local web applications.
&lt;/p&gt;
&lt;p&gt;
Here is how to set up FoxyProxy for Fiddler and FireFox:
&lt;/p&gt;
&lt;p&gt;
1. If you have not already installed&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.fiddlertool.com/" target="_blank" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;Fiddler&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;or&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.mozilla.com/en-US/firefox/" target="_blank" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;Firefox&lt;/a&gt;,
install these first.
&lt;/p&gt;
&lt;p&gt;
2. Download &amp;amp; install the&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/2464" target="_blank" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;FoxyProxy&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;plug-in
for FireFox.
&lt;/p&gt;
&lt;p&gt;
3. Now you will need to get to the FoxyProxy options.&amp;nbsp; In FireFox, at the right-hand
corner you should see FoxyProxy running:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step7_4.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;&lt;img alt="foxyproxy_step7" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step7_thumb_1.jpg" style="border-width: 0px;" border="0" height="20" width="141"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Here it's just saying that FoxyProxy is not using any proxies
at the moment.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Now right click that bar and choose "Options".
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
4. Now click the "Add New Proxy" button.&amp;nbsp; We are going to create a new proxy
instance in FoxyProxy that simply points to Fiddler's proxy BowserPAC.js config file.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step1_web_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;&lt;img alt="foxyproxy_step1_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step1_web_thumb.jpg" style="border-width: 0px;" border="0" height="278" width="408"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
5. First though we need to create a new pattern for this proxy instance and base it
on a localhost wildcard so that any site that you run on localhost will be also caught
when this FoxyProxy instance is running later on.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; So click the&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Patterns
Tab&lt;/strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;then&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Add
New Pattern&lt;/strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;button, then
input the following:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Pattern
Name&lt;/strong&gt;: localhost
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;URL Pattern&lt;/strong&gt;:
*localhost*
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; and then leave the default "Whitelist" and "Wildcards" options
as is
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step5_web_4.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;&lt;img alt="foxyproxy_step5_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step5_web_thumb_1.jpg" style="border-width: 0px;" border="0" height="278" width="407"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
6. Now click on the&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Proxy
Details&lt;/strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;tab and select&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Automatic
Proxy Configuration&lt;/strong&gt;.&amp;nbsp; Here is where we are going to browse to Fiddler's
proxy config file.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a) In Windows XP, Browse and select the fiddler proxy config file
located at the path
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="file:///c:/documents%20and%20settings/YOURNAMEHERE/my%20documents/Fiddler2/scripts/browserpac.js" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;file:///c:/documents
and settings/YOURNAMEHERE/my documents/Fiddler2/scripts/browserpac.js&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; b) Enable only the Notification about proxy auto-configuration
file loads
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step3_web_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;&lt;img alt="foxyproxy_step3_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step3_web_thumb.jpg" style="border-width: 0px;" border="0" height="305" width="408"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
7. Next, click on the&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;General&lt;/strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;tab
and fill in the following to define a name for this Proxy instance:
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Proxy Name&lt;/strong&gt;:
Fiddler
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Enabled&lt;/strong&gt;:
checked
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Animate
icons when this proxy is in use&lt;/strong&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;(optional):
checked
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Include
this proxy&lt;/strong&gt;: checked
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step2_web_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;&lt;img alt="foxyproxy_step2_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step2_web_thumb.jpg" style="border-width: 0px;" border="0" height="155" width="407"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; You've just created a proxy instance for Fiddler inside FoxyProxy.
&lt;/p&gt;
&lt;p&gt;
8. Finally click OK and go back to the "Global Settings" tab then just change the
"Statusbar Activation" left-click option to "Cycles through
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; modes"
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step6_web_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;&lt;img alt="foxyproxy_step6_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step6_web_thumb.jpg" style="border-width: 0px;" border="0" height="215" width="409"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
9. Now we are ready to actually use this proxy instance that we have defined in FoxyProxy.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; So in Firefox, look at the right-hand corner and click once on&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step7_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;&lt;img alt="foxyproxy_step7" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/foxyproxy_step7_thumb.jpg" style="border-width: 0px;" border="0" height="20" width="141"&gt;&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;.&amp;nbsp;
That's FoxyProxy running in FireFox.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Now click on it once.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Notice it will change from being disabled to the pattern status&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step8a_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;&lt;img alt="step8a" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step8a_thumb.jpg" style="border-width: 0px;" border="0" height="22" width="132"&gt;&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Now we need to tell FoxyProxy which proxy instance (that we just
defined in options) to start using.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; To do this, right-click the patterns box and choose the proxy instance
you created.&amp;nbsp; So select "Use proxy Fiddler for all URLs":
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step8_2.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;&lt;img alt="step8" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step8_thumb.jpg" style="border-width: 0px;" border="0" height="125" width="306"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
10. FoxyProxy has now been configured for Fiddler as the proxy, and selected as the
instance inside FireFox and it's now running the Fiddler proxy.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Now we can use fiddler to capture any requests made
from FireFox on any website with no problem.
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You should now be seeing results in Fiddler (example
shown below) after you click around on your localhost site.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Here's how mine looks now that fiddler is capturing
any clicks made on my ASP.NET localhost web site :
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step10b_web_4.jpg" style="color: rgb(56, 145, 44); background: inherit; text-decoration: none;"&gt;&lt;img alt="step10b_web" src="http://codezest.com/images/codezest_com/WindowsLiveWriter/UsingFoxyProxytoGetFiddlerWorkingwithFir_CB69/step10b_web_thumb_1.jpg" style="border-width: 0px;" border="0" height="105" width="597"&gt;&lt;/a&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; And now we are all set. As you can see above in my
example, now you can inspect a ton of things on any requests captured in Fiddler.
&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=1f37c387-cd42-4877-ab2f-964a9ab62b82" /&gt;</description>
      <comments>http://www.duncangunn.me.uk/dasblog/CommentView,guid,1f37c387-cd42-4877-ab2f-964a9ab62b82.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.duncangunn.me.uk/dasblog/Trackback.aspx?guid=e5237e72-b63f-44eb-928a-b6e5ddf6c45a</trackback:ping>
      <pingback:server>http://www.duncangunn.me.uk/dasblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.duncangunn.me.uk/dasblog/PermaLink,guid,e5237e72-b63f-44eb-928a-b6e5ddf6c45a.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.duncangunn.me.uk/dasblog/CommentView,guid,e5237e72-b63f-44eb-928a-b6e5ddf6c45a.aspx</wfw:comment>
      <wfw:commentRss>http://www.duncangunn.me.uk/dasblog/SyndicationService.asmx/GetEntryCommentsRss?guid=e5237e72-b63f-44eb-928a-b6e5ddf6c45a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">As you can tell, this is going to be a
nice and easy topic.<br /><br />
Got the go-ahead to deploy Facebook Connect to the site I'm working on, everything
certified "Works on Dev" so go to push it to the UAT servers.<br /><br />
This environment is load-balanced and has an F5 firewall sitting in front of it, and
proceeded to fall over in spectacular fashion.<br /><br />
The bizarre thing is that FireFox and Chrome are happy, while IE (surprise) throws
back the mystic error "Redirect Required" with content of 
<br /><br /><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'lucida grande',tahoma,verdana,arial,sans-serif; font-size: 11px; line-height: 15px; text-align: left;">&lt;meta
http-equiv="refresh" content="0; url=[MY URL]&gt;<br /><br /></span></span>Hmmm.<br /><br /><br /><h3>Facebook xd_receive and Cross Domain Communication
</h3><br />
Facebook Cross Domain comms is based on using IFrames to transport data, see <a href="http://msdn.microsoft.com/en-us/library/bb735305.aspx">http://msdn.microsoft.com/en-us/library/bb735305.aspx</a> for
a full explanation.<br /><br /><br />
On investigation of the Big IP logs, we could see the raw request was flagging a Cross-Domain
Scripting attack for the IE request (but not for the FF request).  
<br /><br />
My gut-feel is that this could be as a result of an IE security patch which puts a
whole lot of extra stuff in the Form variables which then confuses Big IP, but this
is a <b>complete and utter guess</b>.<br /><br />
The solution?  Patch a hole in the Firewall.  So not really a solution I'm
afraid.<br /><p></p><img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=e5237e72-b63f-44eb-928a-b6e5ddf6c45a" /></body>
      <title>Facebook Cross Domain Communication and F5 Firewall/Load Balancer</title>
      <guid isPermaLink="false">http://www.duncangunn.me.uk/dasblog/PermaLink,guid,e5237e72-b63f-44eb-928a-b6e5ddf6c45a.aspx</guid>
      <link>http://www.duncangunn.me.uk/dasblog/2010/05/26/FacebookCrossDomainCommunicationAndF5FirewallLoadBalancer.aspx</link>
      <pubDate>Wed, 26 May 2010 14:16:59 GMT</pubDate>
      <description>As you can tell, this is going to be a nice and easy topic.&lt;br&gt;
&lt;br&gt;
Got the go-ahead to deploy Facebook Connect to the site I'm working on, everything
certified "Works on Dev" so go to push it to the UAT servers.&lt;br&gt;
&lt;br&gt;
This environment is load-balanced and has an F5 firewall sitting in front of it, and
proceeded to fall over in spectacular fashion.&lt;br&gt;
&lt;br&gt;
The bizarre thing is that FireFox and Chrome are happy, while IE (surprise) throws
back the mystic error "Redirect Required" with content of 
&lt;br&gt;
&lt;br&gt;
&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'lucida grande',tahoma,verdana,arial,sans-serif; font-size: 11px; line-height: 15px; text-align: left;"&gt;&amp;lt;meta
http-equiv="refresh" content="0; url=[MY URL]&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;Hmmm.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h3&gt;Facebook xd_receive and Cross Domain Communication
&lt;/h3&gt;
&lt;br&gt;
Facebook Cross Domain comms is based on using IFrames to transport data, see &lt;a href="http://msdn.microsoft.com/en-us/library/bb735305.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb735305.aspx&lt;/a&gt; for
a full explanation.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
On investigation of the Big IP logs, we could see the raw request was flagging a Cross-Domain
Scripting attack for the IE request (but not for the FF request).&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
My gut-feel is that this could be as a result of an IE security patch which puts a
whole lot of extra stuff in the Form variables which then confuses Big IP, but this
is a &lt;b&gt;complete and utter guess&lt;/b&gt;.&lt;br&gt;
&lt;br&gt;
The solution?&amp;nbsp; Patch a hole in the Firewall.&amp;nbsp; So not really a solution I'm
afraid.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=e5237e72-b63f-44eb-928a-b6e5ddf6c45a" /&gt;</description>
      <comments>http://www.duncangunn.me.uk/dasblog/CommentView,guid,e5237e72-b63f-44eb-928a-b6e5ddf6c45a.aspx</comments>
      <category>Facebook</category>
      <category>Web Design</category>
    </item>
    <item>
      <trackback:ping>http://www.duncangunn.me.uk/dasblog/Trackback.aspx?guid=9c72d486-9a78-4675-b388-db59605ed09f</trackback:ping>
      <pingback:server>http://www.duncangunn.me.uk/dasblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.duncangunn.me.uk/dasblog/PermaLink,guid,9c72d486-9a78-4675-b388-db59605ed09f.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.duncangunn.me.uk/dasblog/CommentView,guid,9c72d486-9a78-4675-b388-db59605ed09f.aspx</wfw:comment>
      <wfw:commentRss>http://www.duncangunn.me.uk/dasblog/SyndicationService.asmx/GetEntryCommentsRss?guid=9c72d486-9a78-4675-b388-db59605ed09f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Playing around with AJAX and returning
data via JSON, I was always getting the error handler called in my AJAX call, despite
getting data back from the server.<br /><br />
I noticed that my server code, which I'd quickly stolen from another blog, returned
the JSON like this:<br /><br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"> oBuilder.Append(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"{"</span>);
oBuilder.AppendFormat(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"'{0}'
: {1}"</span>, <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"Minute"</span>, <span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"500"</span>);
oBuilder.Append(<span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;">"}"</span>);</span></pre><br />
so this would return<br />
 { 'minute' : 500 }<br /><br />
All good right?<br /><br />
Wrong.  Jquery 1.4 now will parse valid JSON only, and that means the single
quotes inside that JSON packet HAVE to be double quotes.<br /><br /><br /><br /><br /><br /><p></p><img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=9c72d486-9a78-4675-b388-db59605ed09f" /></body>
      <title>Invalid JSON - has to be double quotes</title>
      <guid isPermaLink="false">http://www.duncangunn.me.uk/dasblog/PermaLink,guid,9c72d486-9a78-4675-b388-db59605ed09f.aspx</guid>
      <link>http://www.duncangunn.me.uk/dasblog/2010/05/15/InvalidJSONHasToBeDoubleQuotes.aspx</link>
      <pubDate>Sat, 15 May 2010 10:04:32 GMT</pubDate>
      <description>Playing around with AJAX and returning data via JSON, I was always getting the error handler called in my AJAX call, despite getting data back from the server.&lt;br&gt;
&lt;br&gt;
I noticed that my server code, which I'd quickly stolen from another blog, returned
the JSON like this:&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt; oBuilder.Append(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"{"&lt;/span&gt;);
oBuilder.AppendFormat(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"'{0}'
: {1}"&lt;/span&gt;, &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"Minute"&lt;/span&gt;, &lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"500"&lt;/span&gt;);
oBuilder.Append(&lt;span style="color: rgb(102, 102, 102); background-color: rgb(228, 228, 228); font-family: Courier New; font-size: 11px;"&gt;"}"&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;br&gt;
so this would return&lt;br&gt;
&amp;nbsp;{ 'minute' : 500 }&lt;br&gt;
&lt;br&gt;
All good right?&lt;br&gt;
&lt;br&gt;
Wrong.&amp;nbsp; Jquery 1.4 now will parse valid JSON only, and that means the single
quotes inside that JSON packet HAVE to be double quotes.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=9c72d486-9a78-4675-b388-db59605ed09f" /&gt;</description>
      <comments>http://www.duncangunn.me.uk/dasblog/CommentView,guid,9c72d486-9a78-4675-b388-db59605ed09f.aspx</comments>
      <category>Javascript</category>
    </item>
    <item>
      <trackback:ping>http://www.duncangunn.me.uk/dasblog/Trackback.aspx?guid=05a3ed9d-f4ec-48d6-ae56-5275404dac96</trackback:ping>
      <pingback:server>http://www.duncangunn.me.uk/dasblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.duncangunn.me.uk/dasblog/PermaLink,guid,05a3ed9d-f4ec-48d6-ae56-5275404dac96.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.duncangunn.me.uk/dasblog/CommentView,guid,05a3ed9d-f4ec-48d6-ae56-5275404dac96.aspx</wfw:comment>
      <wfw:commentRss>http://www.duncangunn.me.uk/dasblog/SyndicationService.asmx/GetEntryCommentsRss?guid=05a3ed9d-f4ec-48d6-ae56-5275404dac96</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">If your site is available under both http
and https (i.e. if you put the certificate at the ROOT level of the site for whatever
reason) then be aware that Google will index this site under both protocols. 
From what I can see a fair amount of SEOs think that this will impose the duplicate
content penalty, although personally I can't see it affecting your ranking too much.<br /><br /><br />
The main thing you have to worry about is what happens when the user requests your
page under https.  In IE, by default they may receive the "secure and non-secure
content" warning, if there are any resources being requested explicitly over http. 
The other is that the site will run slower, and resources won't be cached.<br /><br />
There are a number of solutions to this problem, and if you don't want to move your
site certificate about then you can always use an ISAPI filter to intercept the requests
and redirect them at IIS level.<br /><br />
We found IIRF, available at <a href="http://iirf.codeplex.com/">http://iirf.codeplex.com/</a> which
worked straight out the box.  Note:  Although it claims to have an install
you will have to do this manually, but it's really straightforward and the help is
comprehensive.<br /><br />
In order to do the redirect above, put the following into your .ini file (which you
place in the root of the site) :<br /><br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;">#
Iirf.ini # # ini file <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;">for</span> IIRF
# RewriteLogLevel 1 RewriteLog F:\Inetpub\wwwroot\website\IIRF RewriteEngine ON StatusInquiry
ON IterationLimit 5 RedirectRule ^/secure/(.*) https:<span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">//mysite.co.uk/secure/$1
[R=301]</span> RewriteCond <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">%</span>{HTTPS}
on RedirectRule ^<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;">/</span>(.*)$
http:<span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;">//mysite.co.uk/$1
[R=301]</span></span></pre><br /><br /><br />
Check the help file for instructions on this language.<br /><br /><br /><p></p><img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=05a3ed9d-f4ec-48d6-ae56-5275404dac96" /></body>
      <title>Redirecting https to http automatically</title>
      <guid isPermaLink="false">http://www.duncangunn.me.uk/dasblog/PermaLink,guid,05a3ed9d-f4ec-48d6-ae56-5275404dac96.aspx</guid>
      <link>http://www.duncangunn.me.uk/dasblog/2010/05/11/RedirectingHttpsToHttpAutomatically.aspx</link>
      <pubDate>Tue, 11 May 2010 08:36:49 GMT</pubDate>
      <description>If your site is available under both http and https (i.e. if you put the certificate at the ROOT level of the site for whatever reason) then be aware that Google will index this site under both protocols.&amp;nbsp; From what I can see a fair amount of SEOs think that this will impose the duplicate content penalty, although personally I can't see it affecting your ranking too much.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
The main thing you have to worry about is what happens when the user requests your
page under https.&amp;nbsp; In IE, by default they may receive the "secure and non-secure
content" warning, if there are any resources being requested explicitly over http.&amp;nbsp;
The other is that the site will run slower, and resources won't be cached.&lt;br&gt;
&lt;br&gt;
There are a number of solutions to this problem, and if you don't want to move your
site certificate about then you can always use an ISAPI filter to intercept the requests
and redirect them at IIS level.&lt;br&gt;
&lt;br&gt;
We found IIRF, available at &lt;a href="http://iirf.codeplex.com/"&gt;http://iirf.codeplex.com/&lt;/a&gt; which
worked straight out the box.&amp;nbsp; Note:&amp;nbsp; Although it claims to have an install
you will have to do this manually, but it's really straightforward and the help is
comprehensive.&lt;br&gt;
&lt;br&gt;
In order to do the redirect above, put the following into your .ini file (which you
place in the root of the site) :&lt;br&gt;
&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;#
Iirf.ini # # ini file &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;for&lt;/span&gt; IIRF
# RewriteLogLevel 1 RewriteLog F:\Inetpub\wwwroot\website\IIRF RewriteEngine ON StatusInquiry
ON IterationLimit 5 RedirectRule ^/secure/(.*) https:&lt;span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;//mysite.co.uk/secure/$1
[R=301]&lt;/span&gt; RewriteCond &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;%&lt;/span&gt;{HTTPS}
on RedirectRule ^&lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;/&lt;/span&gt;(.*)$
http:&lt;span style="color: Green; background-color: Transparent; font-family: Courier New; font-size: 11px;"&gt;//mysite.co.uk/$1
[R=301]&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Check the help file for instructions on this language.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=05a3ed9d-f4ec-48d6-ae56-5275404dac96" /&gt;</description>
      <comments>http://www.duncangunn.me.uk/dasblog/CommentView,guid,05a3ed9d-f4ec-48d6-ae56-5275404dac96.aspx</comments>
      <category>ASP.NET</category>
    </item>
    <item>
      <trackback:ping>http://www.duncangunn.me.uk/dasblog/Trackback.aspx?guid=5d0b3a41-b1c8-47bb-8ab0-6e11f4c39ebb</trackback:ping>
      <pingback:server>http://www.duncangunn.me.uk/dasblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.duncangunn.me.uk/dasblog/PermaLink,guid,5d0b3a41-b1c8-47bb-8ab0-6e11f4c39ebb.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.duncangunn.me.uk/dasblog/CommentView,guid,5d0b3a41-b1c8-47bb-8ab0-6e11f4c39ebb.aspx</wfw:comment>
      <wfw:commentRss>http://www.duncangunn.me.uk/dasblog/SyndicationService.asmx/GetEntryCommentsRss?guid=5d0b3a41-b1c8-47bb-8ab0-6e11f4c39ebb</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">So you want to write a Facebook app? 
The good news is that once you get going, it's actually really straightforward. 
The bad news is that it's an uphill struggle to get going in the first place.<br /><br />
Unfortunately for the ASP.NET developer, there is no official wrapper for the Facebook
API.  There are a couple available, but as you can see by the reviews they are
far from perfect.  
<br /><br />
However, we can still create a Facebook application without needing the API. 
Okay, we won't be able to do a huge amount with it, but this is a starter tutorial
and we'll get to the more advanced topics later.<br /><br />
Note:  I'm pushed for time at the moment, so will add some screenshots later,
which should help to explain things a bit better.  Picture paints a thousand
words and all that.<br /><br /><h2>The Basics - Facebook Connect and Facebook Applications
</h2><br />
There are two completely different concepts when dealing with Facebook applications.  
<br /><br />
Facebook Connect - integrate a user's Facebook profile information (name, likes/dislikes,
wall, dodgy profile pictures) into your existing site.  A good example of this
is http://welcometofc.com<br /><br />
Facebook Canvas Application - this is an application that lives within Facebook -
however IT IS NOT HOSTED WITHIN FACEBOOK.  You get to your app via http://apps.facebook.com/[MYAPP]
- no surprises that this has to be unique.<br /><br />
Facebook needs to be able to access your site, so there can be no localhost development
I'm afraid.  You need to put the page on a publicly accessible server.<br /><br /><h2>Create your Facebook App
</h2>
Creating both Connect and Canvas apps involve the same process.  In fact you
can have BOTH a Connect AND Canvas app configured within the same application configuration.<br /><br />
To do this, you'll need to add the Developer app, at <a href="http://www.facebook.com/developers/">http://www.facebook.com/developers/</a><br /><br />
Click Set up a New Application.<br /><br />
You should now see the Application Settings screen.  The main configuration is
within the Edit Settings option.  
<br /><br />
Basic - Contains your API Key.  YOU NEED THIS.  You add this to your web
site to confirm that your web site can talk to this app.  Keep it secret. 
Keep it safe.  Not to be confused with your Application Secret.<br />
Authentication, Profiles, Widgets, Advanced, Migrations - Not essential.<br />
Canvas - This is where you set up your Canvas URL - if you are creating a Canvas app
only - and the callback URL, which is the page that Facebook calls which is by default
hosted within apps.facebook.com/[MYAPP].  More on this later.<br />
Connect - Configure how your web site connects with Facebook.  You only need
this if you are doing Facebook Connect, it is not required if you have a stand-alone
Facebook Canvas application.<br /><br /><h2>Facebook Connect
</h2>
To enable your site to connect to Facebook, you need to do 3 things:<br /><br />
 1 - Enable Cross Domain Posting - you do this by including a couple of javascript
files that you get from Facebook.  More detail to follow.<br />
 2 - Initialise your Facebook application in client script<br />
 3 - Import the FBML namespace.<br /><br />
That's about it.  Of course, you'll want to *use* some FBML, but more on this
later.<br /><br />
I'm taking it that by now you have configured your Facebook Connect application in
Facebook.<br /><br />
Replace the &lt;html&gt; tag in your .aspx page with the following:<br /><br />
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml"&gt; 
<br /><br />
This imports the namespace which contains the FBML, so that your browser doesn't fall
over before these have been parsed by the facebook javascript.<br /><br />
Add the following javascript includes to the bottom of your page, just above the closing
&lt;body&gt; tag:<br /><br />
&lt;script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"
type="text/javascript"&gt;&lt;/script&gt;<br />
FB.init("[YOUR API KEY]","/assets/xd_receiver.htm",{"ifUserConnected" : showLoggedInState,
"ifUserNotConnected":showLoggedOutState});<br /><br />
/assets/xd_receiver.htm is a relative link from where this page runs to the Cross-Domain
file you get from facebook.  Get it from here - <a href="http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel">http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel</a><br /><br />
This bypasses the Single Origin Policy and allows Facebook to interact with your page
and vice versa.<br /><br /><br />
Add the following to your .aspx page:<br /><br />
                        
&lt;div id="loggedOut" style="display:none"&gt;<br />
                     
&lt;fb:login-button length="long" size="large" onlogin="showLoggedInState();return
false;"&gt;Invite Friends with Facebook&lt;/fb:login-button&gt;<br />
                 
&lt;/div&gt;<br />
                 
&lt;div id="loggedIn" style="display:none;"&gt;<br />
                     
&lt;div id="user-box"&gt;<br />
                         
&lt;span&gt;<br />
                             
&lt;div id="profile-pic"&gt;<br />
                                 
&lt;fb:profile-pic uid='loggedinuser' facebook-logo='true'&gt;&lt;/fb:profile-pic&gt;<br />
                             
&lt;/div&gt;<br />
                             
&lt;div id="welcome-text"&gt;<br />
                             
Welcome, &lt;fb:name uid='loggedinuser' useyou='false'&gt;&lt;/fb:name&gt;.&lt;br
/&gt; 
<br />
                             
Invite friends with &lt;a id="lnkShare7" href="#share7" name="modal" onclick="return
false;"&gt;Facebook Connect&lt;/a&gt;.<br />
                             
&lt;/div&gt;<br />
                         
&lt;/span&gt;<br />
                     
&lt;/div&gt;<br />
                 
&lt;/div&gt;<br /><br />
           &lt;!-- facebook multi
friend selector overlay starts --&gt;<br /><br />
          &lt;div id="facebook-wrapper"&gt;<br />
              &lt;div
id="share7" class="window windowfixed"&gt;<br />
                 
&lt;p style="margin-left:10px;"&gt;<br />
                     
Invite a friend to use this application...<br />
                 
&lt;/p&gt;<br />
                 
&lt;p id="multi-friend-selector-container"&gt;<br />
                     
&lt;fb:serverfbml&gt;<br />
                     
&lt;script type="text/fbml"&gt;<br />
                     
&lt;fb:fbml&gt;<br />
                         
&lt;fb:request-form method="POST" action="&lt;%= FacebookFormAction %&gt;"<br />
                                     
invite="true" type="&lt;%= FacebookApplicationName %&gt;"<br />
                                     
content="You have been invited to the [MY APPLICATION] application. &lt;%= ApplicationsFbml
%&gt; "&gt; 
<br />
                                     
&lt;fb:multi-friend-selector bypass="cancel"<br />
                                         
showborder="false" rows="3" cols="4" max="35" actiontext="Invite your friends to use
this application." /&gt; 
<br />
                         
<br />
                     
&lt;/fb:request-form&gt;<br />
                     
&lt;/fb:fbml&gt;<br />
                     
&lt;/script&gt;<br />
                     
&lt;/fb:serverfbml&gt;<br />
                 
&lt;/p&gt;<br />
              &lt;/div&gt;<br />
          &lt;/div&gt;<br /><br />
where FacebookFormAction is the URL of the current page, and FacebookApplicationName
is the name that you want to appear in the Facebook Connect dialog.<br /><br />
What this will do is display the Connect with Facebook button if the user is logged
out.<br /><br />
When the user is logged in it will display the user's FB name and profile picture,
and allow the user to share this application with their friends on Facebook.<br /><br />
Notice the FBML markup; you can find a complete list at <a href="http://wiki.developers.facebook.com/index.php/FBML">http://wiki.developers.facebook.com/index.php/FBML</a><br /><br /><h2>Facebook Canvas 
</h2>
That was Facebook Connect.  If you want your site to be hosted WITHIN Facebook,
then you need to create a Facebook Canvas application.<br /><br />
There are two types: FBML and IFrame.  From what I can tell, IFrame is now the
recommended choice, as it gives you more freedom, and you should be able to use libraries
such as jQuery without much trouble.  See 
<br /><a href="http://www.ccheever.com/blog/?p=10">http://www.ccheever.com/blog/?p=10</a><br /><br />
Go to the Canvas tab of your application settings in Facebook.<br /><br />
Canvas Page URL - this is a unique URL that identifies your application of FB.<br /><br />
Canvas Callback URL - this is the page that is hoovered up by Facebook and then displayed
within the IFrame.<br /><br />
Post-Authorize Redirect URL - you can leave this blank; it is optional.<br /><br />
Don't worry about the other settings for now.<br /><br />
If you create the following .aspx page at your Canvas Callback URL:<br /><br />
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;<br /><br />
&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&gt;<br /><br />
&lt;script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"
type="text/javascript"&gt;&lt;/script&gt;<br /><br />
&lt;body class="bg-white"&gt;<br /><br />
[Your website content here]<br /><br />
    &lt;script type="text/javascript"&gt;<br />
    FB_RequireFeatures(["XFBML"], function() {<br />
        FB.Facebook.init("[YOUR APP KEY]", "channel/xd_receiver.htm");<br />
    });<br />
&lt;/script&gt;<br /><br />
&lt;/body&gt;<br /><br />
&lt;/html&gt;<br /><br />
You can also use FBML in this page, to pull through profile specific information.<br /><br /><br />
And that's about it.  These are of course only the basics, but you should now
be able to create your own applications within Facebook, or integrate Facebook into
your own site to provide an enhanced user experience.<br /><br />
As you may have noticed, I haven't mentioned the .NET Facebook API wrappers - we didn't
need them as we didn't do a whole lot of Facebook integration.  These wrappers
are notoriously unreliable, but take a look at <a href="http://facebooktoolkit.codeplex.com/">http://facebooktoolkit.codeplex.com/</a> as
this seems to be well maintained.<br /><br /><br /><br /><p></p><img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=5d0b3a41-b1c8-47bb-8ab0-6e11f4c39ebb" /></body>
      <title>ASP.NET Facebook tutorial - Beginner Essentials</title>
      <guid isPermaLink="false">http://www.duncangunn.me.uk/dasblog/PermaLink,guid,5d0b3a41-b1c8-47bb-8ab0-6e11f4c39ebb.aspx</guid>
      <link>http://www.duncangunn.me.uk/dasblog/2010/04/14/ASPNETFacebookTutorialBeginnerEssentials.aspx</link>
      <pubDate>Wed, 14 Apr 2010 14:35:21 GMT</pubDate>
      <description>So you want to write a Facebook app?&amp;nbsp; The good news is that once you get going, it's actually really straightforward.&amp;nbsp; The bad news is that it's an uphill struggle to get going in the first place.&lt;br&gt;
&lt;br&gt;
Unfortunately for the ASP.NET developer, there is no official wrapper for the Facebook
API.&amp;nbsp; There are a couple available, but as you can see by the reviews they are
far from perfect.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
However, we can still create a Facebook application without needing the API.&amp;nbsp;
Okay, we won't be able to do a huge amount with it, but this is a starter tutorial
and we'll get to the more advanced topics later.&lt;br&gt;
&lt;br&gt;
Note:&amp;nbsp; I'm pushed for time at the moment, so will add some screenshots later,
which should help to explain things a bit better.&amp;nbsp; Picture paints a thousand
words and all that.&lt;br&gt;
&lt;br&gt;
&lt;h2&gt;The Basics - Facebook Connect and Facebook Applications
&lt;/h2&gt;
&lt;br&gt;
There are two completely different concepts when dealing with Facebook applications.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
Facebook Connect - integrate a user's Facebook profile information (name, likes/dislikes,
wall, dodgy profile pictures) into your existing site.&amp;nbsp; A good example of this
is http://welcometofc.com&lt;br&gt;
&lt;br&gt;
Facebook Canvas Application - this is an application that lives within Facebook -
however IT IS NOT HOSTED WITHIN FACEBOOK.&amp;nbsp; You get to your app via http://apps.facebook.com/[MYAPP]
- no surprises that this has to be unique.&lt;br&gt;
&lt;br&gt;
Facebook needs to be able to access your site, so there can be no localhost development
I'm afraid.&amp;nbsp; You need to put the page on a publicly accessible server.&lt;br&gt;
&lt;br&gt;
&lt;h2&gt;Create your Facebook App
&lt;/h2&gt;
Creating both Connect and Canvas apps involve the same process.&amp;nbsp; In fact you
can have BOTH a Connect AND Canvas app configured within the same application configuration.&lt;br&gt;
&lt;br&gt;
To do this, you'll need to add the Developer app, at &lt;a href="http://www.facebook.com/developers/"&gt;http://www.facebook.com/developers/&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
Click Set up a New Application.&lt;br&gt;
&lt;br&gt;
You should now see the Application Settings screen.&amp;nbsp; The main configuration is
within the Edit Settings option.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
Basic - Contains your API Key.&amp;nbsp; YOU NEED THIS.&amp;nbsp; You add this to your web
site to confirm that your web site can talk to this app.&amp;nbsp; Keep it secret.&amp;nbsp;
Keep it safe.&amp;nbsp; Not to be confused with your Application Secret.&lt;br&gt;
Authentication, Profiles, Widgets, Advanced, Migrations - Not essential.&lt;br&gt;
Canvas - This is where you set up your Canvas URL - if you are creating a Canvas app
only - and the callback URL, which is the page that Facebook calls which is by default
hosted within apps.facebook.com/[MYAPP].&amp;nbsp; More on this later.&lt;br&gt;
Connect - Configure how your web site connects with Facebook.&amp;nbsp; You only need
this if you are doing Facebook Connect, it is not required if you have a stand-alone
Facebook Canvas application.&lt;br&gt;
&lt;br&gt;
&lt;h2&gt;Facebook Connect
&lt;/h2&gt;
To enable your site to connect to Facebook, you need to do 3 things:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;1 - Enable Cross Domain Posting - you do this by including a couple of javascript
files that you get from Facebook.&amp;nbsp; More detail to follow.&lt;br&gt;
&amp;nbsp;2 - Initialise your Facebook application in client script&lt;br&gt;
&amp;nbsp;3 - Import the FBML namespace.&lt;br&gt;
&lt;br&gt;
That's about it.&amp;nbsp; Of course, you'll want to *use* some FBML, but more on this
later.&lt;br&gt;
&lt;br&gt;
I'm taking it that by now you have configured your Facebook Connect application in
Facebook.&lt;br&gt;
&lt;br&gt;
Replace the &amp;lt;html&amp;gt; tag in your .aspx page with the following:&lt;br&gt;
&lt;br&gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml"&amp;gt; 
&lt;br&gt;
&lt;br&gt;
This imports the namespace which contains the FBML, so that your browser doesn't fall
over before these have been parsed by the facebook javascript.&lt;br&gt;
&lt;br&gt;
Add the following javascript includes to the bottom of your page, just above the closing
&amp;lt;body&amp;gt; tag:&lt;br&gt;
&lt;br&gt;
&amp;lt;script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"
type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;br&gt;
FB.init("[YOUR API KEY]","/assets/xd_receiver.htm",{"ifUserConnected" : showLoggedInState,
"ifUserNotConnected":showLoggedOutState});&lt;br&gt;
&lt;br&gt;
/assets/xd_receiver.htm is a relative link from where this page runs to the Cross-Domain
file you get from facebook.&amp;nbsp; Get it from here - &lt;a href="http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel"&gt;http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
This bypasses the Single Origin Policy and allows Facebook to interact with your page
and vice versa.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Add the following to your .aspx page:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;div id="loggedOut" style="display:none"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;fb:login-button length="long" size="large" onlogin="showLoggedInState();return
false;"&amp;gt;Invite Friends with Facebook&amp;lt;/fb:login-button&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/div&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;div id="loggedIn" style="display:none;"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;div id="user-box"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;span&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;div id="profile-pic"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;fb:profile-pic uid='loggedinuser' facebook-logo='true'&amp;gt;&amp;lt;/fb:profile-pic&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/div&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;div id="welcome-text"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Welcome, &amp;lt;fb:name uid='loggedinuser' useyou='false'&amp;gt;&amp;lt;/fb:name&amp;gt;.&amp;lt;br
/&amp;gt; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Invite friends with &amp;lt;a id="lnkShare7" href="#share7" name="modal" onclick="return
false;"&amp;gt;Facebook Connect&amp;lt;/a&amp;gt;.&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/div&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/span&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/div&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/div&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- facebook multi
friend selector overlay starts --&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id="facebook-wrapper"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div
id="share7" class="window windowfixed"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;p style="margin-left:10px;"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Invite a friend to use this application...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/p&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;p id="multi-friend-selector-container"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;fb:serverfbml&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;script type="text/fbml"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;fb:fbml&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;fb:request-form method="POST" action="&amp;lt;%= FacebookFormAction %&amp;gt;"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
invite="true" type="&amp;lt;%= FacebookApplicationName %&amp;gt;"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
content="You have been invited to the [MY APPLICATION] application. &amp;lt;%= ApplicationsFbml
%&amp;gt; "&amp;gt; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;fb:multi-friend-selector bypass="cancel"&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
showborder="false" rows="3" cols="4" max="35" actiontext="Invite your friends to use
this application." /&amp;gt; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/fb:request-form&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/fb:fbml&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/script&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/fb:serverfbml&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/p&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br&gt;
&lt;br&gt;
where FacebookFormAction is the URL of the current page, and FacebookApplicationName
is the name that you want to appear in the Facebook Connect dialog.&lt;br&gt;
&lt;br&gt;
What this will do is display the Connect with Facebook button if the user is logged
out.&lt;br&gt;
&lt;br&gt;
When the user is logged in it will display the user's FB name and profile picture,
and allow the user to share this application with their friends on Facebook.&lt;br&gt;
&lt;br&gt;
Notice the FBML markup; you can find a complete list at &lt;a href="http://wiki.developers.facebook.com/index.php/FBML"&gt;http://wiki.developers.facebook.com/index.php/FBML&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2&gt;Facebook Canvas 
&lt;/h2&gt;
That was Facebook Connect.&amp;nbsp; If you want your site to be hosted WITHIN Facebook,
then you need to create a Facebook Canvas application.&lt;br&gt;
&lt;br&gt;
There are two types: FBML and IFrame.&amp;nbsp; From what I can tell, IFrame is now the
recommended choice, as it gives you more freedom, and you should be able to use libraries
such as jQuery without much trouble.&amp;nbsp; See 
&lt;br&gt;
&lt;a href="http://www.ccheever.com/blog/?p=10"&gt;http://www.ccheever.com/blog/?p=10&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
Go to the Canvas tab of your application settings in Facebook.&lt;br&gt;
&lt;br&gt;
Canvas Page URL - this is a unique URL that identifies your application of FB.&lt;br&gt;
&lt;br&gt;
Canvas Callback URL - this is the page that is hoovered up by Facebook and then displayed
within the IFrame.&lt;br&gt;
&lt;br&gt;
Post-Authorize Redirect URL - you can leave this blank; it is optional.&lt;br&gt;
&lt;br&gt;
Don't worry about the other settings for now.&lt;br&gt;
&lt;br&gt;
If you create the following .aspx page at your Canvas Callback URL:&lt;br&gt;
&lt;br&gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;lt;script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"
type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;lt;body class="bg-white"&amp;gt;&lt;br&gt;
&lt;br&gt;
[Your website content here]&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script type="text/javascript"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; FB_RequireFeatures(["XFBML"], function() {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FB.Facebook.init("[YOUR APP KEY]", "channel/xd_receiver.htm");&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br&gt;
&amp;lt;/script&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;lt;/body&amp;gt;&lt;br&gt;
&lt;br&gt;
&amp;lt;/html&amp;gt;&lt;br&gt;
&lt;br&gt;
You can also use FBML in this page, to pull through profile specific information.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
And that's about it.&amp;nbsp; These are of course only the basics, but you should now
be able to create your own applications within Facebook, or integrate Facebook into
your own site to provide an enhanced user experience.&lt;br&gt;
&lt;br&gt;
As you may have noticed, I haven't mentioned the .NET Facebook API wrappers - we didn't
need them as we didn't do a whole lot of Facebook integration.&amp;nbsp; These wrappers
are notoriously unreliable, but take a look at &lt;a href="http://facebooktoolkit.codeplex.com/"&gt;http://facebooktoolkit.codeplex.com/&lt;/a&gt; as
this seems to be well maintained.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.duncangunn.me.uk/dasblog/aggbug.ashx?id=5d0b3a41-b1c8-47bb-8ab0-6e11f4c39ebb" /&gt;</description>
      <comments>http://www.duncangunn.me.uk/dasblog/CommentView,guid,5d0b3a41-b1c8-47bb-8ab0-6e11f4c39ebb.aspx</comments>
      <category>Facebook</category>
    </item>
  </channel>
</rss>