Author: dkulp
Date: Fri Aug 31 11:46:27 2007
New Revision: 571537
URL: http://svn.apache.org/viewvc?rev=571537&view=rev
Log:
[CXF-960] Fix problems on client side if SEI interface extends other interfaces
that have methods we need.
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstBaseService.java
(with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService1.java
(with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService2.java
(with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/InterfaceInheritTestImpl.java
(with props)
Modified:
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
Modified:
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java?rev=571537&r1=571536&r2=571537&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java
(original)
+++
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java
Fri Aug 31 11:46:27 2007
@@ -231,7 +231,11 @@
}
}
- private String getWSInterfaceName(Class implClz) {
+ private String getWSInterfaceName(Class<?> implClz) {
+ if (implClz.isInterface()
+ && implClz.getAnnotation(WebService.class) != null) {
+ return implClz.getName();
+ }
Class<?>[] clzs = implClz.getInterfaces();
for (Class<?> clz : clzs) {
if (null != clz.getAnnotation(WebService.class)) {
@@ -254,9 +258,14 @@
while (cls != null) {
WebService annotation = cls.getAnnotation(WebService.class);
if (annotation != null) {
- wsAnnotations.add(annotation);
+ wsAnnotations.add(annotation);
+ if (cls.isInterface()) {
+ cls = null;
+ }
+ }
+ if (cls != null) {
+ cls = cls.getSuperclass();
}
- cls = cls.getSuperclass();
}
String sei = getImplementorClassName();
boolean seiFromWsAnnotation = true;
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?rev=571537&r1=571536&r2=571537&view=diff
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
Fri Aug 31 11:46:27 2007
@@ -58,7 +58,7 @@
@BeforeClass
public static void startServers() throws Exception {
- assertTrue("server did not launch correctly",
launchServer(ServerMisc.class, true));
+ assertTrue("server did not launch correctly",
launchServer(ServerMisc.class));
}
@Test
@@ -275,7 +275,7 @@
@Test
public void testRpcLitNoWsdl() throws Exception {
QName portName = new
QName("http://cxf.apache.org/systest/jaxws/RpcLitCodeFirstService",
- "RpcLitCodeFirstServicePort");
+ "RpcLitCodimlpementor6eFirstServicePort");
QName servName = new
QName("http://cxf.apache.org/systest/jaxws/RpcLitCodeFirstService",
"RpcLitCodeFirstService");
@@ -413,5 +413,30 @@
assertEquals("B", obj.getBaseObject().getName());
assertTrue(obj.getBaseObject() instanceof SubTypeB);
+ }
+
+ @Test
+ public void testInterfaceExtension() throws Exception {
+ QName portName = new
QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstBaseService",
+ "DocLitWrappedCodeFirstBaseServicePort");
+ QName servName = new
QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstBaseService",
+ "DocLitWrappedCodeFirstBaseService");
+
+ //try without wsdl
+ Service service = Service.create(servName);
+ service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING,
ServerMisc.DOCLIT_CODEFIRST_BASE_URL);
+ DocLitWrappedCodeFirstBaseService port = service.getPort(portName,
+ DocLitWrappedCodeFirstBaseService.class);
+ assertEquals(1, port.operationInBase(1));
+ assertEquals(2, port.operationInSub1(2));
+ assertEquals(3, port.operationInSub2(3));
+
+ //try with wsdl
+ service = Service.create(new URL(ServerMisc.DOCLIT_CODEFIRST_BASE_URL
+ "?wsdl"),
+ servName);
+ port = service.getPort(portName,
DocLitWrappedCodeFirstBaseService.class);
+ assertEquals(1, port.operationInBase(1));
+ assertEquals(2, port.operationInSub1(2));
+ assertEquals(3, port.operationInSub2(3));
}
}
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstBaseService.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstBaseService.java?rev=571537&view=auto
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstBaseService.java
(added)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstBaseService.java
Fri Aug 31 11:46:27 2007
@@ -0,0 +1,32 @@
+/**
+ * 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.systest.jaxws;
+
+import javax.jws.WebService;
+
+
[EMAIL PROTECTED](name = "DocLitWrappedCodeFirstBaseService",
+ targetNamespace =
"http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstBaseService")
+public interface DocLitWrappedCodeFirstBaseService
+ extends DocLitWrappedCodeFirstSubService1,
+ DocLitWrappedCodeFirstSubService2 {
+
+ int operationInBase(int i);
+
+}
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstBaseService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstBaseService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService1.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService1.java?rev=571537&view=auto
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService1.java
(added)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService1.java
Fri Aug 31 11:46:27 2007
@@ -0,0 +1,27 @@
+/**
+ * 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.systest.jaxws;
+
+import javax.jws.WebService;
+
[EMAIL PROTECTED]
+public interface DocLitWrappedCodeFirstSubService1 {
+ int operationInSub1(int i);
+
+}
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService1.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService1.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService2.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService2.java?rev=571537&view=auto
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService2.java
(added)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService2.java
Fri Aug 31 11:46:27 2007
@@ -0,0 +1,27 @@
+/**
+ * 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.systest.jaxws;
+
+import javax.jws.WebService;
+
[EMAIL PROTECTED]
+public interface DocLitWrappedCodeFirstSubService2 {
+
+ int operationInSub2(int i);
+}
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService2.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstSubService2.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/InterfaceInheritTestImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/InterfaceInheritTestImpl.java?rev=571537&view=auto
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/InterfaceInheritTestImpl.java
(added)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/InterfaceInheritTestImpl.java
Fri Aug 31 11:46:27 2007
@@ -0,0 +1,40 @@
+/**
+ * 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.systest.jaxws;
+
+import javax.jws.WebService;
+
[EMAIL PROTECTED](endpointInterface =
"org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstBaseService",
+ serviceName = "DocLitWrappedCodeFirstBaseService",
+ portName = "DocLitWrappedCodeFirstBaseServicePort",
+ targetNamespace =
"http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstBaseService")
+public class InterfaceInheritTestImpl implements
DocLitWrappedCodeFirstBaseService {
+
+ public int operationInBase(int i) {
+ return i;
+ }
+ public int operationInSub1(int i) {
+ return i;
+ }
+ public int operationInSub2(int i) {
+ return i;
+ }
+
+}
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/InterfaceInheritTestImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/InterfaceInheritTestImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java?rev=571537&r1=571536&r2=571537&view=diff
==============================================================================
---
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
(original)
+++
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
Fri Aug 31 11:46:27 2007
@@ -32,13 +32,15 @@
"http://localhost:9003/DocLitWrappedCodeFirstService/";
public static final String RPCLIT_CODEFIRST_URL =
"http://localhost:9003/RpcLitCodeFirstService/";
-
+ public static final String DOCLIT_CODEFIRST_BASE_URL =
+ "http://localhost:9003/DocLitWrappedCodeFirstServiceBaseService/";
protected void run() {
+ Object implementor6 = new InterfaceInheritTestImpl();
+ Endpoint.publish(DOCLIT_CODEFIRST_BASE_URL, implementor6);
+
Object implementor4 = new DocLitWrappedCodeFirstServiceImpl();
Endpoint.publish(DOCLIT_CODEFIRST_URL, implementor4);
-
-
Object implementor1 = new AnonymousComplexTypeImpl();
String address = "http://localhost:9000/anonymous_complex_typeSOAP";