Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 91687 invoked from network); 21 Aug 2007 08:34:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Aug 2007 08:34:50 -0000 Received: (qmail 32809 invoked by uid 500); 21 Aug 2007 08:34:47 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 32758 invoked by uid 500); 21 Aug 2007 08:34:47 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 32749 invoked by uid 99); 21 Aug 2007 08:34:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2007 01:34:47 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2007 08:34:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 127D31A981D; Tue, 21 Aug 2007 01:34:18 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r568021 - in /incubator/cxf/trunk: rt/core/src/main/java/org/apache/cxf/wsdl11/ tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/ tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdl... Date: Tue, 21 Aug 2007 08:34:17 -0000 To: cxf-commits@incubator.apache.org From: mmao@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070821083418.127D31A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mmao Date: Tue Aug 21 01:34:17 2007 New Revision: 568021 URL: http://svn.apache.org/viewvc?rev=568021&view=rev Log: If the services of the wsdl definition are located in it's imported wsdl Added: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/resources/build.wsdl Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java?rev=568021&r1=568020&r2=568021&view=diff ============================================================================== --- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java (original) +++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java Tue Aug 21 01:34:17 2007 @@ -27,6 +27,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.Set; import java.util.StringTokenizer; import java.util.logging.Level; import java.util.logging.Logger; @@ -113,6 +114,7 @@ return wsdlDefinition; } + @SuppressWarnings("unchecked") protected void parseWSDL(String wsdlURL) { try { @@ -123,6 +125,17 @@ wsdlDefinition = wsdlReader.readWSDL(wsdlLocator); parseImports(wsdlDefinition); + + if (wsdlDefinition.getServices().isEmpty()) { + for (Definition def : importedDefinitions) { + Set services = def.getServices().keySet(); + for (QName sName : services) { + if (!wsdlDefinition.getServices().keySet().contains(sName)) { + wsdlDefinition.getServices().put(sName, def.getService(sName)); + } + } + } + } } catch (Exception we) { Message msg = new Message("FAIL_TO_CREATE_WSDL_DEFINITION", LOG, Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java?rev=568021&r1=568020&r2=568021&view=diff ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java (original) +++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java Tue Aug 21 01:34:17 2007 @@ -152,4 +152,16 @@ assertTrue(true); } + @Test + public void testNoService() { + env.put(ToolConstants.CFG_WSDLURL, getClass().getResource("resources/build.wsdl").toString()); + + JAXWSDefinitionBuilder builder = new JAXWSDefinitionBuilder(); + builder.setContext(env); + builder.build(); + + Definition def = builder.getWSDLModel(); + assertTrue(def.getServices().keySet().contains(new QName("http://apache.org/hello_world_soap_http", + "SOAPService"))); + } } Added: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/resources/build.wsdl URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/resources/build.wsdl?rev=568021&view=auto ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/resources/build.wsdl (added) +++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/resources/build.wsdl Tue Aug 21 01:34:17 2007 @@ -0,0 +1,28 @@ + + + + +