|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Namespaces again: how to navigate to the field in a message |
« View previous topic :: View next topic » |
Author |
Message
|
accosun |
Posted: Sat Mar 03, 2007 6:32 am Post subject: Namespaces again: how to navigate to the field in a message |
|
|
Apprentice
Joined: 20 Dec 2001 Posts: 45 Location: Moscow
|
Hi everybody!
My flow receives an XML message (SOAP) with namespaces. Here is the beginning of it:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/06/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
<app:ApplicationInf xmlns:app="urn:plant.ru:Envelope:ApplicationInf:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<app:SoftKind>String</app:SoftKind>
<app:SoftVersion>String</app:SoftVersion>
<app:MessageKind>ABCD</app:MessageKind>
</app:ApplicationInf>
</env:Header>
I parse the message with XMLNS parser and I should check the value in
<app:MessageKind> field.
I wrote ESQL code:
CALL CopyEntireMessage();
DECLARE env NAMESPACE 'http://www.w3.org/2001/06/soap-envelope';
DECLARE app NAMESPACE '"urn:plant.ru:Envelope:ApplicationInf:1.0"';
IF InputRoot.XMLNS.env:Envelope.env:Header.app:ApplicationInf.app:MessageKind='ABCD'
THEN SET OutputLocalEnvironment.Destination.RouterList.DestinationData[1].labelname = 'ASG.001';
END IF;
But it doesn't work. Here is data from trace file:
"...
Executing statement ''IF InputRoot.XMLNS.env:Envelope.env:Header.app:ApplicationInf.app:MessageKind = 'RNTS.ASG.001' THEN... END IF;'' at ('.ASKTT_PreParse.Main', '8.3').
2007-03-03 17:05:51.162960 3828 UserTrace BIP2543I: Node 'ASKTT.Compute': ('.ASKTT_PreParse.Main', '8.6') : Failed to navigate to path element number '5' because it does not exist.
2007-03-03 17:05:51.163024 3828 UserTrace BIP2539I: Node 'ASKTT.Compute': Evaluating expression ''InputRoot.XMLNS.env:Envelope.env:Header.app:ApplicationInf.app:MessageKind'' at ('.ASKTT_PreParse.Main', '8.6'). This resolved to ''InputRoot.XMLNS.http://www.w3.org/2001/06/soap-envelope:Envelope.http://www.w3.org/2001/06/soap-envelope:Header."urn:plant.ru:Envelope:ApplicationInf:1.0":ApplicationInf."urn:plant.ru:Envelope:ApplicationInf:1.0":MessageKind''. The result was ''EMPTY ROW''.
2007-03-03 17:05:51.163063 3828 UserTrace BIP2539I: Node 'ASKTT.Compute': Evaluating expression ''InputRoot.XMLNS.env:Envelope.env:Header.app:ApplicationInf.app:MessageKind = 'RNTS.ASG.001''' at ('.ASKTT_PreParse.Main', '8.80'). This resolved to ''EMPTY ROW = 'RNTS.ASG.001'''. The result was ''NULL''.
2007-03-03 17:05:51.163097 3828 UserTrace BIP2537I: Node 'ASKTT.Compute': Executing statement ''RETURN TRUE;'' at ('.ASKTT_PreParse.Main', '11.3').
...."
Broker can't process namespace "urn:customs.ru:Envelope:ApplicationInf:1.0"
I've also tried other ways to get to this field, but...
Please, give me an advise, how to work it out!
Thank you in advance, Alexander |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Mar 03, 2007 8:56 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
|
Back to top |
|
 |
vsr |
Posted: Sun Mar 04, 2007 5:10 pm Post subject: Re: Namespaces again: how to navigate to the field in a mess |
|
|
Centurion
Joined: 04 Apr 2006 Posts: 104
|
accosun wrote: |
I wrote ESQL code:
DECLARE app NAMESPACE '"urn:plant.ru:Envelope:ApplicationInf:1.0"';
|
Did you try removing the double "double-quotes " and replacing with single quote ?
'" urn:plant.ru:Envelope:ApplicationInf:1.0 '" |
|
Back to top |
|
 |
AkankshA |
Posted: Sun Mar 04, 2007 10:47 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
DECLARE app NAMESPACE '"urn:plant.ru:Envelope:ApplicationInf:1.0"';
this would set app as
'urn:plant.ru:Envelope:ApplicationInf:1.0' and not urn:plant.ru:Envelope:ApplicationInf:1.0
try with single quotes as suggested by vsr... i am sure it should work well  _________________ Cheers |
|
Back to top |
|
 |
accosun |
Posted: Mon Mar 05, 2007 4:12 am Post subject: |
|
|
Apprentice
Joined: 20 Dec 2001 Posts: 45 Location: Moscow
|
Hi, thank you for your replies!
Quote: |
Did you try removing the double "double-quotes " and replacing with single quote ?
'" urn:plant.ru:Envelope:ApplicationInf:1.0 '" |
It was my first try. Using of single quotes, of course, is correct, but in this case broker try to build the following branch:
''InputRoot.XMLNS.http://www.w3.org/2001/06/soap-envelope:Envelope.http://www.w3.org/2001/06/soap-envelope:Header.urn:plant.ru:Envelope:ApplicationInf:1.0:ApplicationInf.urn:plant.ru:Envelope:ApplicationInf:1.0:MessageKind''
and it interprets "urn:plant" as another element. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|