Author |
Message
|
abs_cal |
Posted: Wed May 20, 2009 5:40 am Post subject: How ot handle read only message inside Broker |
|
|
Acolyte
Joined: 18 Aug 2005 Posts: 62
|
I am trying to get seesionid from a HTTPs response message. During dubug, I found it is coming as READ ONLY message therefore, I am not able to modify/receate this message. I also trying to get the sessionid with a variable using below code. However, it is coming as null value. Can you please help me where it went wrong. Thanks
SET OutputRoot.XMLNS.SeesionId_8 = InputBody.XMLNSC.loginResponse.result.sessionId;
SET OutputRoot.XMLNS.SeesionId_6 = InputRoot.XMLNSC.loginResponse.result.sessionId; [/list][img][/img] |
|
Back to top |
|
 |
Vitor |
Posted: Wed May 20, 2009 6:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
What version of WMB? Are you sure the session id is stored at that point in the message tree? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
abs_cal |
Posted: Wed May 20, 2009 6:44 am Post subject: |
|
|
Acolyte
Joined: 18 Aug 2005 Posts: 62
|
Yes, I saw sessionId in debug msg. Copy the element name to aovid spelling mistakes. It is WMB6.1 with FP 3.
Funny part is that, I can get the message into LOGIN_SESSION_ID using
SET OutputRoot.XMLNS.LOGIN_SESSION_ID = InputRoot.*[3];
Nut not accesible element inside message like
SET LOGIN_SESSION_ID = InputRoot.XMLNS.loginResponse.....;
Why I am not able to naviage the message to read the element. Ok, if it is not XMl then I uesed parse option to create well formed XML before accessing one element.
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNS') PARSE(OutputRoot.XMLNS.LOGIN_SESSION_ID CCSID 437 FORMAT 'XMLNS');
Above code is giving me error "parsing error"
Any help from you? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 20, 2009 6:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
First.
Stop using XMLNS.
Use XMLNSC.
Second, you don't need to CREATE FIELD.
In particular you don't need to CREATE FIELD with PARSE to turn what is already an XML field into an XML field.
InputRoot.*[3] is the third child of InputRoot. Why do you think that would be the same as InputRoot.XMLNSC.<namespace>:loginResponse.<namespace>.result.<namespace>.sessionId?
Use a Trace node after your HTTPResponse node. Tell it to write to a file. Look at the tree structure that ${Root} produces. Use that to replicate the path you need in ESQL. |
|
Back to top |
|
 |
Vitor |
Posted: Wed May 20, 2009 6:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
abs_cal wrote: |
Yes, I saw sessionId in debug msg. |
Yes but where in the message tree?
abs_cal wrote: |
Funny part is that, I can get the message into LOGIN_SESSION_ID using
SET OutputRoot.XMLNS.LOGIN_SESSION_ID = InputRoot.*[3];
Nut not accesible element inside message like
SET LOGIN_SESSION_ID = InputRoot.XMLNS.loginResponse.....; |
My point exactly. How did you come to believe that an HTTP header value would be part of the message body? It's not where I would have expected, though http is not my thing. Can you post a document link?
abs_cal wrote: |
Above code is giving me error "parsing error" |
I'm not surprised. It's not well formed XML is it? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|