Expand my Community achievements bar.

Custom Headers with Data Services?

Avatar

Level 1
I am trying to pass information via a custom header with
LiveCycle ES. I have the id passing from the client to the server
and I can pull it out and use it. However when I pass it back from
the server it isn't making it to the client. I see it in the debug
message but the actionscript on the client side is just returning
undefined.



Here is the first log entry



16:43:59,765 INFO [STDOUT] [Flex] Deserializing AMF/HTTP
request

Version: 3

(Message #0 targetURI=null, responseURI=/2)

(Array #0)

[0] = (Typed Object #0
'flex.messaging.messages.RemotingMessage')

operation = "sayHello"

source = null

clientId = null

destination = "helloWorldAction"

timestamp = 0

messageId = "262F153C-E9B4-B3D8-9E1C-59DE220A1615"

timeToLive = 0

headers = (Object #1)

myId = "1"

DSEndpoint = "my-amf"

DSId = "91675ED1-280B-9EE3-8ED0-EA8D9A83DD76"

body = (Array #2)

[0] = "kjhkjhkj"



You will notice that myId is included in the headers section.



The return message is logging

Version: 3

(Header #0 name=myId, mustUnderstand=false)

"1"



(Message #0 targetURI=/2/onResult, responseURI=)

(Typed Object #0
'flex.messaging.messages.AcknowledgeMessage')

destination = null

headers = (Object #1)

correlationId = "262F153C-E9B4-B3D8-9E1C-59DE220A1615"

messageId = "91676158-210C-AFFA-B47E-BDFFA3D7BEA6"

timestamp = 1.195508639921E12

clientId = "91675FDB-450D-6AFA-54DE-BCF9CFE3EDB7"

timeToLive = 0.0

body = "Hello, kjhkjhkj"



A header section is being logged but there is nothing in the
headers section of the message. On the flex side trying to

retrieve the messages will just return a undefined.



event.message.headers["myId"]



Is this a bug? Or is the behavior that you shouldn't be able
to add custom headers?



Hopefully this is the correct place to post this as this is
closest forum I found.

Thanks
1 Reply

Avatar

Level 1
Turns out I was using the wrong header object to set my
information to return. I needed to get a hold of the acknowledge
message body header and set it there.



i.e. Message msg = (Message)
context.getResponseMessage().getBody(0).getData();

msg.getHeaders().put.("myId",id);