cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
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 GMT
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 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
 <jxb:bindings version="1.0"
               xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
               xmlns:xs="http://www.w3.org/2001/XMLSchema">

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 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
 <bindings wsdlLocation="../InvoiceServer.wsdl" xmlns="http://java.sun.com/xml/ns/jaxws">
   
     <bindings node="ns1:definitions" xmlns:ns1="http://schemas.xmlsoap.org/wsdl/">
         <package name="org.mytest"/>

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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<jaxws:bindings wsdlLocation="../hello_world.wsdl" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+    <jaxws:bindings node="wsdl:definitions">
+        <jaxws:package name="org.mypkg"/>
+    </jaxws:bindings>
+
+    <jaxws:bindings node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='http://apache.org/hello_world_soap_http/types']"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+        <jxb:schemaBindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb">
+            <jxb:package name="org.mypkg"/>
+        </jxb:schemaBindings>
+    </jaxws:bindings>
+
+    <jaxws:bindings node="wsdl:definitions/wsdl:portType[@name='Greeter']">
+        <jaxws:class name="MyGreeter"/>
+    </jaxws:bindings>
+
+    <jaxws:bindings node="wsdl:definitions/wsdl:portType[@name='Greeter']/wsdl:operation[@name='greetMe']">
+        <!-- rename the generated java method name-->
+        <jaxws:method name="myGreetMe"/>        
+    </jaxws:bindings>
+
+</jaxws:bindings>

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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<jaxws:bindings wsdlLocation="../hello_world.wsdl" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+    <jaxws:bindings node="wsdl:definitions/wsdl:service[@name='SOAPService']">
+        <jaxws:class name="MyService"/>        
+    </jaxws:bindings>
+</jaxws:bindings>



Mime
View raw message