Author |
Message
|
harish_td |
Posted: Tue Oct 06, 2015 9:10 am Post subject: how to emit namespace independent fields to Business Monitor |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
Hello Experts,
I am trying to emit a XML field (numDigits) to the Business Monitor v8.5.6 from a IIB v9.0.0.4. My XML looks like the following -
Code: |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="http://com.itso" xmlns:v1="http://com.ibm/xml/schemas/v1_0/>
<soapenv:Header/>
<soapenv:Body>
<com:getPrime>
<v1:numDigits>3</v1:numDigits>
</com:getPrime>
</soapenv:Body>
</soapenv:Envelope> |
I have tried to use the following XPath
Code: |
/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='getPrime']/*[local-name()='numDigits'] |
in the Data location setting of the monitoring tab to emit events. But no luck so far. Can you please guide me on how to emit namespace independent fields?
Thanks,
Harish
Last edited by harish_td on Tue Oct 06, 2015 10:16 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Tue Oct 06, 2015 9:34 am Post subject: Re: how to emit namespace independent fields to Business Mon |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
harish_td wrote: |
Can you please guide me on how to emit namespace independent fields? |
Do you mean by this that you want to obtain (and include in the monitoring message) the value of numDigits irrespective of the namespace in which the parent getPrime tag resides? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
harish_td |
Posted: Tue Oct 06, 2015 9:54 am Post subject: Re: how to emit namespace independent fields to Business Mon |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
Vitor wrote: |
Do you mean by this that you want to obtain (and include in the monitoring message) the value of numDigits irrespective of the namespace in which the parent getPrime tag resides? |
Yes. That's what I am trying to achieve. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 06, 2015 10:03 am Post subject: Re: how to emit namespace independent fields to Business Mon |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
harish_td wrote: |
Vitor wrote: |
Do you mean by this that you want to obtain (and include in the monitoring message) the value of numDigits irrespective of the namespace in which the parent getPrime tag resides? |
Yes. That's what I am trying to achieve. |
That's not what your XML document says.
It says that numDigits has the same namespace as it's parent - "xmlns:com="http://com.itso"" _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
harish_td |
Posted: Tue Oct 06, 2015 10:17 am Post subject: Re: how to emit namespace independent fields to Business Mon |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
mqjeff wrote: |
That's not what your XML document says.
It says that numDigits has the same namespace as it's parent - "xmlns:com="http://com.itso"" |
Copy-paste error. I have now edited the sample message to be more reflective of what I am trying to achieve.
Actually, the namespaces that we will encounter in run-time could be different for each of the tags. So I am trying to emit the payload field regardless of which namespace, the parent or the child is buried within.
In fact the moment, I enter local-name() in the XPath editor, I am prompted with the following error.
Code: |
The local-name XPath function in the $Root/XMLNSC/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='getPrime']/*[local-name()='numDigits']] Xpath is not supported |
|
|
Back to top |
|
 |
mqjeff |
Posted: Tue Oct 06, 2015 10:27 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
In ESQL you can say something like "*:fieldname" to indicate that you don't care what the (incoming tree) namespace is.
I'd guess there's someway to do this in Xpath, but I'm not sure. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
timber |
Posted: Tue Oct 06, 2015 3:24 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
You might want to check what the info center says about the 'XPath' syntax used in monitoring events. I seem to remember that predicates ( the boolean expressions within the [] ) are not allowed. So this XPath would not be valid for a monitoring event data location:
Code: |
/*[local-name()='Envelope']/*[local-name()='Body']/*[local-name()='getPrime']/*[local-name()='numDigits']
|
But don't take my word for it - my memory may be faulty. |
|
Back to top |
|
 |
harish_td |
Posted: Tue Oct 06, 2015 11:05 pm Post subject: |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
You are right Tim. Although the snippet conforms to XPath 1.0 and can retrieve the field in a standalone XSL file, it seems to upset the monitoring event component.
The only option i see is to pass the whole bitstream and then process only the fields that are to be tracked. This just shifts the complexity to the design of the monitor model. And then we have the issue of parsing, transmitting of a lot of data that is meant to be discarded.
Can you propose any other way forward? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Oct 07, 2015 5:19 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You could parse the message in the compute/java/mapping node or whatever into the data you want for the monitoring event, and then send it to a separate terminal. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
timber |
Posted: Wed Oct 07, 2015 7:00 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
I agree - just what I was going to suggest |
|
Back to top |
|
 |
Gemz |
Posted: Thu Oct 08, 2015 2:37 am Post subject: |
|
|
 Centurion
Joined: 14 Jan 2008 Posts: 124
|
Hi,
We use below XPath in monitoring profile xmls to extract required value.
Can you check whether it gives what you need ?
Code: |
$Root//*[local-name() = 'getPrime']/*[local-name() = 'numDigits'] |
_________________ GemZ
"An expert is one who knows more and more about less and less until he knows absolutely everything about nothing...." |
|
Back to top |
|
 |
|