Sven Dens

deserialize me

Archive for the ‘Flash’ Category

SOAP headers in Flex and WS-Security

with 28 comments

UPDATE (06-16-2009): The problem with generating a correct nonce has been fixed!
It turned out to be a problem in the WSSEUsernameToken class in the com.adobe.crypto package in as3corelib.
A VERY big thank you goes to Tom from FlexibleFactory for pointing me to the solution and to Koen Weyn for fixing the bugs!

Dear readers,

I just spent 2 entire days trying to figure out how to consume a SOAP Webservice that requires a SOAP-header and WS-Security in Flex. Hopefully this post will help you out if you’re looking to do the same thing.

Download demo files here.

Let me start off by saying that the Import Web Service (WSDL) wizard in Flex 3 doesn’t work as it should!
The generated classes return invalid XML to the SOAP-request, and adding headers to your request is completely neglected.
But I did get it to work using the classical <mx:Webservice> tag and some hand-coding.

Here’s how to do it:

Read the rest of this entry »

Written by Sven Dens

February 21st, 2008 at 5:00 pm

Posted in Flash, Flex, Java

Email and cell phone validation in AS2 and AS3

with 6 comments

I just wrote 2 simple classes to validate email addresses and Belgian cell phone numbers in AS2 and AS3.
Might come in handy for you, they’re available for download here.

I included FLA’s for Flash8 and FlashCS3 for AS2 and AS3.
They show 2 TextInput components, one for an email address and one for a cell phone number.
The cell phone validation includes a “strip” function. Since people tend to enter their phone numbers in different ways, dots, blanks and slashes are removed from the input before validating the number.

Read the rest of this entry »

Written by Sven Dens

May 22nd, 2007 at 4:04 pm

Posted in ActionScript, Flash