Author |
Message
|
tobi3010 |
Posted: Mon Dec 02, 2013 10:14 am Post subject: Namespaces - Events |
|
|
Newbie
Joined: 02 Dec 2013 Posts: 6
|
Good evening,
my name is Tobias and i am new to this Forum.
I am currently developing a flow in IIB9 Express. For linking the flow to our monitoring tool we use events that are triggered at the terminals of certain nodes in the flow.
I am currently stuck to a problem that looks like a namespace problem but i am not quite sure about this.
For a little more explicit information:
- There is a structure (X) in the message that contains the data to be appended to the event
- This structure is surrounded by an envelope (soap)
So the Xpath for needed is:
Code: |
$Root/XMLNSC/e:Envelope/e:Header/h:X |
e and h are specified.
in two flows the above code appends the data correctly to the event in the other nothing is appended. I just got no idea why. The Message is XMLNSC parsed. The path is correct. (Tried by a Java-ComputeNode XPath just befor the event-configured Terminal) but it doesn't work....
The only difference between the flows working and not is that there is an xslt mapping between. But i checkt and valiudated that it produced the right output. (Just the xmlns definitions are at other places after the mapping, but the message itself is still valid to to xsd.)
Someone has made the same expirience, or can give me any hint what i could have done wrong? Or any idea for a work-around? (Tried to strip all namespcaed and use xpath then, but this requieres an additional node or subflow which is quite ugly and bad design.)
Any hint is welcome
Thanks in advance,
Tobias |
|
Back to top |
|
 |
Esa |
Posted: Mon Dec 02, 2013 10:49 am Post subject: Re: Namespaces - Events |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
tobi3010 wrote: |
in two flows the above code appends the data correctly to the event in the other nothing is appended. I just got no idea why. The Message is XMLNSC parsed. The path is correct.
|
Even if the path is correct, there may be a typo in either of the namespace settings for the monitoring event data location.
Is "Enabled" checked for the event? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Dec 02, 2013 2:21 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Isn't the message before the XSLT node as well as after it in BLOB format? This would mean no parsing.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Simbu |
Posted: Mon Dec 02, 2013 10:02 pm Post subject: |
|
|
 Master
Joined: 17 Jun 2011 Posts: 289 Location: Tamil Nadu, India
|
Ensure that "XPath Expression Builder" has the correct namespaces for $Root/XMLNSC/e:Envelope/e:Header/h:X |
|
Back to top |
|
 |
tobi3010 |
Posted: Tue Dec 03, 2013 12:00 am Post subject: |
|
|
Newbie
Joined: 02 Dec 2013 Posts: 6
|
Hi,
thanks for the hints so far.
I forgot to mention i am using assigned monitoring profiles as a configured service.
(Just copied as node-names are equal)
@fjb_saper: there is a reset-contentdescriptor node just after the map which resets does the parsing before the event is thrown.
@Esa: the event is enabled. It is forwarded to a queue by subscription. The only thing about the event is that it is missing the additional application data part in the event. (which makes me feel like there is an error in extracting this part from the message, but as said before using an MBXpath in a node i inserted before for debugging the message the extraction is working as expected.)
@Simbu: namespaces are set correctly as i use the same configurable Service with the same monitoring configuration that works with the other flow. (Node-Names for the event in the flows are equal.)
Is there anything to the message that may cause this behaviour? Any way of annotating namespaces, or maybe somthing else i have not considered?
Thanks so far.
Tobias |
|
Back to top |
|
 |
Simbu |
Posted: Tue Dec 03, 2013 12:23 am Post subject: |
|
|
 Master
Joined: 17 Jun 2011 Posts: 289 Location: Tamil Nadu, India
|
OK... can you please share us the monitoringProfile that you are using |
|
Back to top |
|
 |
Esa |
Posted: Tue Dec 03, 2013 2:25 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Just change the querytext for the event to
and see what you have. |
|
Back to top |
|
 |
naio |
Posted: Tue Dec 03, 2013 10:45 am Post subject: |
|
|
Voyager
Joined: 08 Nov 2012 Posts: 82
|
Hi tobi3010,
I have been working with event for a while, and I still got problem with nameSpaces.
The situation that you are describing happend many times to me, always was a problem in the namespace.
Try, adding another part or the message to the evento, for example a field of the MQMD o PROPERTIES, to discard a problem with the evento emission if this work, the you should re check the namespace and the message arriving at the node that is firing the event.
Regards. _________________ "God is in his heaven all's right with the world" |
|
Back to top |
|
 |
tobi3010 |
Posted: Wed Dec 04, 2013 6:09 am Post subject: |
|
|
Newbie
Joined: 02 Dec 2013 Posts: 6
|
Hi,
Thanks to all of you.
I finally managed to get rid of that little problem.
It seems like the mapping produced the same namespace but whit another prefix in all elements beneath the selected one. I am not quite sure if this caused the trouble but after correcting this and another element beneath that had no namespace at all everything works fine now.
Situation before
Code: |
<h:log xmlns:h="abc">
<e:e1 xmlns:e="abc">someValue</e:e1>
</h:log>
|
now
Code: |
<h:log xmlns:h="abc">
<h:e1>someValue</h:e1>
</h:log>
|
btw. does anyone know when a new namespace prefix is assigned by MbElements? I have the situation that NS1, NS2 and NS3 are defined for the same namespace on different elements.
Code: |
<NS1:head xmlns:h="abc">
<NS2:e1 xmlns:NS2="efg">...</NS2:e1>
<NS3:e2 xmlns:NS3="efg">...</NS3:e2>
<NS4:e3 xmlns:NS4="efg">...</NS4:e3>
</NS1:head>
|
This causes no error, but is just for my interest. Ist it if i use a different String in MbElement.setNamespace ? (so it checks for == instead of equals() when comparing namespaces) or does it happen if you assign them in different nodes, and then why ? Anybody knows this ?
Kind regards,
Tobias
Last edited by tobi3010 on Wed Dec 04, 2013 6:11 am; edited 1 time in total |
|
Back to top |
|
 |
tobi3010 |
Posted: Wed Dec 04, 2013 6:10 am Post subject: |
|
|
Newbie
Joined: 02 Dec 2013 Posts: 6
|
sorry just missed to replace the xmlns:h by NS1,...NS4 sorry |
|
Back to top |
|
 |
kimbert |
Posted: Wed Dec 04, 2013 7:35 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Search for 'XMLNSC Namespace' in the info center. It's all documented. _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 06, 2013 1:31 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
tobi3010 wrote: |
This causes no error, but is just for my interest. Ist it if i use a different String in MbElement.setNamespace ? (so it checks for == instead of equals() when comparing namespaces) or does it happen if you assign them in different nodes, and then why ? Anybody knows this ?
|
You have to assign a namespace declaration (specific type of your parser) to your xml root element to get the same ns prefix for the same ns throughout the document.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|