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 » Help With move

Post new topic  Reply to topic
 Help With move « View previous topic :: View next topic » 
Author Message
telus
PostPosted: Thu Nov 01, 2012 1:26 pm    Post subject: Help With move Reply with quote

Apprentice

Joined: 01 Nov 2012
Posts: 26

HI,

I am new to message broker and I am using the Large sample messging feature.

The Example XML in the sample is

<-SaleEnvelope>
+<Header>
+<SaleList>
+<SaleList>
+<SaleList>
+<SaleList>
</SaleEnvelope>

In order to Acquire the first SaleList element it is giving the statement
MOVE refEnvironmentSaleList FIRSTCHILD NAME ROOT_LEVEL;

Where ROOT_LEVEL =SaleEnvelope

In My Scenario,

The XML is of the structure like below(Just Matching with above sample)

<?xml version="1.0" encoding="UTF-8"?>
-<pi:Sales_Extract xmlns:mi="pgb:com.xyz/file">
-<pi:SaleGroup>
+<pi:Header>
+<pi:SaleList>
+<pi:SaleList>
+<pi:SaleList>
+<pi:SaleList>
+<pi:SaleList>
+<pi:SaleList>
</pi:SaleGroup>
</pi:Sales_Extract>

So in above case all the data of sales in Sales group

So If I am using the statement

MOVE refEnvironmentSaleList FIRSTCHILD NAME ROOT_LEVEL; Where ROOT_LEVEL=SaleGroup

I got the error no root element present.

Could anyone please advice
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Thu Nov 01, 2012 9:21 pm    Post subject: Re: Help With move Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Code:
<-SaleEnvelope>
+<Header>
+<SaleList>
+<SaleList>
+<SaleList>
+<SaleList>
</SaleEnvelope>


MOVE refEnvironmentSaleList FIRSTCHILD NAME 'SaleEnvelope';


Code:
<?xml version="1.0" encoding="UTF-8"?>
-<pi:Sales_Extract xmlns:mi="pgb:com.xyz/file">
  -<pi:SaleGroup>
  +<pi:Header>
  +<pi:SaleList>
  +<pi:SaleList>
  +<pi:SaleList>
  +<pi:SaleList>
  +<pi:SaleList>
  +<pi:SaleList>
  </pi:SaleGroup>
  </pi:Sales_Extract>


MOVE refEnvironmentSaleList FIRSTCHILD NAME 'Sales_Extract';
MOVE refEnvironmentSaleList FIRSTCHILD NAME 'SaleGroup';
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
rekarm01
PostPosted: Thu Nov 01, 2012 11:54 pm    Post subject: Re: Help With move Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

telus wrote:
So If I am using the statement

Code:
MOVE refEnvironmentSaleList FIRSTCHILD NAME ROOT_LEVEL;  Where ROOT_LEVEL=SaleGroup

I got the error no root element present.

What does the actual statement look like? It seems the "Where" clause would cause a syntax error, unless it were commented out. How is refEnvironmentSaleList declared? How is ROOT_LEVEL declared or set?

Whenever declaring or moving a reference variable, use LASTMOVE() to confirm that the reference is still valid. A Trace node is useful for displaying the actual message structure, and a usertrace is useful for displaying the actual error.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Fri Nov 02, 2012 2:25 am    Post subject: Re: Help With move Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

This "Where ..." is just a comment !

There is no WHERE (in the native ESQL MOVE statement)

Code:
MOVE refEnvironmentSaleList FIRSTCHILD NAME ROOT_LEVEL; -- Where ROOT_LEVEL=SaleGroup


means:

Code:
DECLARE ROOT_LEVEL CHAR 'SaleGroup';
MOVE refEnvironmentSaleList FIRSTCHILD NAME ROOT_LEVEL;

_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Nov 02, 2012 3:11 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

you may need to add namespace...like in

MOVE ref first child NAMESPACE xyz NAME myname;

However I would not even worry. You could also use
MOVE ref FIRSTCHILD TYPE .... or just go to first child and then move through the siblings until you find Fieldname(ref) = myname...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqsiuser
PostPosted: Fri Nov 02, 2012 3:26 am    Post subject: Re: Help With move Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Dear OP,

you are struggeling to move (into) your (own) msg-tree. So here is my tip for you:

I would attach the degugger and just look into the variables view.

And you can just spare "NAME 'xyz'" and just move into the firstchild:

Code:
MOVE refEnvironmentSaleList FIRSTCHILD;
MOVE refEnvironmentSaleList FIRSTCHILD;


You have one more child than the example, so you have to use "MOVE ref FIRSTCHILD" two times (instead of one).
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
telus
PostPosted: Fri Nov 02, 2012 6:22 am    Post subject: Reply with quote

Apprentice

Joined: 01 Nov 2012
Posts: 26

Hi ,

As this is in namespace Pi but broker is not recongising this namespace.

and moreover the FIRSTCHILD NOT WORKING IN THIS CASE
THE LASTCHILD WORKS

I HAVE USED LASTCHILD TWO TIMES TO GET IT TO SaleGroup .

bUT STILL NOT DETERMINE HOW SHOULD i USE THE NAMESPACE AS IN THIS IS CASE IT IS PI.

THANKS


Last edited by telus on Sat Nov 03, 2012 4:35 am; edited 1 time in total
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Fri Nov 02, 2012 6:51 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Your elements have "pi:myElement", but you have not set/declared the namespace. That is not valid xml:

Code:
<?xml version="1.0" encoding="UTF-8"?>
  <pi:Sales_Extract xmlns:mi="pgb:com.xyz/file">
   ...


"mi" should be "pi" ?!

Code:
F [Xerces] The prefix "pi" for element "pi:Sales_Extract" is not bound.
Back to top
View user's profile Send private message
jrsdm
PostPosted: Fri Nov 02, 2012 9:15 am    Post subject: Reply with quote

Apprentice

Joined: 24 Oct 2012
Posts: 27

You can use

namespace tag with move
Back to top
View user's profile Send private message
telus
PostPosted: Sat Nov 03, 2012 4:34 pm    Post subject: Reply with quote

Apprentice

Joined: 01 Nov 2012
Posts: 26

Still it doesn't work

Any idea please ?
Back to top
View user's profile Send private message
kimbert
PostPosted: Sat Nov 03, 2012 5:16 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Still it doesn't work
Any idea please ?
Yes - your code is wrong. Please explain what you did, and what happened. Remember that we cannot see your screen, so we don't know this stuff unless you explain it very clearly.
Quote the full text of any error messages. Post Trace node output from your flow.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Sat Nov 03, 2012 7:50 pm    Post subject: Re: Help With move Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

rekarm01 wrote:
Whenever declaring or moving a reference variable, use LASTMOVE() to confirm that the reference is still valid. A Trace node is useful for displaying the actual message structure, and a usertrace is useful for displaying the actual error.


telus wrote:
... and moreover the FIRSTCHILD NOT WORKING IN THIS CASE
THE LASTCHILD WORKS

A Trace node would have helped spot that more quickly.

telus wrote:
bUT STILL NOT DETERMINE HOW SHOULD i USE THE NAMESPACE AS IN THIS IS CASE IT IS PI.

More precisely, "pi" (or "mi"?) is just the namespace prefix.

The InfoCenter describes how to use the MOVE statement NAMESPACE clause.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Help With move
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.