diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-29 01:09:22 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2008-09-29 01:09:22 +0000 |
commit | 49083619a0d9527d8797901735efac31bb3bcf5f (patch) | |
tree | 0b3dffa0b51e76b68d8d9f42164e6be583e6f670 /branches/sca-equinox/modules/binding-sca-corba | |
parent | 04ef75e0a7e0e5928a90ca53a686665c2c634573 (diff) |
Merged from trunk. Upgrade to Axis2 1.4.1 and its transitive dependencies such as XmlSchema and Axiom based on the patches from Ram for TUSCANY-2606
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@699937 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-equinox/modules/binding-sca-corba')
2 files changed, 19 insertions, 4 deletions
diff --git a/branches/sca-equinox/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java b/branches/sca-equinox/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java index ed0c170b0d..6c742e3e00 100644 --- a/branches/sca-equinox/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java +++ b/branches/sca-equinox/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvocationProxy.java @@ -69,7 +69,7 @@ public class CorbaSCAInvocationProxy implements InvocationProxy { public Object invoke(String operationName, List<Object> arguments) throws InvocationException { try { - OMElement omContent = AXIOMUtil.stringToOM((String)arguments.get(0)); + OMElement omContent = CorbaSCAInvoker.stringToOM((String)arguments.get(0)); String componentOperationName = omContent.getQName().getLocalPart(); Operation componentOperation = null; for (Operation operation : componentInterface.getOperations()) { diff --git a/branches/sca-equinox/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvoker.java b/branches/sca-equinox/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvoker.java index 26b1c9e5d6..9132c5d3c8 100644 --- a/branches/sca-equinox/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvoker.java +++ b/branches/sca-equinox/modules/binding-sca-corba/src/main/java/org/apache/tuscany/sca/binding/sca/corba/impl/CorbaSCAInvoker.java @@ -19,13 +19,14 @@ package org.apache.tuscany.sca.binding.sca.corba.impl; +import java.io.ByteArrayInputStream; import java.lang.reflect.Method; import java.util.Map; import javax.xml.stream.XMLStreamException; import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.impl.llom.util.AXIOMUtil; +import org.apache.axiom.om.impl.builder.StAXOMBuilder; import org.apache.tuscany.sca.binding.corba.provider.exceptions.RequestConfigurationException; import org.apache.tuscany.sca.binding.corba.provider.reference.DynaCorbaRequest; import org.apache.tuscany.sca.binding.corba.provider.reference.DynaCorbaResponse; @@ -62,11 +63,11 @@ public class CorbaSCAInvoker implements Invoker { String arg = omElement.toStringWithConsume(); request.addArgument(arg); DynaCorbaResponse response = request.invoke(); - OMElement responseOM = AXIOMUtil.stringToOM((String)response.getContent()); + OMElement responseOM = stringToOM((String)response.getContent()); msg.setBody(responseOM); } catch (WrappedSCAException e) { try { - OMElement exceptionOM = AXIOMUtil.stringToOM(e.getFault()); + OMElement exceptionOM = stringToOM(e.getFault()); FaultException f = new FaultException(e.getMessage(), exceptionOM, e); f.setFaultName(exceptionOM.getQName()); msg.setFaultBody(f); @@ -79,4 +80,18 @@ public class CorbaSCAInvoker implements Invoker { } return msg; } + + /** + * This will help you to create an OMElement from an xml fragment which you have as a string. + * + * @param xmlFragment - the well-formed xml fragment + * @return The OMElement created out of the string xml fragment. + * @throws XMLStreamException + */ + static OMElement stringToOM(String xmlFragment) throws XMLStreamException { + if (xmlFragment != null) { + return new StAXOMBuilder(new ByteArrayInputStream(xmlFragment.getBytes())).getDocumentElement(); + } + return null; + } } |