Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 69122 invoked from network); 30 Oct 2007 09:29:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2007 09:29:01 -0000 Received: (qmail 58299 invoked by uid 500); 30 Oct 2007 09:28:49 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 58235 invoked by uid 500); 30 Oct 2007 09:28:48 -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 58226 invoked by uid 99); 30 Oct 2007 09:28:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2007 02:28:48 -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, 30 Oct 2007 09:28:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0AF9A1A9832; Tue, 30 Oct 2007 02:28:16 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r590003 - in /incubator/cxf/trunk/tools/wsdlto: frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/ test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/ test/src/test/resources/wsdl2java_wsdl/cxf1141/ tes... Date: Tue, 30 Oct 2007 09:28:13 -0000 To: cxf-commits@incubator.apache.org From: ema@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071030092816.0AF9A1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ema Date: Tue Oct 30 02:28:11 2007 New Revision: 590003 URL: http://svn.apache.org/viewvc?rev=590003&view=rev Log: Fixed issue CXF-1152 Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws1.xml incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws2.xml Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxb.xml incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxws.xml Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=590003&r1=590002&r2=590003&view=diff ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java (original) +++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java Tue Oct 30 02:28:11 2007 @@ -22,7 +22,6 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; - import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; @@ -117,11 +116,14 @@ for (Element element : jaxwsBindingsMap.keySet()) { nodeSelector.addNamespaces(element); - Element targetNode = jaxwsBindingsMap.get(element); + Element oldTargetNode = jaxwsBindingsMap.get(element); + Element targetNode = oldTargetNode; internalizeBinding(element, targetNode, ""); String uri = element.getAttribute("wsdlLocation"); customizedElements.put(uri, targetNode); + updateJaxwsBindingMapValue(targetNode); } + buildHandlerChains(); } @@ -142,6 +144,7 @@ try { doc = DOMUtils.readXml(ins); + doc.setDocumentURI(uri); } catch (Exception e) { Message msg = new Message("CAN_NOT_READ_AS_ELEMENT", LOG, new Object[] {uri}); throw new ToolException(msg, e); @@ -153,6 +156,16 @@ return null; } + private void updateJaxwsBindingMapValue(Element value) { + String baseURI = value.getBaseURI(); + for (Element ele : jaxwsBindingsMap.keySet()) { + String uri = jaxwsBindingsMap.get(ele).getBaseURI(); + if (uri != null && uri.equals(baseURI)) { + jaxwsBindingsMap.put(ele, value); + } + } + } + private void buildHandlerChains() { for (Element jaxwsBinding : jaxwsBindingsMap.keySet()) { @@ -269,6 +282,8 @@ copyBindingsToWsdl(node, bindings, nodeSelector.getNamespaceContext()); } } + + } Element[] children = getChildElements(bindings, ToolConstants.NS_JAXWS_BINDINGS); Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?rev=590003&r1=590002&r2=590003&view=diff ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java (original) +++ incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java Tue Oct 30 02:28:11 2007 @@ -536,7 +536,7 @@ } @Test - //Test for CXF-765 + // Test for CXF-765 public void testClientServer() throws Exception { env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/bug765/hello_world_ports.wsdl")); env.remove(ToolConstants.CFG_COMPILE); @@ -570,7 +570,7 @@ public void testCXF804() throws Exception { env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf804/hello_world_contains_import.wsdl")); - //env.put(ToolConstants.CFG_SERVICENAME, "SOAPService"); + // env.put(ToolConstants.CFG_SERVICENAME, "SOAPService"); processor.setContext(env); processor.execute(); @@ -633,7 +633,8 @@ try { env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf939/bug.wsdl")); - // env.put(ToolConstants.CFG_VALIDATE_WSDL, ToolConstants.CFG_VALIDATE_WSDL); + // env.put(ToolConstants.CFG_VALIDATE_WSDL, + // ToolConstants.CFG_VALIDATE_WSDL); processor.setContext(env); processor.execute(); } catch (Exception e) { @@ -695,7 +696,7 @@ @Test public void testAsyncImplAndClient() throws Exception { - //CXF994 + // CXF994 env.put(ToolConstants.CFG_COMPILE, "compile"); env.put(ToolConstants.CFG_OUTPUTDIR, output.getCanonicalPath()); env.put(ToolConstants.CFG_CLASSDIR, output.getCanonicalPath() + "/classes"); @@ -859,12 +860,21 @@ assertEquals(13, file.list().length); } - - - - - - - + @Test + public void testTwoJaxwsBindingFile() throws Exception { + env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl")); + env.put(ToolConstants.CFG_BINDING, new String[] {getLocation("/wsdl2java_wsdl/cxf1152/jaxws1.xml"), + getLocation("/wsdl2java_wsdl/cxf1152/jaxws2.xml")}); + processor.setContext(env); + processor.execute(); + File file = new File(output, "org/mypkg"); + assertEquals(23, file.listFiles().length); + Class clz = classLoader.loadClass("org.mypkg.MyService"); + assertNotNull("Customized service class is not found", clz); + clz = classLoader.loadClass("org.mypkg.MyGreeter"); + assertNotNull("Customized SEI class is not found", clz); + Method customizedMethod = clz.getMethod("myGreetMe", new Class[] {String.class}); + assertNotNull("Customized method 'myGreetMe' in MyGreeter.class is not found", customizedMethod); + } } Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxb.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxb.xml?rev=590003&r1=590002&r2=590003&view=diff ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxb.xml (original) +++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxb.xml Tue Oct 30 02:28:11 2007 @@ -1,3 +1,21 @@ + Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxws.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxws.xml?rev=590003&r1=590002&r2=590003&view=diff ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxws.xml (original) +++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1141/jaxws.xml Tue Oct 30 02:28:11 2007 @@ -1,4 +1,22 @@ + Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws1.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws1.xml?rev=590003&view=auto ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws1.xml (added) +++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws1.xml Tue Oct 30 02:28:11 2007 @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws2.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws2.xml?rev=590003&view=auto ============================================================================== --- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws2.xml (added) +++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1152/jaxws2.xml Tue Oct 30 02:28:11 2007 @@ -0,0 +1,24 @@ + + + + + + +