Hi everyone, i just wanted to grab your attention a little and show you how easy you can write WHOIS client application in Flex. To do that you can use or Adobe Flex Builder or FlashDevelop3, doesn't mater at all in this case.
First of all you need some "Visuals", so make your mx:Application to have some TitleWindow and put there one Text Input, one TextArea and one Button.
Idea behind is quite simple, you enter domain name in your text input, press on the button and in text area you having result returned from WHOIS server.
Below you can find the ActionScript code that actually rolls whole thing.
import flash.net.Socket;
import flash.events.*;
[Bindable]
private var urlWhoisServer:String = "whois.godaddy.com";
[Bindable]
private var portWhoisServer:int = 43;
private var whois:Socket = new Socket();
private function doWhois():void
{
if (txtUrl.text != "")
{
whois.addEventListener(Event.CONNECT,socket_onConnect);
whois.addEventListener(ProgressEvent.SOCKET_DATA, socket_onData);
whois.addEventListener(SecurityErrorEvent.SECURITY_ERROR, socket_onSecurityError);
whois.addEventListener(IOErrorEvent.IO_ERROR, socket_IoError);
whois.connect(urlWhoisServer,portWhoisServer);
}
else
{
txtResult.text = "Please provide the host name first, i.e. mydomain.com"
}
}
//Fires on connection or failure to connect
private function socket_onConnect(e:Event):void
{
if (whois.connected)
{
txtResult.text = "Connected ... Waiting ... \n\n"
var ba:ByteArray = new ByteArray();
ba.writeMultiByte(txtUrl.text + "\n", "UTF-8");
whois.writeBytes(ba);
whois.flush();
}
else
{
txtResult.text = "Unable to connect on " + urlWhoisServer;
}
}
//Fires when data available
private function socket_onData(e:Event):void
{
txtResult.text = "";
var n:int = whois.bytesAvailable;
// Loop through each available byte returned from the socket connection.
while (--n >= 0)
{
// Read next available byte.
var b:int = whois.readUnsignedByte();
txtResult.text += String.fromCharCode(b);
}
whois.close();
}
//Security error fired when security policy implementation required
//(use crossdomain.xml)
private function socket_onSecurityError(e:Event):void
{
txtResult.text = "Security Error";
}
private function socket_IoError(e:Event):void
{
txtResult.text = "Socket IO Error. Can't continue."
}
thats it, quite simple, isn't it. a bit later i will show you few ways of creating server side helpers for your flex applications.
Friday, June 22, 2007
Writing simple WHOIS client in Flex
Thursday, June 14, 2007
Backbase Introduces Ajax 360, a Complete Ajax Solution for the Enterprise
On Monday, at the Gartner Application Architecture Development & Integration Summit 2007, Backbase, The Ajax Company, introduced Ajax 360, a complete Ajax solution for the Enterprise.
Adobe Integrated Runtime (AIR) Beta Now Available
Adobe Systems Incorporated today released the beta version of Adobe® Integrated Runtime , formerly code named Apollo. Adobe AIR is a cross-operating system application runtime that allows developers to use HTML/CSS, Ajax, Adobe Flash® and Adobe Flex to extend rich Internet applications to the desktop.
Updated ASP.NET AJAX Control Toolkit Release Now Available
The June 6, 2007 release of the AJAX Control Toolkit has a number of fixes identified as important by the community including designer support for Tabs and Web Services.
It also has Animation support for some extenders, event support across the Toolkit, a Script combiner for reducing Toolkit scripts' download time, Dynamic context support for controls using Web Services, fixes to make ASP.NET Validators work with Toolkit extenders, Accessibility improvements and much more.
Synthasite to Focus on Delivering a Web Based Software Platform for Web Publishing
Synthasite, an AJAX based Web Publishing Platform, recently spun out from the incuBeta group as a separate stand-alone company that will focus on delivering a world class web based software platform for web publishing, focusing specifically on Widgets & Mashups.
Monday, June 11, 2007
Call SOAP Web services with Ajax
Implement a Web browser-based SOAP Web services client using the Asynchronous JavaScript and XML (Ajax) design pattern.
This paper is the first of a short series that illustrates the implementation of a cross-platform, JavaScript-based SOAP Web services client based on the Asynchronous JavaScript and XML (Ajax) design pattern for Web applications.
Popularized through its use in a number of well-known Web application services like GMail, Google Maps, Flickr, and Odeo.com, Ajax provides Web developers with a way of expanding the value and function of their Web applications by using asynchronous XML messaging. The Web Services JavaScript Library introduced here expands on the fundamental mechanisms that power the Ajax pattern by introducing support for invoking SOAP-based Web services.
Monday, June 04, 2007
Strangeloop AppScaler for Microsoft ASP.NET and AJAX Selected As Best of Tech.Ed 2007 Awards Finalist
Strangeloop AppScaler for Microsoft ASP.NET and AJAX has been selected as a finalist for the Best of Tech.Ed 2007 Awards in the Web Development and Infrastructure category. The overall category winner will be determined at Tech.Ed 2007 in Orlando, FL.
AJAX Company Backbase Joins Industry Leaders in SD Times 100
Backbase, The AJAX Company and the leading provider of enterprise software for creating AJAX-based Rich Internet Applications (RIAs), announced that it was named to the 2006 SD Times 100. An annual award, the SD Times 100 honors companies and organizations demonstrating the greatest innovation and leadership in the software development industry for the previous year.