|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MBv6.0 JCN, MbElement,XMLNSC,not able to get right outmesage |
« View previous topic :: View next topic » |
Author |
Message
|
s_wbi_s |
Posted: Sun Sep 24, 2006 3:07 am Post subject: MBv6.0 JCN, MbElement,XMLNSC,not able to get right outmesage |
|
|
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 |
|
 |
jefflowrey |
Posted: Sun Sep 24, 2006 4:14 am Post subject: |
|
|
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 |
|
 |
s_wbi_s |
Posted: Sun Sep 24, 2006 6:38 am Post subject: Flow Engine got terminated at that point. |
|
|
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 |
|
 |
s_wbi_s |
Posted: Sun Sep 24, 2006 6:48 am Post subject: [b]outMessage.getRootElement().getLastChild().copyElementTre |
|
|
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 |
|
 |
kimbert |
Posted: Mon Sep 25, 2006 12:53 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|