You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ng...@apache.org on 2006/10/20 01:27:29 UTC
svn commit: r465931 - in /webservices/axis2/trunk/java/modules/jaxws:
src/org/apache/axis2/jaxws/server/dispatcher/
test/org/apache/axis2/jaxws/sample/
test/org/apache/axis2/jaxws/sample/addnumbers/
Author: ngallardo
Date: Thu Oct 19 16:27:27 2006
New Revision: 465931
URL: http://svn.apache.org/viewvc?view=rev&rev=465931
Log:
Fixing one-way endpoint problem for Java beans.
Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbers/AddNumbersPortTypeImpl.java
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java?view=diff&rev=465931&r1=465930&r2=465931
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java Thu Oct 19 16:27:27 2006
@@ -85,7 +85,8 @@
}
Message message = null;
- //No need to create Response Messagecontext if its a one way call.
+ // If the operation is one-way, then we can just return null because
+ // we cannot create a MessageContext for one-way responses.
if(operationDesc.isOneWay()){
message = null;
}
Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java?view=diff&rev=465931&r1=465930&r2=465931
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/AddNumbersTests.java Thu Oct 19 16:27:27 2006
@@ -1,5 +1,20 @@
-/**
+/*
+ * 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.axis2.jaxws.sample;
@@ -10,24 +25,47 @@
import org.apache.axis2.jaxws.sample.addnumbers.AddNumbersPortType;
import org.apache.axis2.jaxws.sample.addnumbers.AddNumbersService;
-
public class AddNumbersTests extends TestCase {
- String axisEndpoint = "http://localhost:8080/axis2/services/AddNumbersService";
- public void testAddNumbers(){
+
+ String axisEndpoint = "http://localhost:8080/axis2/services/AddNumbersService";
+
+ public void testAddNumbers() {
try{
System.out.println("----------------------------------");
System.out.println("test: " + getName());
- AddNumbersService service = new AddNumbersService();
+
+ AddNumbersService service = new AddNumbersService();
AddNumbersPortType proxy = service.getAddNumbersPort();
- BindingProvider p = (BindingProvider)proxy;
- p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,axisEndpoint);
+
+ BindingProvider p = (BindingProvider)proxy;
+ p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+ axisEndpoint);
int total = proxy.addNumbers(10,10);
System.out.println("Total =" +total);
System.out.println("----------------------------------");
- }catch(Exception e){
+ } catch(Exception e) {
e.printStackTrace();
fail();
}
}
+
+ public void testOneWay() {
+ try {
+ System.out.println("----------------------------------");
+ System.out.println("test: " + getName());
+
+ AddNumbersService service = new AddNumbersService();
+ AddNumbersPortType proxy = service.getAddNumbersPort();
+
+ BindingProvider bp = (BindingProvider) proxy;
+ bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+ axisEndpoint);
+ proxy.oneWayInt(11);
+ System.out.println("----------------------------------");
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail();
+ }
+ }
}
Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbers/AddNumbersPortTypeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbers/AddNumbersPortTypeImpl.java?view=diff&rev=465931&r1=465930&r2=465931
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbers/AddNumbersPortTypeImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/sample/addnumbers/AddNumbersPortTypeImpl.java Thu Oct 19 16:27:27 2006
@@ -1,5 +1,20 @@
-/**
+/*
+ * 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.axis2.jaxws.sample.addnumbers;
@@ -13,17 +28,16 @@
* @see org.apache.axis2.jaxws.sample.addnumbers.AddNumbersPortType#addNumbers(int, int)
*/
public int addNumbers(int arg0, int arg1) throws AddNumbersFault_Exception {
- // TODO Auto-generated method stub
- return arg0+arg1;
-
+ System.out.println(">> Received addNumbers request for " + arg0 + " and " + arg1);
+ return arg0+arg1;
}
/* (non-Javadoc)
* @see org.apache.axis2.jaxws.sample.addnumbers.AddNumbersPortType#oneWayInt(int)
*/
public void oneWayInt(int arg0) {
- // TODO Auto-generated method stub
-
+ System.out.println(">> Received one-way request.");
+ return;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org