Friday, May 28, 2010
Building your first REST service in ASP.NET
Friday, May 28, 2010 4:11:44 PM (GMT Standard Time, UTC+00:00) | Comments [2] | ASP.NET | wcf#
Thursday, May 27, 2010
Turns out this was a Facebook bug after all.

We switched the Firewall back to the way it was, without changing the code, and hey presto - all is well.

Not only that but the second step (email invites) was not displayed.

FB - All your base are belong to us.

Thursday, May 27, 2010 9:06:04 AM (GMT Standard Time, UTC+00:00) | Comments [0] | Facebook#
Wednesday, May 26, 2010
Right this way - http://codezest.com/archive/2008/09/06/fiddler-firefox-local-web-site-testing-easily-foxyproxy.aspx

Using Fiddler with Firefox for Local Web site Testing Easily with FoxyProxy

Technorati Tags: ,

 

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.

Here is how to set up FoxyProxy for Fiddler and FireFox:

1. If you have not already installed Fiddler or Firefox, install these first.

2. Download & install the FoxyProxy plug-in for FireFox.

3. Now you will need to get to the FoxyProxy options.  In FireFox, at the right-hand corner you should see FoxyProxy running:

    foxyproxy_step7

     Here it's just saying that FoxyProxy is not using any proxies at the moment.

     Now right click that bar and choose "Options".

 

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.

    foxyproxy_step1_web

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.

    So click the Patterns Tab then Add New Pattern button, then input the following:

 

    Pattern Name: localhost

    URL Pattern: *localhost*

    and then leave the default "Whitelist" and "Wildcards" options as is

    foxyproxy_step5_web

6. Now click on the Proxy Details tab and select Automatic Proxy Configuration.  Here is where we are going to browse to Fiddler's proxy config file.

    a) In Windows XP, Browse and select the fiddler proxy config file located at the path

        file:///c:/documents and settings/YOURNAMEHERE/my documents/Fiddler2/scripts/browserpac.js

    b) Enable only the Notification about proxy auto-configuration file loads

    foxyproxy_step3_web

7. Next, click on the General tab and fill in the following to define a name for this Proxy instance:

    Proxy Name: Fiddler

    Enabled: checked

    Animate icons when this proxy is in use (optional): checked

    Include this proxy: checked

    foxyproxy_step2_web

    You've just created a proxy instance for Fiddler inside FoxyProxy.

8. Finally click OK and go back to the "Global Settings" tab then just change the "Statusbar Activation" left-click option to "Cycles through

    modes"

    foxyproxy_step6_web

9. Now we are ready to actually use this proxy instance that we have defined in FoxyProxy.

    So in Firefox, look at the right-hand corner and click once on foxyproxy_step7 .  That's FoxyProxy running in FireFox. 

    Now click on it once.

    Notice it will change from being disabled to the pattern status step8a .

    Now we need to tell FoxyProxy which proxy instance (that we just defined in options) to start using.

    To do this, right-click the patterns box and choose the proxy instance you created.  So select "Use proxy Fiddler for all URLs":

    step8

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.

      Now we can use fiddler to capture any requests made from FireFox on any website with no problem.

      You should now be seeing results in Fiddler (example shown below) after you click around on your localhost site. 

      Here's how mine looks now that fiddler is capturing any clicks made on my ASP.NET localhost web site :

      step10b_web 

      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.


Wednesday, May 26, 2010 3:10:04 PM (GMT Standard Time, UTC+00:00) | Comments [0] | ASP.NET#
As you can tell, this is going to be a nice and easy topic.

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.

This environment is load-balanced and has an F5 firewall sitting in front of it, and proceeded to fall over in spectacular fashion.

The bizarre thing is that FireFox and Chrome are happy, while IE (surprise) throws back the mystic error "Redirect Required" with content of

<meta http-equiv="refresh" content="0; url=[MY URL]>

Hmmm.


Facebook xd_receive and Cross Domain Communication


Facebook Cross Domain comms is based on using IFrames to transport data, see http://msdn.microsoft.com/en-us/library/bb735305.aspx for a full explanation.


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). 

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 complete and utter guess.

The solution?  Patch a hole in the Firewall.  So not really a solution I'm afraid.

Wednesday, May 26, 2010 2:16:59 PM (GMT Standard Time, UTC+00:00) | Comments [0] | Facebook | Web Design#
Saturday, May 15, 2010
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.

I noticed that my server code, which I'd quickly stolen from another blog, returned the JSON like this:

            oBuilder.Append("{");
            oBuilder.AppendFormat("'{0}' : {1}", "Minute", "500");
            oBuilder.Append("}");

so this would return
 { 'minute' : 500 }

All good right?

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.





Saturday, May 15, 2010 10:04:32 AM (GMT Standard Time, UTC+00:00) | Comments [0] | Javascript#
Tuesday, May 11, 2010
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.


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.

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.

We found IIRF, available at http://iirf.codeplex.com/ 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.

In order to do the redirect above, put the following into your .ini file (which you place in the root of the site) :

# Iirf.ini
#
# ini file for IIRF
#

RewriteLogLevel 1
RewriteLog F:\Inetpub\wwwroot\website\IIRF
RewriteEngine ON
StatusInquiry ON
IterationLimit 5

RedirectRule ^/secure/(.*) https://mysite.co.uk/secure/$1 [R=301]
RewriteCond %{HTTPS} on
RedirectRule ^/(.*)$ http://mysite.co.uk/$1 [R=301]



Check the help file for instructions on this language.


Tuesday, May 11, 2010 8:36:49 AM (GMT Standard Time, UTC+00:00) | Comments [0] | ASP.NET#
Search
Archive
Links
Categories
Admin Login
Sign In
Blogroll