Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 57517 invoked from network); 23 Jun 2005 04:48:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Jun 2005 04:48:20 -0000 Received: (qmail 96729 invoked by uid 500); 23 Jun 2005 04:48:12 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 96662 invoked by uid 500); 23 Jun 2005 04:48:12 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 96338 invoked by uid 99); 23 Jun 2005 04:48:11 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2005 21:48:10 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id B20EC16 for ; Thu, 23 Jun 2005 06:48:09 +0200 (CEST) Message-ID: <1623346111.1119502089728.JavaMail.jira@ajax.apache.org> Date: Thu, 23 Jun 2005 06:48:09 +0200 (CEST) From: "Ivan Dubrov (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Updated: (GERONIMO-684) Wrapped document/literal do not work for empty message parts In-Reply-To: <1238832193.1119501429923.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/GERONIMO-684?page=all ] Ivan Dubrov updated GERONIMO-684: --------------------------------- Description: If WSDL contains message parts with empty XML type, NullPointerException is thrown during the deployment. Here is the relevant pieces from the WSDL: Piece from the schema embedded in the WSDL: Snippet from the WSDL: The attached patch shows the possible solution: Note that problem is that operationType.getContentModel() in the line HeavyweightOperationDescBuilder.java:231 returns null if it consists of one empty sequence. If check is added, everything works fine. was: If WSDL contains message parts with empty XML type, NullPointerException is thrown during the deployment. Here is the relevant pieces from the WSDL: Piece from the schema embedded in the WSDL: Snippet from the WSDL: The following patch shows the possible solution: Index: HeavyweightOperationDescBuilder.java =================================================================== --- HeavyweightOperationDescBuilder.java (revision 190889) +++ HeavyweightOperationDescBuilder.java (working copy) @@ -229,14 +229,17 @@ // schemaType should be complex using xsd:sequence compositor SchemaParticle parametersType = operationType.getContentModel(); - if (SchemaParticle.ELEMENT == parametersType.getParticleType()) { - expectedInParams.add(parametersType.getName().getLocalPart()); - } else if (SchemaParticle.SEQUENCE == parametersType.getParticleType()) { - SchemaParticle[] parameters = parametersType.getParticleChildren(); - for (int i = 0; i < parameters.length; i++) { - expectedInParams.add(parameters[i].getName().getLocalPart()); - } - } + // check if parameters are exist + if(parametersType != null) { + if (SchemaParticle.ELEMENT == parametersType.getParticleType()) { + expectedInParams.add(parametersType.getName().getLocalPart()); + } else if (SchemaParticle.SEQUENCE == parametersType.getParticleType()) { + SchemaParticle[] parameters = parametersType.getParticleChildren(); + for (int i = 0; i < parameters.length; i++) { + expectedInParams.add(parameters[i].getName().getLocalPart()); + } + } + } if (!inParamNames.equals(expectedInParams)) { throw new DeploymentException("Not all wrapper children were mapped for operation name" + operationName); } @@ -297,14 +300,17 @@ // schemaType should be complex using xsd:sequence compositor SchemaParticle parametersType = operationType.getContentModel(); - if (SchemaParticle.ELEMENT == parametersType.getParticleType()) { - expectedOutParams.add(parametersType.getName().getLocalPart()); - } else if (SchemaParticle.SEQUENCE == parametersType.getParticleType()) { - SchemaParticle[] parameters = parametersType.getParticleChildren(); - for (int i = 0; i < parameters.length; i++) { - expectedOutParams.add(parameters[i].getName().getLocalPart()); - } - } + // check result exists + if(parametersType != null) { + if (SchemaParticle.ELEMENT == parametersType.getParticleType()) { + expectedOutParams.add(parametersType.getName().getLocalPart()); + } else if (SchemaParticle.SEQUENCE == parametersType.getParticleType()) { + SchemaParticle[] parameters = parametersType.getParticleChildren(); + for (int i = 0; i < parameters.length; i++) { + expectedOutParams.add(parameters[i].getName().getLocalPart()); + } + } + } if (!outParamNames.equals(expectedOutParams)) { throw new DeploymentException("Not all wrapper children were mapped to parameters or a return value for operation " + operationName); } Note that problem is that operationType.getContentModel() returns null if it consists of one empty sequence. If check is added, everything works fine. > Wrapped document/literal do not work for empty message parts > ------------------------------------------------------------ > > Key: GERONIMO-684 > URL: http://issues.apache.org/jira/browse/GERONIMO-684 > Project: Geronimo > Type: Bug > Components: webservices > Versions: 1.0-M4 > Reporter: Ivan Dubrov > Attachments: patch2 > > If WSDL contains message parts with empty XML type, NullPointerException is thrown during the deployment. > Here is the relevant pieces from the WSDL: > Piece from the schema embedded in the WSDL: > > > > > Snippet from the WSDL: > > > > The attached patch shows the possible solution: > Note that problem is that operationType.getContentModel() in the line HeavyweightOperationDescBuilder.java:231 returns null if it consists of one empty sequence. If check is added, everything works fine. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira