Friday, December 14. 2007
Calling protected SOAP from Mozilla
Recently I had to write a Firefox extension for a company which provides text messaging web services. The Web-Service is an RPC-Style SOAP one which is written by "Nima Shayafar".
When I got this offer, I didn't think that this one would cause any troubles, as Mozilla has a SOAP implementation landed in it's platform since years (And if you ask me, I'll tell you no one, never touched it again to improve it -even a little bit).
This Web-Service is protected by basic HTTP Authentication, nothing tricky so far, but to my surprise Mozilla's SOAP implementation doesn't provide any mean to do authentication against an endpoint, and nah, not even a basic one.
Well I thought as this (writing Firefox extensions for protected SOAP Web Services) is not that uncommon situation I may get a good amount of information by Googling, but nothing catchy comes there in results except a thread at netscape.public.mozilla.xml where I found two solutions, one was submitting username/password pair together with URL, and the other one was to make an XHR connection to the endpoint (XMLHttpRequest implementation let you provide login/password for a basic authentication), and as Mozilla remembers that for the browser session, you're there.
The first solution is hmm ... horrible! And the second one, I didn't manage to get it to work.
So I started wondering in other possible ways to overcome this, and guess what? It was damn easy!
You just need to set Authorization header in HTTP request (which is base64 encoded of login:password), but just for that particular endpoint, and how?
You need to use nsIHttpChannel in conjugation with nsIObserverService, register it right before invoking the SOAPCall, and (don't forget to!) unregister it when the call is done, that's it.
Well, it took me an hour to come up with this, and I'm writing it in hopes save someone else "one hour".
Saturday, November 24. 2007
Ohloh API
It's a while since I started using Ohloh API for the facebook app I mentioned in earlier post.
It's a REST-based one with well structured URIs, the only thing that could be implemented better (from the definitions perspective), is the way Ohloh let you know what happened to your request, the response status.
It's now represented in entity-body (<response><status>....</status>...</response>), but IMO using ``HTTP Response Code'' would be a better choice when you're talking about a RESTful web service, data transmitting over HTTP without an additional messaging layer.
Friday, October 26. 2007
Rock Your Hackers - facebook way
Rock Your Hackers allows you to praise, promote, and in no uncertain terms shout for joy about your favorite free and open source software projects (FOSS) and then share your "Hack List" with your friends (and perhaps fellow hackers)! Wave the banners of your favorite FOSS projects for all your "faceworld" to see.
Here’s how you get started:
1) Add the application
2) Browse for cool FOSS projects (PHP, PEAR, Jaws ...)
3) Add them to your favorites
4) Share your favorites with your friends!
Friday, October 19. 2007
People in the Browser
Flock, the so called "Social Web Browser" has just released the third RC of it's upcoming 1.0 (codenamed falcon), though it's the first public release but is still in private beta.
First of all I've to admit, and let you know that I'm nothing near a review guy, so take this advice, and stop reading here if you're going to use this post as a motivate to start Flocking!
Well, I'm a long-time-but-not-frequent Flock user, actually Flock is the one (browser) which I put behind the proxy to make web surfing a bit more bearable (there're lots of websites which are not accessible here in Iran because of some governments policies, and yes, I won't write that damn word!), at the first I didn't use it's unique features, just simply as a web browser, as a polished Firefox maybe.
But after a while I told myself let's see how Flickr works from within the Flock, and it was great! But doing so for the rest of available integrations didn't go that smoothly, I never managed to make it's Blogging feature to work with my s9y, neither the YouTube experience was great (actually it couldn't be even if wanted to, 'cause I was behind proxy, using a 128Kbps capped connection).
But today, right after receiving an email from Flock guys indicating that the 1.0 beta is ready, I went and downloaded it, and as far as I can tell you, and experienced so far, it's awesome, it's now truly "People in the Browser", if you want to see them (People), simply launch the "People" sidebar, you'll like it.
The catchy feature was facebook integration, the twitter experience was smooth and the Flickr one has just got better.
Actually Flock is where the other browsers are trying to reach using extensions/add-ons. Flock is doing great around it's centric goal, the People, their interactions, media-sharing, communications and the rest, I think if there's a popular'n'cool web-service somewhere, there would be a Flock guy trying to land it into the Flock.
As you may already heard, Mozilla guys has launched a new project called WebRunner, a XULRunner based browser, based on a concept called Site Specific Browsers (SSB). What Flock is doing is not completely SSB (at least when you compare it with the definition over there at Mozilla wiki), but the point is something else.
All of us had experienced a revolution (an evolution to be precise) in web applications in recent months, all those cool and fancy graphics, big bold fonts, nice effects, to-be-desktopish efforts and the rest, but it was just on the web applications side, and nothing on their hosts (aka Web Browsers).
Actually the web browsers was ruining all the fun (e.g., with reaching 99% CPU usage and crashing) because simply they weren't ready.
But now seems web browsers has realized that they are steps behind their guests, they are trying to adopt their selves, and bringing us an even better web-surfing experience.
Monday, June 4. 2007
Wearing the Inside Out(?)
I had always an excuse for not playing with Emacs, and it was that I don't have 24 fingers in my hands, and even if I had, I do promise that those crappy keyboards would break my wrist.
Last week, I bought a new keyboard, a Logitech Media Keyboard Elite.
I must admit that this is the best keyboard that I have ever had, though it has a bunch of useless so called "Multimedia keys".
Well, right after plugging it in and starting my box, I decided to ...
Yess, and finally I migrated from my beloved Vim to Emacs, I'm not sure if I'll stay with Emacs forever but at least I'm withe her for one month.
After writing a cheat sheet and stick it on my monitor pane and learning the basic skills, it was time to port my own Vim plugins to Emacs, If you're a frequent reader of my blog, you probably know I wrote an Audacious plugin for Vim couple of months ago which let me control the Audacious from right within Vim, but now (after a week hanging around in emacs) I really feel that it's missing, and the lack of that code-snippet became an excuse for me to start learning elisp!
There's no doubt that Lisp seems a hilarious programming language at the first glimpse, it will put you alone with Lots of Insignificant Silly Parentheses! But when you got familiar with its syntax and the flow, you'll like it, believe me.
And here you are, an Audacious .el [+].
Thursday, April 5. 2007
A Vimmiish client for Twitter
Welcome to the crazy world of you've-to-do-everything-from-right-within-your-vim!
I've written a simple Vim script for Twitter, you can update your status and track public or your friends time line with this script.
NOTE: It requires your Vim to be compiled with Python bindings (which is; in most distributions by default)
Tuesday, March 20. 2007
Happy New Year to all PHPers
Happy New Year to all of the PHPers who use the Persian Calendar (also known as Iranian Calendar or Jalāli Calendar).
Happy Norouz!
Saturday, March 17. 2007
PEAR XML_XUL at International PHP Magazine
Today I discovered that my first article finally hit the press (well, e-ones) and it's now available on newsstands (well, e-ones).
International PHP Magazine - March 2007 Issue TOC
Thursday, March 15. 2007
Jaws 0.7.0 - First stable released
We are very happy to announce the first stable version of Jaws 0.7.0 which should now work on production systems.
What is new in Jaws 0.7.0?
- Language support for: Romanian, Arabic, Catalá, Dansk, Deutsch, Japanese, Polski, Italiano, Simplified Chinese and of course English, Spanish and Persian! (And yeah, Jalali Calendar too)
- DB support for: MySQL(i), PostgreSQL, MSSQL and SQLite!
- All gadgets are completely ajaxed!
- Better antispam support: Captchas (simple and mathematician), Akismet and extra tools!
- Better urls and now we let you define your own route maps so you can access your posts via index.php/blog/show/123 or index.php/posts/123, you can define it!
Download
To download the package(s) just click here!.
Monday, March 12. 2007
How To Act Against Recently Made Movie "300" ?
Google bombing however is the very last thing we can do. Similar to what we done with the phrase "Arabian Gulf" if you remember.
Here's my link to that site:
300 The Movie
Here's my link to that site:
300 The Movie

