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 » Namespace defaulting

Post new topic  Reply to topic
 Namespace defaulting « View previous topic :: View next topic » 
Author Message
mbsa
PostPosted: Thu Apr 17, 2014 12:21 pm    Post subject: Namespace defaulting Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

Hello ,
I am using wmb 7.0.

i am declaring a NS as
Code:


DECLARE SVar SHARED ROW;
DECLARE hns NAMESPACE 'urn:com/uts/services/Aderhead';

SET OutputRoot.XMLNSC.hns:Root = SVar.XMLNSC.hns:Root;

The output i am getting as
Code:

<?xml version="1.0" encoding="UTF-8"?>
<NS1:Root xmlns:NS1="urn:com/uts/services/Aderhead">
   <NS1:CorrespondenceRequest>
      <NS1:requestDetails>


why the NS is NS1 instead of hns?
How do i get it to be hns?
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Apr 17, 2014 2:23 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You need to add a namespace declaration into OutputRoot.XMLNSC. The ESQL constant only affects your ESQL code - not the XML output.

Search for 'XMLNSC namespace declaration' in the info center.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
mbsa
PostPosted: Fri Apr 18, 2014 4:13 am    Post subject: Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

Thanks for the reply. I do have namespace declaration into OutputRoot.XMLNSC.
Code:


DECLARE SVar SHARED ROW;
DECLARE hns NAMESPACE 'urn:com/uts/services/Aderhead';


SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Version  = '1.0';
      SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding = 'UTF-8';
      SET OutputRoot.XMLNSC.hns:Root.(XMLNSC.NamespaceDecl)xmlns:hns ='urn:com/uts/services/Aderhead';
 
SET OutputRoot.XMLNSC.hns:Root = SVar.XMLNSC.hns:Root;



Still the output is
Code:

<?xml version="1.0" encoding="UTF-8"?>
<NS1:Root xmlns:NS1="urn:com/uts/services/Aderhead">
   <NS1:CorrespondenceRequest>
      <NS1:requestDetails>
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Apr 18, 2014 4:53 am    Post subject: Reply with quote

Grand High Poobah

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

mbsa wrote:
Thanks for the reply. I do have namespace declaration into OutputRoot.XMLNSC.
Code:


DECLARE SVar SHARED ROW;
DECLARE hns NAMESPACE 'urn:com/uts/services/Aderhead';


SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Version  = '1.0';
      SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding = 'UTF-8';
      SET OutputRoot.XMLNSC.hns:Root.(XMLNSC.NamespaceDecl)xmlns:hns ='urn:com/uts/services/Aderhead';
 
SET OutputRoot.XMLNSC.hns:Root = SVar.XMLNSC.hns:Root;



Still the output is
Code:

<?xml version="1.0" encoding="UTF-8"?>
<NS1:Root xmlns:NS1="urn:com/uts/services/Aderhead">
   <NS1:CorrespondenceRequest>
      <NS1:requestDetails>


your hns is ambiguous....
Have you tried
Code:
SET OutputRoot.XMLNSC.hns:Root.(XMLNSC.NamespaceDecl)xmlns:"hns" ='urn:com/uts/services/Aderhead';

Note the quotes around hns in the declaration...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mbsa
PostPosted: Fri Apr 18, 2014 6:51 am    Post subject: Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

I used this code

Code:

SET OutputRoot.XMLNSC.hns:Root.(XMLNSC.NamespaceDecl)xmlns:"hns" ='urn:com/uts/services/Aderhead';


But still the same response

Code:

<?xml version="1.0" encoding="UTF-8"?>
<NS1:Root xmlns:NS1="urn:com/aes/services/thunderhead">
 <NS1:CorrespondenceRequest>
  <NS1:requestDetails>
[/code]
Back to top
View user's profile Send private message
Tibor
PostPosted: Fri Apr 18, 2014 7:31 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

"hns" is only the name of your namespace variable, not a label. That's why it is simply substituted with NS1, NS2, etc. Please check again what kimbert wrote you.

Anyway, what is the problem with the output XML? Based on the standard, it is correct for a namespace aware XML parser.
Back to top
View user's profile Send private message
mbsa
PostPosted: Fri Apr 18, 2014 8:57 am    Post subject: Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

Tibor,

There is no issue with the xml.

The target application wants the namespace to be "hns" only.

Can you be more specific about the label you mentioned before.Thanks.
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Apr 18, 2014 12:57 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

The ESQL that your flow is executing is not the ESQL that you have posted. Redeploy, and try again.

If you still cannot make it work then create a test flow containing an MQInput node and a Trace node. Parse the XML that you want to create, and look at the Trace node output. Then adjust your message flow until it creates exactly the same message tree.
_________________
Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too.
Back to top
View user's profile Send private message
mbsa
PostPosted: Tue Apr 22, 2014 4:21 am    Post subject: Reply with quote

Apprentice

Joined: 04 Mar 2013
Posts: 41

I got the correct NS. The issue was after building the NS in the Root i was overlapping it with the tree structure in my shared variables. That was the reason why it is taking the default NS1.
Code:

SET OutputRoot.XMLNSC.hns:Root = SVar.XMLNSC.hns:Root;


Code:

SET OutputRoot.XMLNSC.hns:Root.hns:HR = SVar.XMLNSC.hns:Root.hns:HR ;

Thanks for all the replies.
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 » Namespace defaulting
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.