General

Flex: Security Error Accessing URL

While playing around with Flex and Web Services, I encounter the following error while trying to access my web service: Security Error Accessing URL.

One solution around this error is to add a crossdomain.xml file in your root directory:

<?xml version="1.0"?>
<cross-domain-policy>
    <allow-access-from domain="*"/>
</cross-domain-policy>

But in my case I simply changed my web service definition in Flex from:

<mx:WebService id="employeeService"
 wsdl="http://localhost:8080/EmployeeService/services/EmployeeService?wsdl"
 useProxy="false" showBusyCursor="true" fault="mx.controls.Alert.show(event.fault.faultString)">

To:

<mx:WebService id="employeeService"
 wsdl="http://127.0.0.1:8080/EmployeeService/services/EmployeeService?wsdl"
 useProxy="false" showBusyCursor="true" fault="mx.controls.Alert.show(event.fault.faultString)">

That got it working.

Downloading Adobe’s “Flex In A Week” Videos

Adobe, in it’s arguably self-serving pursuit to make Flex more popular offered an online training module called Flex In A Week. Admittedly, it’s quite good. I’ve been using it but watching it online just doesn’t work for me since I don’t have continuous Internet access.

I tried their suggestion for watching the videos online. Unfortunately, it means installing Adobe Media Player (which is yet another sucky media player) and adding the RSS feed http://sessions.adobe.com/FlexInAWeek/feed.xml to My Favorites. Problem is that AMP sucks and it can cache only a few videos at a time.

Fortunately, there is a better solution. Simply go to the RSS feed in Firefox (click the link or copy-and-paste it into the address box) and download the media files from the links on the resulting page. You can now watch it with your favorite media player such as VLC. That’s it!

Web Services with Apache Axis2

Since my new project would require me to use web services, I decided to get my hands at it.

Bottom-Up Approach To Writing Web Services

The logical place to start would be take your plain old Java classes (POJOs, I love them) and expose their methods to to the web. Since you already have the implementation, this is called a bottom-up approach. And with Eclipse Ganymede and Apache Axis2 1.4.1, it was all a breeze. Just create a dynamic web project, create your POJO(s), create Web Service, choose bottom-up. The Axis2 plug-in  then creates a web service complete with WSDL (web service definition language) file and all. Here are the details.

With some groping and googling, I was able to successfully connect my test Adobe Flex application to my web service with no problems.

Top-Down Approach To Writing Web Services

The next step was to do it the other way around, given a WSDL file which describes your web service in great detail, and implement your service. Since you start with just the web service description, it’s called a top-down approach. It was also a breeze. Create a dynamic web project, create a web service, choose top-down, give the location of the WSDL file (I used the WSDL generated earlier), and generate all the necessary classes along with TODO tags where you’re supposed to add your code. Put it in your implementation, compile, deploy, and you’re good to go. Here are the details.

With just a small adjustment in the WSDL URI, I was again able to successfully connect my test Adobe Flex application to my web service with no problems.

All this with no need to mess around with HTTP (it’s just the transport), SOAP (it’s just the protocol), or WSDL (it is generated). Java tooling sure makes web services easy.

Free WiFi: WiGO

WiFi is good. Free WiFi is even better. But it’s quite scarce. One of the more prevalent free WiFi hotspots are the ones from WiGO. It’s advertisement driven so once you connect, you’re taken to a captive portal where you are shown some ads. So far so good. I mean, they have to make money after all.

But, unfortunately, it doesn’t stop there. It also requires you to be running the WiGOBar,  a pesky ad-carrying floating window that blocks quite a large part of the screen like a fungus infection that just won’t go away.

There’s a solution for the Mac but what about for us Windoze users? Don’t lose hope. There is the Hide Windows Utility. Download, extract, and run (the .bat file),  and presto! No more WiGOBar.

I now heart WiGO, too :D

Bumper Scraper

The less-than-a-year old paint job on my bumper got ruined again. Michelle and I were driving along Ortigas when some stupid family driver (why do stupid people get to drive?)  swerved from my LEFT towards Xavier St. on the right. He almost made it but his rear end clipped my front bumper scraping some paint off and exposing the black plastic. And when he got down he even had the balls to say it was my fault!

There’s not sense talking to a useless moron so I talked to the owner who was inside. She readily admitted it’s her driver’s fault and she offered that the insurance take care of it (fat chance!). She was with her kids. Apparently, she was bringing them to school. Here’s their stupid driver endangering not just other motorists but also the owner and her kids. Too bad I wasn’t able to advise her to fire the driver. But I sure hope she does.