diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-27 15:56:52 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-27 15:56:52 +0000 |
commit | 8163dd97c66fcd2efd56a54b2e8dd8f0ec163f9b (patch) | |
tree | 1654bdb9481fd7de7e924c586aa4ce7cd759ee32 /branches/sca-java-1.x/modules | |
parent | 89b26d7a562594ad04c9b7a84dd35b2be6d834ca (diff) |
Fix the ArrayOutofBoundException that causes the hang of itest/helloworld-bpel
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@769035 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules')
2 files changed, 21 insertions, 16 deletions
diff --git a/branches/sca-java-1.x/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java b/branches/sca-java-1.x/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java index 0d1dcd96f8..7b8ffdc787 100644 --- a/branches/sca-java-1.x/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java +++ b/branches/sca-java-1.x/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationInvoker.java @@ -124,7 +124,7 @@ public class JavaImplementationInvoker implements Invoker, DataExchangeSemantics Method imethod = method; if (imethod == null || !imethod.getDeclaringClass().isInstance(instance)) { try { - imethod = JavaInterfaceUtil.findMethod(instance.getClass(), operation); + imethod = JavaInterfaceUtil.findMethod(instance.getClass(), op); } catch (NoSuchMethodException e) { throw new IllegalArgumentException("Callback object does not provide method " + e.getMessage()); } @@ -134,10 +134,10 @@ public class JavaImplementationInvoker implements Invoker, DataExchangeSemantics // Holder pattern. Any payload parameters <T> which are should be in holders are placed in Holder<T>. // Only check Holder for remotable interfaces - if (imethod != null && op.getInterface().isRemotable()) { - List<DataType> inputTypes = op.getInputType().getLogical(); + if (imethod != null && operation.getInterface().isRemotable()) { + List<DataType> inputTypes = operation.getInputType().getLogical(); for (int i = 0, size = inputTypes.size(); i < size; i++) { - if (ParameterMode.IN != op.getParameterModes().get(i)) { + if (ParameterMode.IN != operation.getParameterModes().get(i)) { // Promote array params from [<T>] to [Holder<T>] Object[] payloadArray = (Object[])payload; for (int j = 0; payloadArray != null && j < payloadArray.length; j++) { @@ -169,9 +169,9 @@ public class JavaImplementationInvoker implements Invoker, DataExchangeSemantics // Holder pattern. Any payload Holder<T> types are returned as the message body. List returnArgs = new ArrayList<Object>(); if (imethod != null) { - for (int i = 0, size = op.getParameterModes().size(); i < size; i++) { + for (int i = 0, size = operation.getParameterModes().size(); i < size; i++) { // System.out.println( "JavaImplementationInvoker.invoke return parameter " + i + " type=" + parameter.getClass().getName() ); - if (ParameterMode.IN != op.getParameterModes().get(i)) { + if (ParameterMode.IN != operation.getParameterModes().get(i)) { // Demote array params from Holder<T> to <T>. Object[] payloadArray = (Object[])payload; for (int j = 0; j < payloadArray.length; j++) { @@ -195,7 +195,7 @@ public class JavaImplementationInvoker implements Invoker, DataExchangeSemantics } catch (InvocationTargetException e) { Throwable cause = e.getTargetException(); boolean isChecked = false; - for (DataType<?> d : operation.getFaultTypes()) { + for (DataType<?> d : op.getFaultTypes()) { if (d.getPhysical().isInstance(cause)) { isChecked = true; msg.setFaultBody(cause); diff --git a/branches/sca-java-1.x/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java b/branches/sca-java-1.x/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java index ba2e4b6ec0..19b14336f5 100644 --- a/branches/sca-java-1.x/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java +++ b/branches/sca-java-1.x/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java @@ -6,15 +6,15 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. + * under the License. */ package org.apache.tuscany.sca.interfacedef.wsdl.impl; @@ -38,6 +38,7 @@ import org.apache.tuscany.sca.contribution.resolver.ModelResolver; import org.apache.tuscany.sca.interfacedef.ConversationSequence; import org.apache.tuscany.sca.interfacedef.DataType; import org.apache.tuscany.sca.interfacedef.Operation; +import org.apache.tuscany.sca.interfacedef.ParameterMode; import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; import org.apache.tuscany.sca.interfacedef.util.ElementInfo; import org.apache.tuscany.sca.interfacedef.util.FaultException; @@ -46,9 +47,8 @@ import org.apache.tuscany.sca.interfacedef.util.WrapperInfo; import org.apache.tuscany.sca.interfacedef.util.XMLType; import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation; -import org.apache.tuscany.sca.xsd.XSDefinition; import org.apache.tuscany.sca.xsd.XSDFactory; - +import org.apache.tuscany.sca.xsd.XSDefinition; import org.apache.ws.commons.schema.XmlSchemaComplexType; import org.apache.ws.commons.schema.XmlSchemaElement; import org.apache.ws.commons.schema.XmlSchemaObject; @@ -60,7 +60,7 @@ import org.apache.ws.commons.schema.XmlSchemaType; /** * Metadata for a WSDL operation - * + * * @version $Rev$ $Date$ */ public class WSDLOperationIntrospectorImpl { @@ -105,7 +105,7 @@ public class WSDLOperationIntrospectorImpl { /** * Test if the operation qualifies wrapper style as defined by the JAX-WS * 2.0 Specification - * + * * @return true if the operation qualifies wrapper style, otherwise false */ public boolean isWrapperStyle() throws InvalidWSDLException { @@ -220,6 +220,11 @@ public class WSDLOperationIntrospectorImpl { operationModel.setInputType(getInputType()); operationModel.setOutputType(getOutputType()); + // FIXME: [rfeng] How to determine the parameter mode? + for (DataType d : operationModel.getInputType().getLogical()) { + operationModel.getParameterModes().add(ParameterMode.IN); + } + operationModel.setInputWrapperStyle(isWrapperStyle()); operationModel.setOutputWrapperStyle(isWrapperStyle()); if (isWrapperStyle()) { @@ -429,7 +434,7 @@ public class WSDLOperationIntrospectorImpl { /** * Return a list of child XSD elements under the wrapped request element - * + * * @return a list of child XSD elements or null if if the request * element is not wrapped */ @@ -471,7 +476,7 @@ public class WSDLOperationIntrospectorImpl { /** * Return a list of child XSD elements under the wrapped response * element - * + * * @return a list of child XSD elements or null if if the response * element is not wrapped */ |