Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 560 invoked by uid 500); 22 Sep 2002 06:13:54 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 550 invoked by uid 500); 22 Sep 2002 06:13:54 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 22 Sep 2002 06:13:43 -0000 Message-ID: <20020922061343.16300.qmail@icarus.apache.org> From: gdaniels@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/java/src/org/apache/axis/wsdl/toJava JavaSkelWriter.java JavaDeployWriter.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N gdaniels 2002/09/21 23:13:42 Modified: java/src/org/apache/axis/description ServiceDesc.java java/src/org/apache/axis/i18n resource.properties java/src/org/apache/axis/wsdl/toJava JavaSkelWriter.java JavaDeployWriter.java Log: Throw a more informative exception when there's an operation in the WSDD/skeleton metadata which doesn't sync to a real Java Method. Make sure we don't write operation metadata for types we don't support (solicit/response, etc). Revision Changes Path 1.58 +12 -0 xml-axis/java/src/org/apache/axis/description/ServiceDesc.java Index: ServiceDesc.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/ServiceDesc.java,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- ServiceDesc.java 20 Sep 2002 14:29:52 -0000 1.57 +++ ServiceDesc.java 22 Sep 2002 06:13:42 -0000 1.58 @@ -720,6 +720,18 @@ } loadServiceDescByIntrospectionRecursive(implClass); + + // All operations should now be synchronized. Check it. + for (Iterator iterator = operations.iterator(); iterator.hasNext();) { + OperationDesc operation = (OperationDesc) iterator.next(); + if (operation.getMethod() == null) { + throw new InternalException( + Messages.getMessage("badWSDDOperation", + operation.getName(), + "" + operation.getNumParams())); + } + } + introspectionComplete = true; } 1.3 +2 -0 xml-axis/java/src/org/apache/axis/i18n/resource.properties Index: resource.properties =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/i18n/resource.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- resource.properties 22 Sep 2002 01:31:36 -0000 1.2 +++ resource.properties 22 Sep 2002 06:13:42 -0000 1.3 @@ -1021,3 +1021,5 @@ unabletoLoadMessages00=Unable to load messages! unabletoDeployTypemapping00=Unable to deploy typemapping: {0} + +badWSDDOperation=Couldn''t find a matching Java operation for WSDD operation "{0}" ({1} args) 1.49 +16 -8 xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaSkelWriter.java Index: JavaSkelWriter.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaSkelWriter.java,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- JavaSkelWriter.java 18 Sep 2002 16:10:36 -0000 1.48 +++ JavaSkelWriter.java 22 Sep 2002 06:13:42 -0000 1.49 @@ -79,7 +79,6 @@ import org.apache.axis.wsdl.symbolTable.Parameters; import org.apache.axis.wsdl.symbolTable.SymbolTable; -import org.apache.axis.utils.JavaUtils; import org.apache.axis.utils.Messages; /** @@ -145,13 +144,22 @@ pw.println(" org.apache.axis.description.ParameterDesc [] _params;"); List operations = binding.getBindingOperations(); for (int i = 0; i < operations.size(); ++i) { - BindingOperation operation = (BindingOperation) operations.get(i); + BindingOperation bindingOper = (BindingOperation) operations.get(i); + Operation operation = bindingOper.getOperation(); + OperationType type = operation.getStyle(); + // These operation types are not supported. The signature + // will be a string stating that fact. + if (type == OperationType.NOTIFICATION + || type == OperationType.SOLICIT_RESPONSE) { + continue; + } + Parameters parameters = - bEntry.getParameters(operation.getOperation()); + bEntry.getParameters(bindingOper.getOperation()); if (parameters != null) { - // The invoked java name of the operation is stored. - String opName = operation.getOperation().getName(); + // The invoked java name of the bindingOper is stored. + String opName = bindingOper.getOperation().getName(); String javaOpName = Utils.xmlNameToJava(opName); pw.println(" _params = new org.apache.axis.description.ParameterDesc [] {"); @@ -212,14 +220,14 @@ // If we need to know the QName (if we have a namespace or // the actual method name doesn't match the XML we expect), // record it in the OperationDesc - QName elementQName = Utils.getOperationQName(operation); + QName elementQName = Utils.getOperationQName(bindingOper); if (elementQName != null) { pw.println(" _oper.setElementQName(" + Utils.getNewQName(elementQName) + ");"); } // Find the SOAPAction. - List elems = operation.getExtensibilityElements(); + List elems = bindingOper.getExtensibilityElements(); Iterator it = elems.iterator(); boolean found = false; while (!found && it.hasNext()) { @@ -326,7 +334,7 @@ Parameters parms, String soapAction, String namespace - ) throws IOException { + ) { writeComment(pw, operation.getDocumentationElement()); // The skeleton used to have specialized operation signatures. 1.64 +5 -3 xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java Index: JavaDeployWriter.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- JavaDeployWriter.java 18 Sep 2002 16:10:36 -0000 1.63 +++ JavaDeployWriter.java 22 Sep 2002 06:13:42 -0000 1.64 @@ -345,10 +345,12 @@ // These operation types are not supported. The signature // will be a string stating that fact. - if (type != OperationType.NOTIFICATION - && type != OperationType.SOLICIT_RESPONSE) { - methodList = methodList + " " + javaOperName; + if (type == OperationType.NOTIFICATION + || type == OperationType.SOLICIT_RESPONSE) { + continue; } + + methodList = methodList + " " + javaOperName; // We pass "" as the namespace argument because we're just // interested in the return type for now.