ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » I have an JDBC adapter success xml message as follows:

Post new topic  Reply to topic Goto page 1, 2  Next
 I have an JDBC adapter success xml message as follows: « View previous topic :: View next topic » 
Author Message
sunilagarwal.1982
PostPosted: Mon May 04, 2009 2:57 am    Post subject: I have an JDBC adapter success xml message as follows: Reply with quote

Novice

Joined: 04 May 2009
Posts: 20

I have an JDBC adapter success xml message as follows:

<?xml version="1.0" encoding="UTF-8"?>
<?CWRSD status="0" description="null"?>
<Q1:CLOB_BO
xmlns:Q1="BOSchema/CLOB_BO" version="3.0.0" verb="Create" locale="en_US" delta="false">
<Q1:CLOB>484341524456414c
-
-
-
-
030303335300d0a</Q1:CLOB>
<Q1:MetaData>
<Q2:JText_META_DATA xmlns:Q2="2002/BOSchema/JText_META_DATA" version="3.0.0" verb="" locale="en_US" delta="false">
<Q2:OutFileName>HI_SSS_888.OUT</Q2:OutFileName>
</Q2:JText_META_DATA>
</Q1:MetaData>
</Q1:CLOB_BO>


In the message flow I need to access the values of the CWRSD elements using the ESQL. More specifically, I need to access the value of "Status" and "description" of CWRSD. How can I access that. Based on the value of
Status I want ot transfer my message specific queue.

If Status = 0 transfer the message to a ABC.Success queue
If Status = -1 transfer the message to a ABC.Error queue

Please help me how Can I do this.

Thanks in advance
Sunil
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon May 04, 2009 4:06 am    Post subject: Re: I have an JDBC adapter success xml message as follows: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sunilagarwal.1982 wrote:
More specifically, I need to access the value of "Status" and "description" of CWRSD. How can I access that.


Using ESQL? I don't understand the question. On the face of it this is a simple enough thing; what have you tired and what went wrong when you tried it?

sunilagarwal.1982 wrote:
Based on the value of
Status I want ot transfer my message specific queue.

If Status = 0 transfer the message to a ABC.Success queue
If Status = -1 transfer the message to a ABC.Error queue

Please help me how Can I do this.


Again this seems a simple enough thing; either use a Filter node or propogate the messages to 2 different terminals. Have I misunderstood your questions?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
marko.pitkanen
PostPosted: Mon May 04, 2009 4:12 am    Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi,

The same information can be found from MQRFH2 header. I have used it from there:
Code:
if InputRoot.MQRFH2.usr.Status = '-1' then...


Marko
Back to top
View user's profile Send private message Visit poster's website
sunilagarwal.1982
PostPosted: Mon May 04, 2009 6:02 pm    Post subject: How to read the CWRSD element of JDBC adapter xml message Reply with quote

Novice

Joined: 04 May 2009
Posts: 20

I used ESQL code conventions in WebSphere Message Broker to develop message flow applications.

I am writing the message routing concept in Compute node code.

I wrote the below code but looks like I missed something so it is not working fine.

ESQL CODE


BEGIN
CALL CopyMessageHeaders();
DECLARE InputRef REFERENCE TO InputRoot.XML.(XML.ProcessingInstruction)CWRSD;

IF InputRef.status = '0' THEN
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = 'ABC.SUCCESS';
ELSE
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = 'ABC.ERROR';
END IF;

RETURN TRUE;
END;


Regards,
Sunil
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon May 04, 2009 11:07 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Have you put a trace node before your Compute node and seen exactly what is in ${Root}?

Please do this and then compare the parser shown in the trace output and the one used in your code.
Let us know what you find.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon May 04, 2009 11:38 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

smdavies99 wrote:
Have you put a trace node before your Compute node and seen exactly what is in ${Root}?




You should also stop using the XML domain and use XMLNS (or better still XMLNSC). Especially as your data is namespaced.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Tue May 05, 2009 12:26 am    Post subject: Re: How to read the CWRSD element of JDBC adapter xml messag Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

smdavies99 wrote:
Have you put a trace node before your Compute node and seen exactly what is in ${Root}?

... and maybe put a trace node after the Compute node, too. Check the contents of ${LocalEnvironment} as well.

Consult the documentation for compute nodes, particularly the Compute Mode property.
Back to top
View user's profile Send private message
sunilagarwal.1982
PostPosted: Tue May 05, 2009 1:52 am    Post subject: Reply with quote

Novice

Joined: 04 May 2009
Posts: 20

Can you please give me you mail id so that I can send the complte code.

I tried this method but it is not working.

Sunil
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue May 05, 2009 2:07 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sunilagarwal.1982 wrote:
Can you please give me you mail id so that I can send the complte code.


You may notice the "email" button on all of these posts. Generally it's considered better to post the relevent parts of the code (no one likes 4 screens of code on the forum) so we can all see/comment. Who knows, someone new may spot a problem.

sunilagarwal.1982 wrote:
I tried this method but it is not working.


What method? Not working how? What did the trace show?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sunilagarwal.1982
PostPosted: Tue May 05, 2009 5:47 pm    Post subject: Reply with quote

Novice

Joined: 04 May 2009
Posts: 20

I tried all the given options in this mail chain. Message is always landing to error queue.

Yes, I didn't try Trace as I not very much aware , how to use the tracing.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue May 05, 2009 9:58 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

sunilagarwal.1982 wrote:

Yes, I didn't try Trace as I not very much aware , how to use the tracing.


Now is an ideal time to learn then?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
sunilagarwal.1982
PostPosted: Thu May 07, 2009 2:24 am    Post subject: Reply with quote

Novice

Joined: 04 May 2009
Posts: 20

I used the trace node but I didn't get the value of status and description in Root.

Then I used below Code:

DECLARE InputRef REFERENCE TO InputRoot.XML.(XML.ProcessingInstruction)CWRSD;
DECLARE valueStatus CHARACTER;
SET valueStatus = InputRef;

I got the result:

CHARACTER valueStatus = status="0" description="null"

I tried to access the value of status attribute using:

InputRef.status;

But it returns "UNKNOWN"

Please suggest how I can get the value of status from valueStatus

Regards,
Sunil
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu May 07, 2009 2:32 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sunilagarwal.1982 wrote:
I used the trace node but I didn't get the value of status and description in Root.


Then you set it up wrong!

You were also advised to use trace not the Trace node. You'll find it described in the documentation. It's really very helpful.


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sunilagarwal.1982
PostPosted: Thu May 07, 2009 4:04 am    Post subject: Reply with quote

Novice

Joined: 04 May 2009
Posts: 20

I used the tract Node in correct way and I got the below out put:


(0x01000010):XML = (
(0x05000018):XML = (
(0x06000011): = '1.0'
(0x06000012): = 'UTF-8'
)
(0x06000002): = '
'
(0x07000002):CWRSD = 'status="-1" description="null"'
(0x06000002): = '
'
(0x01000000):Q1:CLOB_BO = (
(0x02000000): = 'Sunil Agarwal'
)
)
)

Please let me knwo how I can get the value of status attribute from this.

(0x07000002):CWRSD = 'status="-1" description="null"'

Regards,
Sunil
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu May 07, 2009 4:09 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

sunilagarwal.1982 wrote:
I used the tract Node in correct way


Quite so, but if you'd set it up differently you'd have got Root as you said.

And it's still a Trace node not a trace.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » I have an JDBC adapter success xml message as follows:
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.