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 » XML Namespace behaviour in IIB

Post new topic  Reply to topic
 XML Namespace behaviour in IIB « View previous topic :: View next topic » 
Author Message
kash3338
PostPosted: Tue May 23, 2017 9:28 am    Post subject: XML Namespace behaviour in IIB Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

Hi all,

We are migrating code from WMB v6.0 to IIB v9.0. The code is migrated using the Toolkit. We faced the below scenario when testing one of the services.

The message was tested in WMB v6 and IIB v9 versions. The response XML of the service has "Multiple prefix with same namespace", for example,
Code:
<NS1:Response xmlns:NS1="http://www.xyz.com/sample" xmlns:NS2="http://www.xyz.com/sample">


When we test the code in WMB v6, we get below kind of response,
Code:

<NS1:Response xmlns:NS1="http://www.xyz.com/sample" xmlns:NS2="http://www.xyz.com/sample">
   <NS1:Details>
            <NS1:ele>
               <NS1:ID System="abc">1457833066</NS1:ID>               
               <NS1:Type>DDD</NS1:Type>
         </NS1:ele>
   </NS1:Details>
</NS1:Response>


The same when tested with IIB v9, we get,
Code:

<NS2:Response xmlns:NS1="http://www.xyz.com/sample" xmlns:NS2="http://www.xyz.com/sample">
   <NS2:Details>
            <NS2:ele>
               <NS2:ID System="abc">1457833066</NS2:ID>               
               <NS2:Type>DDD</NS2:Type>
         </NS2:ele>
   </NS2:Details>
</NS2:Response>


The Namespace prefix coming in response is different in both environments. There is no code difference in both the environments. What could be the reason for this difference? This is not a problem/issue for the overall result, but why is it we see a difference? Is the parsing any different?
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue May 23, 2017 10:14 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Why do you have two namespace declarations for the same namespace?
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
kash3338
PostPosted: Tue May 23, 2017 9:15 pm    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

mqjeff wrote:
Why do you have two namespace declarations for the same namespace?


This is some 15 years old code. No idea why they had declared twice, we don't see any valid reason for that from the code analysis. We are just migrating the code and came across this scenario. We can change the code and move forward, but this namespace declaration is done on a common procedure.
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Wed May 24, 2017 11:14 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

If the two prefixes are associated with the same url then it doesn't matter which one is used. I suspect that the parser uses a hashmap to store the prefix-to-namespace mappings and it's not fussy about which of the two alternatives gets selected.
FWIW, I suspect that you could easily get different results from v6 on two different machines.
Back to top
View user's profile Send private message
kash3338
PostPosted: Tue Jun 06, 2017 9:33 pm    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

timber wrote:
If the two prefixes are associated with the same url then it doesn't matter which one is used.

Agreed!

timber wrote:
I suspect that the parser uses a hashmap to store the prefix-to-namespace mappings and it's not fussy about which of the two alternatives gets selected.
FWIW, I suspect that you could easily get different results from v6 on two different machines.

Looks like this is true for IIB. We see different namespaces when tried in different Brokers. But for WMB v6, its always one namespace. Is this something only specific to IIB? May be this Hasmap mapping is done only on the new version?
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Jun 07, 2017 3:07 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

... was the old code running on v6 using the XMLNS parser?
Did you switch it in the new code to use the XMLNSC parser?

That would be the right thing to do, and would also explain the differences...
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
kash3338
PostPosted: Wed Jun 07, 2017 8:54 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

mqjeff wrote:
... was the old code running on v6 using the XMLNS parser?
Did you switch it in the new code to use the XMLNSC parser?

That would be the right thing to do, and would also explain the differences...


No. Both running on XMLNSC. Same code runs in both environments, no differences.
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 » XML Namespace behaviour in IIB
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.