Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 12996 invoked from network); 27 Jun 2006 00:30:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Jun 2006 00:30:13 -0000 Received: (qmail 54440 invoked by uid 500); 27 Jun 2006 00:30:06 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 54395 invoked by uid 500); 27 Jun 2006 00:30:05 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 54383 invoked by uid 99); 27 Jun 2006 00:30:05 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jun 2006 17:30:05 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jun 2006 17:30:04 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9CB55410123 for ; Tue, 27 Jun 2006 00:28:31 +0000 (GMT) Message-ID: <18629126.1151368111639.JavaMail.jira@brutus> Date: Tue, 27 Jun 2006 00:28:31 +0000 (GMT+00:00) From: "Marc Gagnon (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Updated: (AXIS2-829) WSDL service builder fails to see service definition when it comes from an import In-Reply-To: <8130423.1150690889873.JavaMail.jira@brutus> 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/AXIS2-829?page=all ] Marc Gagnon updated AXIS2-829: ------------------------------ Attachment: wsdl.zip Sample WSDL with ant files: First level WSDL does not define the service which is in imported WSDL. > WSDL service builder fails to see service definition when it comes from an import > --------------------------------------------------------------------------------- > > Key: AXIS2-829 > URL: http://issues.apache.org/jira/browse/AXIS2-829 > Project: Apache Axis 2.0 (Axis2) > Type: Bug > Components: core > Versions: 1.0 > Reporter: Marc Gagnon > Assignee: Deepal Jayasinghe > Attachments: wsdl.zip > > When the service element of a WSDL is not in the first level file, there is an exception like this: > [java] Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL > [java] at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.(CodeGenerationEngine.java:94) > [java] at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32) > [java] at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21) > [java] Caused by: org.apache.axis2.AxisFault: No service element found in the WSDL; nested exception is: > [java] org.apache.axis2.AxisFault: No service element found in the WSDL > [java] at org.apache.axis2.description.WSDL2AxisServiceBuilder.populateService(WSDL2AxisServiceBuilder.java:243) > [java] at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.(CodeGenerationEngine.java:87) > I am pretty sure the spec allows services definitions to be imported. > The book from which I am learning web services has a specific example using this way of organizing WSDL (J2EE Web Services by Richard Monson-Haefel, page 136 : 5.2.4). > So, assuming service definitions of imported WSDL should be visible, here is my patch: > The reason for this problem is that the code in WSDL2AxisServiceBuilder method processImports does not recursively include the services in the current level's hash map: > ... > //add messages > Map messagesMap = importedDef.getMessages(); > wsdl4JDefinition.getMessages().putAll(messagesMap); > //add portypes > Map porttypeMap = importedDef.getPortTypes(); > wsdl4JDefinition.getPortTypes().putAll(porttypeMap); > //add bindings > Map bindingMap = importedDef.getBindings(); > wsdl4JDefinition.getBindings().putAll(bindingMap); > //------------------------------------------------------------------------------------------------ > // Must add services of imported definitions into current wsdl definitions. > //------------------------------------------------------------------------------------------------- > } > ... > I simply added: > //add services > Map serviceMap = importedDef.getServices(); > wsdl4JDefinition.getServices().putAll(serviceMap); > And it worked. > I tested this using on the refactored version: WSDL11ToAxisServiceBuilder > Here is the patch: > Index: WSDL11ToAxisServiceBuilder.java > =================================================================== > --- WSDL11ToAxisServiceBuilder.java (revision 415081) > +++ WSDL11ToAxisServiceBuilder.java (working copy) > @@ -916,6 +916,9 @@ > Map bindingMap = importedDef.getBindings(); > wsdl4JDefinition.getBindings().putAll(bindingMap); > > + //add services > + Map serviceMap = importedDef.getServices(); > + wsdl4JDefinition.getServices().putAll(serviceMap); > } > > } -- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org