Sven Dens

deserialize me

Archive for February, 2008

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