diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2012-01-26 12:05:41 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2012-01-26 12:05:41 +0000 |
commit | 878a3082147a778422c60bcd3586e2423002a6ea (patch) | |
tree | 23881f064f34395a15a8ea0cc633454ac9484b78 /sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java | |
parent | 12034483696479a360d0f0f0ad6b9ed7f30d8413 (diff) |
Update the JMS Axiom XML helper to create more correct wrapper elements
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1236153 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/xml/AXIOMXMLHelper.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/xml/AXIOMXMLHelper.java b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/xml/AXIOMXMLHelper.java index ebdf227145..4e71fd21f0 100644 --- a/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/xml/AXIOMXMLHelper.java +++ b/sca-java-2.x/trunk/modules/binding-jms-runtime/src/main/java/org/apache/tuscany/sca/binding/jms/provider/xml/AXIOMXMLHelper.java @@ -67,21 +67,20 @@ public class AXIOMXMLHelper implements XMLHelper<OMElement> { @Override
public Object wrap(OMElement template, OMElement os) {
- OMElement newWrapper = template.cloneOMElement();
+ OMElement wrapper;
if (os != null) {
- os.declareDefaultNamespace(newWrapper.getNamespace().getNamespaceURI());
- newWrapper.addChild(os);
+ OMNamespace ns = os.declareNamespace(template.getNamespace().getNamespaceURI(), "");
+ wrapper = factory.createOMElement(template.getLocalName(), ns);
+ wrapper.addChild(os);
+ } else {
+ wrapper = template.cloneOMElement();
}
- return newWrapper;
+ return wrapper;
}
@Override
public OMElement createWrapper(QName qname) {
- // The OMElement2JAXB transformer wants the opName to be capitalized
- String opName = Character.toUpperCase(qname.getLocalPart().charAt(0)) + (qname.getLocalPart().length() > 1 ? qname.getLocalPart().substring(1) : "");
- OMElement om = factory.createOMElement(qname);
- OMNamespace defaultNS = om.declareDefaultNamespace(qname.getNamespaceURI());
- return factory.createOMElement(opName, defaultNS);
+ return factory.createOMElement(qname);
}
@Override
|