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 » How to Handle Namespaces Dynamically in ESQL in WMB 6.0.0.9?

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 How to Handle Namespaces Dynamically in ESQL in WMB 6.0.0.9? « View previous topic :: View next topic » 
Author Message
EricCox
PostPosted: Wed Oct 24, 2012 7:27 am    Post subject: How to Handle Namespaces Dynamically in ESQL in WMB 6.0.0.9? Reply with quote

Master

Joined: 08 Apr 2011
Posts: 292

To all,

I've been told to handle inbound request namespace declarations dynamically.

I read another post that mentioned using a namespace wildcard prefix as such

Code:

DECLARE ref_CustInfo REFERENCE TO InputRoot.XML."*:Envelope"."*:Body"."getCustConsLoanAcctsRq"."CustInfo";


That didn't work. I am using the default parser.

This code with the fully qualified namespace I used during development works:

Code:

DECLARE ref_CustInfo REFERENCE TO InputRoot.XML."SOAP-ENV:Envelope"."SOAP-ENV:Body"."getCustConsLoanAcctsRq"."CustInfo";


How do I handle variable namespace declarations dynamically?

Thanks,
Eric
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Oct 24, 2012 7:31 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

6.0 is unsupported and has many malfunctions with regard to namespaces.

Code:
SET myvar = InputRoot.SOAP.Body.somenamespace:hisvar;

_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Oct 24, 2012 7:35 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Why, at all, are you expecting the XML parser, which is KNOWN AND DESIGNED NOT TO SUPPORT NAMESPACES, to support namespaces?

At a *bare* minimum, you *must* use XMLNS.

Back to top
View user's profile Send private message
EricCox
PostPosted: Wed Oct 24, 2012 7:53 am    Post subject: Legacy Reply with quote

Master

Joined: 08 Apr 2011
Posts: 292

You can degrade me all you want for being on an unsupported version, having legacy code, using the XML parser etc. I totally understand that.

Given no training, legacy code and being under the pressure of producing a working service I've done that.

Now, how do I change to the XMLNSC parser and how do I change my code once having done so to handle namespaces dynamically?

Thanks
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Oct 24, 2012 7:55 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You change "OutputRoot.XML" to "OutputRoot.XMLNS" or "OutputRoot.XMLNSC".

That's it.

But it's *vital* to know what "OutputRoot.XML" means, and why that's different than "OutputRoot.BLOB" and "OutputRoot.MRM" and etc. If you don't *know* that, and *understand* that, you don't really know broker.

It's *vital* to using the product, regardless of version and training.
Back to top
View user's profile Send private message
EricCox
PostPosted: Wed Oct 24, 2012 8:04 am    Post subject: Different Types of Message Trees Reply with quote

Master

Joined: 08 Apr 2011
Posts: 292

From what I can tell they are different types of message trees, byte streams and corresponding parsers and message definitions that work with them. For instance MRM works with CWF Message Definitions...etc.

I guess I'm probably oversimplifying them.

In this case I'm working on an 'Inbound' Request.

So you suggest I use InputRoot.XMLNSC.x.x.x?

If so then how do I handle the namespace declarations dynamically? Can I use the * wildcard?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Oct 24, 2012 8:14 am    Post subject: Re: Different Types of Message Trees Reply with quote

Grand High Poobah

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

EricCox wrote:
So you suggest I use InputRoot.XMLNSC.x.x.x?


If it works under 6.0.0.9.

EricCox wrote:
If so then how do I handle the namespace declarations dynamically? Can I use the * wildcard?


If it works.

You might also be able to determine what namespace is in use, which could help when you need to know more than the value of an element irrespective of it's namespace.

But in a rare turn of events, I agree with the previous poster in that 6.0 is unsupported and sucked at working with namespaces. If my dim recollection is correct, the XMLNSC parser doesn't exist in that version but came in the v6.1.

6.0 did (I think) have XMLNS which, as I indicated above, sucked at namespaces.

In your position I'd tell whoever's telling you to support dynamic namespaces you need a more recent version of WMB to do it.

Or just tell them they've been running the risk of using out of support software, and the risk just failed to pay off.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
vmcgloin
PostPosted: Wed Oct 24, 2012 8:28 am    Post subject: Re: Different Types of Message Trees Reply with quote

Knight

Joined: 04 Apr 2002
Posts: 560
Location: Scotland

Vitor wrote:

In your position I'd tell whoever's telling you to support dynamic namespaces you need a more recent version of WMB to do it.

Or just tell them they've been running the risk of using out of support software, and the risk just failed to pay off.


Or read 'Using XML namespaces' in your version of the infocenter and try

Code:
DECLARE ref_CustInfo REFERENCE TO InputRoot.XMLNS.*:Envelope.*:Body.getCustConsLoanAcctsRq.CustInfo;

- along with other changes indicated in migrating from the XML to XMLNS parser in said infocenter

..then enthusiastically offer to lead the software upgrade to latest supported version with all the other benefits that brings.
Back to top
View user's profile Send private message
EricCox
PostPosted: Wed Oct 24, 2012 9:17 am    Post subject: Somthing Else Reply with quote

Master

Joined: 08 Apr 2011
Posts: 292

I've changed the HTTPInput Node to use XMLNS and have changed the reference to use InputRoot.XMLNS but it doesn't appear to be working.

Do I need to do something else?
Back to top
View user's profile Send private message
wbi_telecom
PostPosted: Wed Oct 24, 2012 9:24 am    Post subject: Reply with quote

Disciple

Joined: 15 Feb 2006
Posts: 188
Location: Harrisburg, PA

Did you try what vmcgloin suggested in his post? Putting *: in before the tag should let you parse the tag without specifying actual namespace. As far as I know its working like this with XMLNS since 6.0.

Cheers,
Back to top
View user's profile Send private message
EricCox
PostPosted: Wed Oct 24, 2012 9:34 am    Post subject: Tried That Reply with quote

Master

Joined: 08 Apr 2011
Posts: 292

Here is what I did to follow the suggestions:

1.) Changed the HTTPInput Node to use XMLNS Parser
2.) Changed the setting the REFERENCE as such:

Code:

DECLARE ref_getCustConsLoanAcctsRq REFERENCE TO InputRoot.XMLNS."*:Envelope"."*:Body"."getCustConsLoanAcctsRq";

IF ref_getCustConsLoanAcctsRq."CustInfo"."CustId" IS NOT NULL THEN


The result of this is NULL since it can't navigate into the tree...not sure why? I'm obviously new to XMLNS.

I tried it with and without quotes around the * wildcard.

Do I need to do something else or am not treating the code properly to use XMLNS?

It says it can't navigate into the tree. I'll capture the exact error and post.
Back to top
View user's profile Send private message
EricCox
PostPosted: Wed Oct 24, 2012 9:40 am    Post subject: Flow Config Reply with quote

Master

Joined: 08 Apr 2011
Posts: 292

Here is how the flow is built:

HTTPInput-XMLNS>>>
Compute-saves RequestId(Mode=Message)>>>>>
CalcStartTime-save Env.Var.StartTime>>>
MainCompute-Using InputRoot.XMLNS.x.x.x

I'm not sure if something in here is interfering with XMLNS?

What is there to look for that would interfere with XMLNS?

From what I understand the HTTPInput Node populates the message tree in the XMLNS Parser and that stays in scope throughout the flow. Is that right? This is just as if I was using XML Parser.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Oct 24, 2012 9:45 am    Post subject: Reply with quote

Grand High Poobah

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

wbi_telecom wrote:
Did you try what vmcgloin suggested in his post?


Don't assume all posters are male. In this instance you are not correct.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rekarm01
PostPosted: Wed Oct 24, 2012 9:45 am    Post subject: Re: Tried That Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

EricCox wrote:
I tried it with and without quotes around the * wildcard.

Lose the quotes, especially around the * wildcard.

Get in the habit of using LASTMOVE() to verify that a reference variable is still good, after declaring it or moving it.

Add a Trace node before the Compute node in question, to display the message tree structure, and run a debug-level usertrace.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Oct 24, 2012 9:49 am    Post subject: Re: Flow Config Reply with quote

Grand High Poobah

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

EricCox wrote:
I'm not sure if something in here is interfering with XMLNS?


It's probably the XMLNS parser code.

EricCox wrote:
What is there to look for that would interfere with XMLNS?


The fact that it sucked in that version? An out of support version to which you do not even have all the available fixes applied (the last was v6.0.0.11)

EricCox wrote:
From what I understand the HTTPInput Node populates the message tree in the XMLNS Parser and that stays in scope throughout the flow. Is that right? This is just as if I was using XML Parser.


It's the same for all the message domains. Again, asking this demonstrates a fundamental lack of understanding of how WMB works, and has worked both before and after the ancient, creaking version you're trying to use like it's still worth the effort.
_________________
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, 3  Next Page 1 of 3

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to Handle Namespaces Dynamically in ESQL in WMB 6.0.0.9?
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.