diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-24 08:55:02 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-24 08:55:02 +0000 |
commit | 6dc3ffc802dad9e4ad1e9e7e44dd11a000f4a0c7 (patch) | |
tree | 43d7eba6dc5b3c70d66f8c83370eb7098bcabce0 /sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws | |
parent | 2a9398411bc3b469d3ec3e5d5276033f58b1cf15 (diff) |
Replace weather forcast sample with simple helloworld sample. Update the binding with the minimum changes to get this sample working.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@926981 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws')
3 files changed, 10 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java b/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java index ecb3b4f87b..920b9c43fc 100644 --- a/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java +++ b/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSBindingInvoker.java @@ -46,6 +46,7 @@ import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.DataExchangeSemantics; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.invocation.Message; +import org.w3c.dom.Document; import org.w3c.dom.Node; /** @@ -159,7 +160,11 @@ public class JAXWSBindingInvoker implements Invoker, DataExchangeSemantics { javax.xml.soap.SOAPEnvelope envelope = soapPart.getEnvelope(); javax.xml.soap.SOAPBody body = envelope.getBody(); Object[] args = (Object[])msg.getBody(); - body.addDocument(((Node)args[0]).getOwnerDocument()); + // In the unit test the owner doc is null + // so explicitly adopt the node instead + //body.addDocument(((Node)args[0]).getOwnerDocument()); + Node msgNode = body.getOwnerDocument().importNode((Node)args[0], true); + body.appendChild(msgNode); soapMessage.saveChanges(); if (operation.isNonBlocking()) { dispatch.invokeOneWay(soapMessage); diff --git a/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSReferenceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSReferenceBindingProvider.java index b8ff7ce475..99a297e074 100644 --- a/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSReferenceBindingProvider.java +++ b/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSReferenceBindingProvider.java @@ -46,7 +46,7 @@ public class JAXWSReferenceBindingProvider implements ReferenceBindingProvider { throw new ServiceRuntimeException("No WSDL document for " + endpointReference.getURI()); } - // Set to use the Axiom data binding + // Set to use the DOM data binding InterfaceContract contract = wsBinding.getBindingInterfaceContract(); if (contract.getInterface() != null) { contract.getInterface().resetDataBinding(Node.class.getName()); diff --git a/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSServiceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSServiceBindingProvider.java index 2be6963e15..95e64f5ad2 100644 --- a/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSServiceBindingProvider.java +++ b/sca-java-2.x/trunk/modules/binding-ws-runtime-jaxws/src/main/java/org/apache/tuscany/sca/binding/ws/jaxws/JAXWSServiceBindingProvider.java @@ -77,7 +77,7 @@ public class JAXWSServiceBindingProvider implements ServiceBindingProvider, Prov throw new ServiceRuntimeException("No WSDL document for " + endpoint.getURI()); } - // Set to use the Axiom data binding + // Set to use the DOM data binding InterfaceContract contract = wsBinding.getBindingInterfaceContract(); contract.getInterface().resetDataBinding(Node.class.getName()); @@ -117,7 +117,8 @@ public class JAXWSServiceBindingProvider implements ServiceBindingProvider, Prov } Message requestMsg = messageFactory.createMessage(); - requestMsg.setBody(root); + Object[] body = new Object[]{root}; + requestMsg.setBody(body); requestMsg.setOperation(operation); Message responseMsg = endpoint.invoke(operation, requestMsg); Element element = responseMsg.getBody(); |