I have a flex client connecting to a web service that needs an authentication token added as a header, named "Identity". An example of the expected message is:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Identity xmlns="ns">2188dcbe-0325-4c1e-9a77-19110e0ea99f</Identity>
<To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">https://localhost:8001/MyService</To>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">ns/MyService/MyOperation</Action>
</s:Header>
<s:Body>
...
</s:Body>
</s:Envelope>
How do I add this kind of header in flex? I've tried using both .addHeader() and .addSimpleHeader, but both of these seem to add sub-elements to the header element like:
<Identity xmlns="ns">
<Value>34234234-234-234-23-234324</Value>
</Identity>
I know this should be possible, since flex is doing this for the "To" and "Action" headers. The documentation for addHeader seems to suggest you can give it raw XML but I haven't been able to make it work.
Thanks in advance for any pointers!