You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by em...@apache.org on 2007/05/10 09:08:17 UTC
svn commit: r536759 - in
/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws:
CodeFirstTest.java service/SayHi.java service/SayHiImpl.java
Author: ema
Date: Thu May 10 00:08:15 2007
New Revision: 536759
URL: http://svn.apache.org/viewvc?view=rev&rev=536759
Log:
Added test case for issue CXF-453
Added:
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/SayHi.java
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/SayHiImpl.java
Modified:
incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java?view=diff&rev=536759&r1=536758&r2=536759
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java Thu May 10 00:08:15 2007
@@ -32,6 +32,8 @@
import org.apache.cxf.frontend.ServerFactoryBean;
import org.apache.cxf.jaxws.service.Hello;
import org.apache.cxf.jaxws.service.HelloInterface;
+import org.apache.cxf.jaxws.service.SayHi;
+import org.apache.cxf.jaxws.service.SayHiImpl;
import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
import org.apache.cxf.service.Service;
import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
@@ -171,5 +173,25 @@
//List<String> result = proxy.getGreetings();
//assertEquals(2, result.size());
}
+
+
+ @Test
+ public void testRpcClient() throws Exception {
+ SayHiImpl serviceImpl = new SayHiImpl();
+ EndpointImpl ep = new EndpointImpl(getBus(), serviceImpl, (String) null);
+ ep.publish("local://localhost:9090/hello");
+
+ QName serviceName = new QName("http://mynamespace.com/", "SayHiService");
+ QName portName = new QName("http://mynamespace.com/", "HelloPort");
+
+ // need to set the same bus with service , so use the ServiceImpl
+ ServiceImpl service = new ServiceImpl(getBus(), (URL)null, serviceName, null);
+ service.addPort(portName, "http://schemas.xmlsoap.org/soap/", "local://localhost:9090/hello");
+
+ SayHi proxy = service.getPort(portName, SayHi.class);
+ long res = proxy.sayHi(3);
+ assertEquals(3, res);
+ }
+
}
Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/SayHi.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/SayHi.java?view=auto&rev=536759
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/SayHi.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/SayHi.java Thu May 10 00:08:15 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.jaxws.service;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
+@WebService(name = "Hello", targetNamespace = "http://mynamespace.com/")
+public interface SayHi {
+
+ @WebMethod(operationName = "sayHi", exclude = false)
+ long sayHi(long l);
+ void greetMe();
+}
Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/SayHiImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/SayHiImpl.java?view=auto&rev=536759
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/SayHiImpl.java (added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/SayHiImpl.java Thu May 10 00:08:15 2007
@@ -0,0 +1,34 @@
+/**
+ * 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.jaxws.service;
+
+import javax.jws.WebService;
+
+@WebService(serviceName = "SayHiService",
+ portName = "HelloPort",
+ targetNamespace = "http://mynamespace.com/",
+ endpointInterface = "org.apache.cxf.jaxws.service.SayHi")
+public class SayHiImpl implements SayHi {
+ public long sayHi(long arg) {
+ return arg;
+ }
+ public void greetMe() {
+
+ }
+}