From cf52969d8a2d48928f1caaa8b0e6e2aa0074e7ed Mon Sep 17 00:00:00 2001 From: ramkumar Date: Tue, 12 May 2009 08:47:30 +0000 Subject: Fix for TUSCANY-2962 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@773823 13f79535-47bb-0310-9956-ffa450edef68 --- .../interfacedef/wsdl/xml/WSDLInterfaceProcessor.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml') diff --git a/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java b/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java index 11cff6658f..3ad2da4205 100644 --- a/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java +++ b/branches/sca-java-1.x/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java @@ -21,6 +21,7 @@ package org.apache.tuscany.sca.interfacedef.wsdl.xml; import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; +import java.util.List; import javax.wsdl.PortType; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; @@ -45,9 +46,11 @@ import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract; import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject; +import org.apache.tuscany.sca.interfacedef.wsdl.impl.WSDLOperationImpl; import org.apache.tuscany.sca.monitor.Monitor; import org.apache.tuscany.sca.monitor.Problem; import org.apache.tuscany.sca.monitor.Problem.Severity; +import com.ibm.wsdl.OperationImpl; /** * @@ -251,7 +254,21 @@ public class WSDLInterfaceProcessor implements StAXArtifactProcessor portType = wsdlDefinition.getWSDLObject(PortType.class, wsdlInterface.getName()); - if (portType != null) { + if (portType != null) { + // Introspect the WSDL portType and validate + // the input/output messages. + List operations = portType.getElement().getOperations(); + for (OperationImpl operation : operations) { + if (operation.getInput().getMessage() == null) { + ContributionResolveException ce = new ContributionResolveException("WSDL binding operation input name " + operation.getInput().getName() + " does not match with PortType Definition"); + error("ContributionResolveException", wsdlDefinition, ce); + } + if (operation.getOutput().getMessage() == null) { + ContributionResolveException ce = new ContributionResolveException("WSDL binding operation output name " + operation.getOutput().getName() + " does not match with PortType Definition"); + error("ContributionResolveException", wsdlDefinition, ce); + } + } + // Introspect the WSDL portType and add the resulting // WSDLInterface to the resolver try { -- cgit v1.2.3