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 » MB7 treat namespace as child element, is this a bug?

Post new topic  Reply to topic
 MB7 treat namespace as child element, is this a bug? « View previous topic :: View next topic » 
Author Message
kentkong
PostPosted: Thu May 12, 2011 5:04 am    Post subject: MB7 treat namespace as child element, is this a bug? Reply with quote

Newbie

Joined: 12 May 2011
Posts: 1

hi, I found MB7 treat namespace as child element.
if I copy some parts of InputBody to Environment, then I use the copy from Environment, it has been changed, namespace becomes child element.

demo code is

Quote:
DECLARE soap NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';

SET Environment.Variables.msg.soap:Envelope.soap:Body = InputRoot.XMLNSC.soap:Envelope;
SET OutputRoot.XMLNSC.soap:Envelope = Environment.Variables.msg.soap:Envelope;


input message is

Quote:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<m:findEntry xmlns:m="http://service.addressbook.sample">
<m:args0>String</m:args0>
</m:findEntry>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


output is

Quote:
<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/">
<NS1:Body>
<xmlns:SOAP-ENV>http://schemas.xmlsoap.org/soap/envelope/</xmlns:SOAP-ENV>
<xmlns:SOAP-ENC>http://schemas.xmlsoap.org/soap/encoding/</xmlns:SOAP-ENC>
<xmlns:xsi>http://www.w3.org/2001/XMLSchema-instance</xmlns:xsi>
<xmlns:xsd>http://www.w3.org/2001/XMLSchema</xmlns:xsd>
<NS1:Body>
<NS2:findEntry xmlns:NS2="http://service.addressbook.sample">
<xmlns:m>http://service.addressbook.sample</xmlns:m>
<NS2:args0>String</NS2:args0>
</NS2:findEntry>
</NS1:Body>
</NS1:Body>
</NS1:Envelope>


the namespace becomes child element.

my logic is to save the soap request in db, then a client will read it from db. the namespace issue makes xml parsing error.

is this a bug? how can I get xml with normal namespace?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu May 12, 2011 5:08 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Enviroment tree does not have a parser associated with it, so it does not know what a "namespace" is.

Very common problem. Lots of similar questions with good responses to the dilligent searcher.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu May 12, 2011 5:12 am    Post subject: Reply with quote

Jedi Council

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

How about this quote by 'kimbert' {Lord of all things related to parsers }
Quote:

If you are copying parsed data into the Environment or LocalEnvironment tree, it is always best to create the parent node using the CREATE statement with the DOMAIN clause. Make sure that the parser specified by the DOMAIN clause is the same as the one which parsed the data.

If you don't follow this rule, the parser-specific data in the field type will get zeroed during the copy. That will produce a whole range of unpredictable results, depending on what the original parser was. One common symptom is that XML attributes turn into tags.

in this post ->http://www.mqseries.net/phpBB2/viewtopic.php?t=52988

There are several more words of wisdom in this post that are worth viewing.

This question is one {of the many} I use in interviews.
_________________
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
lancelotlinc
PostPosted: Thu May 12, 2011 11:52 am    Post subject: Reply with quote

Jedi Knight

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

smdavies99 wrote:
This question is one {of the many} I use in interviews.


Do you get hired when you answer these?
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MB7 treat namespace as child element, is this a bug?
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.