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 » MBv6.0 JCN, MbElement,XMLNSC,not able to get right outmesage

Post new topic  Reply to topic
 MBv6.0 JCN, MbElement,XMLNSC,not able to get right outmesage « View previous topic :: View next topic » 
Author Message
s_wbi_s
PostPosted: Sun Sep 24, 2006 3:07 am    Post subject: MBv6.0 JCN, MbElement,XMLNSC,not able to get right outmesage Reply with quote

Newbie

Joined: 17 Jul 2006
Posts: 6

Hi, Here is the code I tried to get a response.

MbElement accesgePolicyXml = accessEnvrnmentElement.getFirstElementByPath("PolicyXML");

MbElement MbEpolicyXml1stChild = accesgePolicyXml.getFirstChild();
MbElement MbEdynamicDomains = MbEpolicyXml1stChild.getFirstChild().getNextSibling().getNextSibling().createElementAfter(MbElement.TYPE_NAME,"DynamicDomains",null);

MbEdynamicDomains.setNamespace(accesgePolicyXml.getNamespace());

//Detaching HttpRequest Header and AH Webservice Response Message
outMessage.getRootElement().getLastChild().detach();
outMessage.getRootElement().getLastChild().detach();

// Storing Reference of MQMD And PolicyXML into out message
outMessage.getRootElement().addAsLastChild(accesgeMQMD.getFirstChild().copy());
MbElement outRoot = outMessage.getRootElement().createElementAsLastChild("XMLNSC");
outMessage.getRootElement().getLastChild().addAsLastChild(accesgePolicyXml.copy());

out.propagate(globelassembly);
}

I'm getting a response as per the above code:
- <PolicyXML>
- <n1:AscendantOne xmlns:n1="http://xmlschema.ascendanttsi.com/schemas/ascendantone" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <DynamicDomains>
+ <Policy type="system" description="Policy" offset="Added" NextTransaction="2">
</Policy>
<?AORuntimeSessionId B8DDD9FE-4F5C-4AB4-87BC-B2615580F617?>
<?AORuntimePageName AORuntime.asp?>
<?AORuntimeUserName i62748?>
+ <Resources>
</n1:AscendantOne>
</PolicyXML>

But
I should get the following response:
<?xml version="1.0" encoding="UTF-8" ?>
- <n1:AscendantOne xmlns:n1="http://xmlschema.ascendanttsi.com/schemas/ascendantone" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <DynamicDomains>
+ <Policy type="system" description="Policy" offset="Added" NextTransaction="2">
<?AORuntimeSessionId B8DDD9FE-4F5C-4AB4-87BC-B2615580F617?>
<?AORuntimePageName AORuntime.asp?>
<?AORuntimeUserName i62748?>
+ <Resources>
</n1:AscendantOne>

Please let me if any clues to meet my requirements.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sun Sep 24, 2006 4:14 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If I understand what you're trying to do - you're trying to un-nest the AscendantOne element from the PolicyXML element - then I think you should change
Code:

outMessage.getRootElement().getLastChild().addAsLastChild(accesgePolicyXml.copy());

to
Code:

outMessage.getRootElement().getLastChild().addAsLastChild(MbEpolicyXml1stChild.copy());

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
s_wbi_s
PostPosted: Sun Sep 24, 2006 6:38 am    Post subject: Flow Engine got terminated at that point. Reply with quote

Newbie

Joined: 17 Jul 2006
Posts: 6

Even I tried with this code:

outMessage.getRootElement().getLastChild().addAsLastChild(MbEpolicyXml1stChild.copy());

Flow Engine got terminated at that point.
Back to top
View user's profile Send private message
s_wbi_s
PostPosted: Sun Sep 24, 2006 6:48 am    Post subject: [b]outMessage.getRootElement().getLastChild().copyElementTre Reply with quote

Newbie

Joined: 17 Jul 2006
Posts: 6

If I go with this code,

outMessage.getRootElement().getLastChild().copyElementTree(accesgePolicyXml);
I'm able to get outmessage, but its coming with NS1 as below:

<NS1:AscendantOne xmlns:NS1="http://xmlschema.ascendanttsi.com/schemas/ascendantone">
<NS2:n1 xmlns:NS2="http://www.w3.org/2000/xmlns/">http://xmlschema.ascendanttsi.com/schemas/ascendantone</NS2:n1>
<NS3:xsi xmlns:NS3="http://www.w3.org/2000/xmlns/">http://www.w3.org/2001/XMLSchema-instance</NS3:xsi>
<DynamicDomains>
</DynamicDomains>
<Policy>
</Policy>
<AORuntimeSessionId>B8DDD9FE-4F5C-4AB4-87BC-B2615580F617</AORuntimeSessionId>
<AORuntimePageName>AORuntime.asp</AORuntimePageName>
<AORuntimeUserName>i62748</AORuntimeUserName>
<Resources>
</Resources>
</NS1:AscendantOne>
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Sep 25, 2006 12:53 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
but its coming with NS1 as below
That's easy to fix. Copy ( or create ) the xmlns attribute for namespace 'http://xmlschema.ascendanttsi.com/schemas/ascendantone' before you serialize the message.
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 » MBv6.0 JCN, MbElement,XMLNSC,not able to get right outmesage
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.