cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r554891 - in /incubator/cxf/trunk: rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/ tools/...
Date Tue, 10 Jul 2007 09:51:11 GMT
Author: ema
Date: Tue Jul 10 02:51:08 2007
New Revision: 554891

URL: http://svn.apache.org/viewvc?view=rev&rev=554891
Log:
* [CXF-774]Fixed issue with generated schema element when given method return type is List
with no generic type
* Fixed soap address error in hello_world_fault.wsdl 

Added:
    incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/
    incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/ListTest.java
    incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/ListTestImpl.java
    incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/expected/list_expected.wsdl
Modified:
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
    incubator/cxf/trunk/tools/javato/test/src/test/resources/java2wsdl_wsdl/hello_world_fault.wsdl

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java?view=diff&rev=554891&r1=554890&r2=554891
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ServerFactoryBeanDefinitionParser.java
Tue Jul 10 02:51:08 2007
@@ -58,7 +58,9 @@
         } else {
             setFirstChildAsProperty(el, ctx, bean, name);
         }
+        
     }
+    
 
     @Override
     protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean)
{

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=554891&r1=554890&r2=554891
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Tue Jul 10 02:51:08 2007
@@ -28,6 +28,7 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -78,6 +79,7 @@
 import org.apache.ws.commons.schema.XmlSchemaObject;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.apache.ws.commons.schema.XmlSchemaType;
+import org.apache.ws.commons.schema.constants.Constants;
 import org.apache.ws.commons.schema.utils.NamespaceMap;
 
 /**
@@ -658,6 +660,16 @@
                     && !Byte.TYPE.equals(mpi.getTypeClass().getComponentType()))
{
                     el.setMinOccurs(0);
                     el.setMaxOccurs(Long.MAX_VALUE);
+                } else if (Collection.class.isAssignableFrom(mpi.getTypeClass())
+                           && mpi.getTypeClass().isInterface()) {
+                    Type type = (Type)mpi.getProperty(GENERIC_TYPE);
+                    if (!(type instanceof java.lang.reflect.ParameterizedType)
+                        && mpi.getTypeQName() == null) {
+                        el.setMinOccurs(0);
+                        el.setMaxOccurs(Long.MAX_VALUE);
+                        el.setSchemaTypeName(Constants.XSD_ANYTYPE);
+                    }
+
                 } else {
                     el.setMaxOccurs(1);
                     if (mpi.getTypeClass() != null && !mpi.getTypeClass().isPrimitive())
{

Added: incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/ListTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/ListTest.java?view=auto&rev=554891
==============================================================================
--- incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/ListTest.java
(added)
+++ incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/ListTest.java
Tue Jul 10 02:51:08 2007
@@ -0,0 +1,42 @@
+/**
+ * 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.
+ */
+
+package org.apache.cxf.tools.fortest.cxf774;
+
+import java.util.List;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+@WebService(name = "ListTest", targetNamespace = "http://cxf.apache/")
+public interface ListTest {
+
+    @WebMethod(operationName = "sayHi", exclude = false)
+    @ResponseWrapper(className = "apache.cxf.SayHiResponse", 
+                     localName = "sayHiResponse", 
+                     targetNamespace = "http://cxf.apache/")
+    @RequestWrapper(className = "apache.cxf.SayHi", 
+                    localName = "sayHi", 
+                    targetNamespace = "http://cxf.apache/")
+    List sayHi(String hi);
+
+}

Added: incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/ListTestImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/ListTestImpl.java?view=auto&rev=554891
==============================================================================
--- incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/ListTestImpl.java
(added)
+++ incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/fortest/cxf774/ListTestImpl.java
Tue Jul 10 02:51:08 2007
@@ -0,0 +1,31 @@
+/**
+ * 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.
+ */
+package org.apache.cxf.tools.fortest.cxf774;
+import java.util.List;
+import javax.jws.WebService;
+@WebService(serviceName = "SOAPService", 
+            portName = "SoapPort", 
+            endpointInterface = "org.apache.cxf.tools.fortest.cxf774.ListTest",
+            targetNamespace = "http://cxf.apache/")
+public class ListTestImpl implements ListTest {
+    public List sayHi(String hi) {
+        return null;
+    }
+
+}

Modified: incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?view=diff&rev=554891&r1=554890&r2=554891
==============================================================================
--- incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Tue Jul 10 02:51:08 2007
@@ -393,4 +393,23 @@
         String expectedFile = getClass().getResource("expected/echo_calendar.xjb").getFile();
         assertFileEquals(new File(expectedFile), bindingFile);
     }
+    
+    @Test
+    //Test for cxf774
+    public void testList() throws Exception {
+        env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + "/list_test.wsdl");
+        env.put(ToolConstants.CFG_CLASSNAME, "org.apache.cxf.tools.fortest.cxf774.ListTestImpl");
+        env.put(ToolConstants.CFG_VERBOSE, ToolConstants.CFG_VERBOSE);
+        try {
+            processor.setEnvironment(env);
+            processor.process();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        File wsdlFile = new File(output, "list_test.wsdl");
+        assertTrue("Generate Wsdl Fail", wsdlFile.exists());
+        
+        String expectedFile = getClass().getResource("expected/list_expected.wsdl").getFile();
+        assertFileEquals(new File(expectedFile), new File(output, "/list_test.wsdl"));
+    }
 }

Added: incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/expected/list_expected.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/expected/list_expected.wsdl?view=auto&rev=554891
==============================================================================
--- incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/expected/list_expected.wsdl
(added)
+++ incubator/cxf/trunk/tools/javato/test/src/test/java/org/apache/cxf/tools/java2wsdl/processor/expected/list_expected.wsdl
Tue Jul 10 02:51:08 2007
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<wsdl:definitions name="SOAPService" targetNamespace="http://cxf.apache/" xmlns:ns1="http://cxf.apache/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+  <wsdl:types>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://cxf.apache/" attributeFormDefault="unqualified"
elementFormDefault="unqualified" targetNamespace="http://cxf.apache/">
+<xsd:element name="sayHi" type="sayHi"/>
+<xsd:complexType name="sayHi">
+<xsd:sequence>
+<xsd:element minOccurs="0" name="arg0" type="xsd:string"/>
+</xsd:sequence>
+</xsd:complexType>
+<xsd:element name="sayHiResponse" type="sayHiResponse"/>
+<xsd:complexType name="sayHiResponse">
+<xsd:sequence>
+<xsd:element maxOccurs="unbounded" minOccurs="0" name="return" type="xsd:anyType"/>
+</xsd:sequence>
+</xsd:complexType>
+</xsd:schema>
+  </wsdl:types>
+  <wsdl:message name="sayHiResponse">
+    <wsdl:part name="result" element="ns1:sayHiResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="sayHi">
+    <wsdl:part name="parameters" element="ns1:sayHi">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="ListTest">
+    <wsdl:operation name="sayHi">
+      <wsdl:input name="sayHi" message="ns1:sayHi">
+    </wsdl:input>
+      <wsdl:output name="sayHiResponse" message="ns1:sayHiResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="SOAPServiceSoapBinding" type="ns1:ListTest">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="sayHi">
+      <soap:operation soapAction="" style="document"/>
+      <wsdl:input name="sayHi">
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="sayHiResponse">
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="SOAPService">
+    <wsdl:port name="SoapPort" binding="ns1:SOAPServiceSoapBinding">
+      <soap:address location="http://localhost:9090/hello"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Modified: incubator/cxf/trunk/tools/javato/test/src/test/resources/java2wsdl_wsdl/hello_world_fault.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/test/src/test/resources/java2wsdl_wsdl/hello_world_fault.wsdl?view=diff&rev=554891&r1=554890&r2=554891
==============================================================================
--- incubator/cxf/trunk/tools/javato/test/src/test/resources/java2wsdl_wsdl/hello_world_fault.wsdl
(original)
+++ incubator/cxf/trunk/tools/javato/test/src/test/resources/java2wsdl_wsdl/hello_world_fault.wsdl
Tue Jul 10 02:51:08 2007
@@ -146,7 +146,7 @@
     </wsdl:binding>
     <wsdl:service name="SOAPService">
         <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
-            <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>\
+            <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
         </wsdl:port>
     </wsdl:service>
 



Mime
View raw message