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 pr...@apache.org on 2008/03/15 14:16:12 UTC
svn commit: r637407 - in /webservices/axis2/trunk/java/modules:
jaxws/test/org/apache/axis2/jaxws/addressing/
metadata/src/org/apache/axis2/jaxws/description/impl/
metadata/test/org/apache/axis2/jaxws/description/addressing/
Author: pradine
Date: Sat Mar 15 06:16:11 2008
New Revision: 637407
URL: http://svn.apache.org/viewvc?rev=637407&view=rev
Log:
Missed a unittest for AXIS2-3573.
Added:
webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/addressing/ProxyActionTests.java (with props)
Modified:
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/ActionTests.java
Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/addressing/ProxyActionTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/addressing/ProxyActionTests.java?rev=637407&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/addressing/ProxyActionTests.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/addressing/ProxyActionTests.java Sat Mar 15 06:16:11 2008
@@ -0,0 +1,102 @@
+/*
+ * 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.addressing;
+
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.jaxws.client.InterceptableClientTestCase;
+import org.apache.axis2.jaxws.client.TestClientInvocationController;
+import org.apache.axis2.jaxws.core.InvocationContext;
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.description.OperationDescription;
+
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Action;
+import javax.xml.ws.FaultAction;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebFault;
+
+/**
+ * This suite of tests is for the Action annotation
+ */
+public class ProxyActionTests extends InterceptableClientTestCase {
+ private static final String ns = "http://jaxws.axis2.apache.org/metadata/addressing/action";
+
+ /*
+ * Make sure WS-Addressing Default Action Pattern is used.
+ */
+ public void testNoActionAnnotation() throws Exception {
+ Service svc = Service.create(new QName("http://test", "ProxyAddressingService"));
+ ProxyAddressingService proxy = svc.getPort(ProxyAddressingService.class);
+ assertNotNull(proxy);
+
+ proxy.doSomething("12345");
+
+ TestClientInvocationController testController = getInvocationController();
+ InvocationContext ic = testController.getInvocationContext();
+ MessageContext request = ic.getRequestMessageContext();
+
+ OperationDescription od = request.getOperationDescription();
+ AxisOperation axisOperation = (AxisOperation) od.getAxisOperation();
+ assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/doSomethingRequest", axisOperation.getOutputAction());
+ assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/doSomethingResponse", axisOperation.getInputAction());
+ assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/doSomething/Fault/TestException", axisOperation.getFaultAction());
+ }
+
+ /*
+ * Test the use of the Action annotation.
+ */
+ public void testActionAnnotation() throws Exception {
+ Service svc = Service.create(new QName("http://test", "ProxyAddressingService"));
+ ProxyAddressingServiceWithAction proxy = svc.getPort(ProxyAddressingServiceWithAction.class);
+ assertNotNull(proxy);
+
+ proxy.doSomething("12345");
+
+ TestClientInvocationController testController = getInvocationController();
+ InvocationContext ic = testController.getInvocationContext();
+ MessageContext request = ic.getRequestMessageContext();
+
+ OperationDescription od = request.getOperationDescription();
+ AxisOperation axisOperation = (AxisOperation) od.getAxisOperation();
+ assertEquals("http://test/input", axisOperation.getOutputAction());
+ assertEquals("http://test/output", axisOperation.getInputAction());
+ assertEquals("http://test/fault", axisOperation.getFaultAction());
+ }
+
+ @WebService(name="Service1", targetNamespace=ns)
+ interface ProxyAddressingService {
+
+ public String doSomething(String id) throws TestException;
+
+ }
+
+ @WebService(name="Service2", targetNamespace=ns)
+ interface ProxyAddressingServiceWithAction {
+
+ @Action(input="http://test/input", output="http://test/output",
+ fault={ @FaultAction(className=TestException.class, value="http://test/fault") })
+ public String doSomething(String id) throws TestException;
+
+ }
+
+ @WebFault(name="TestException", targetNamespace=ns)
+ class TestException extends Exception {
+ }
+}
Propchange: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/addressing/ProxyActionTests.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?rev=637407&r1=637406&r2=637407&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java Sat Mar 15 06:16:11 2008
@@ -320,9 +320,10 @@
String targetNS = getEndpointInterfaceDescriptionImpl().getTargetNamespace();
String portTypeName = getEndpointInterfaceDescriptionImpl().getPortType().getLocalPart();
- //We don't have a name at this point, shouldn't matter if we have the MEP
+ //We don't have a name at this point, shouldn't matter if we have the MEP.
+ //On the client the input and output actions are reversed.
String inputName = null;
- String inputAction = getInputAction();
+ String inputAction = getOutputAction();
//If we still don't have an action then fall back to the Default Action Pattern.
if (inputAction == null) {
@@ -347,8 +348,9 @@
//set the OUTPUT ACTION
//We don't have a name at this point, shouldn't matter if we have the MEP
+ //On the client the input and output actions are reversed.
String outputName = null;
- String outputAction = getOutputAction();
+ String outputAction = getInputAction();
if (outputAction == null) {
outputAction =
Modified: webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/ActionTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/ActionTests.java?rev=637407&r1=637406&r2=637407&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/ActionTests.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/test/org/apache/axis2/jaxws/description/addressing/ActionTests.java Sat Mar 15 06:16:11 2008
@@ -47,12 +47,10 @@
AxisService axisService = ed.getAxisService();
Iterator iterator = axisService.getOperations();
- while (iterator.hasNext()) {
- AxisOperation axisOperation = (AxisOperation) iterator.next();
- assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/getQuoteRequest", axisOperation.getInputAction());
- assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/getQuoteResponse", axisOperation.getOutputAction());
- assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/getQuote/Fault/TestException", axisOperation.getFaultAction());
- }
+ AxisOperation axisOperation = (AxisOperation) iterator.next();
+ assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/getQuoteRequest", axisOperation.getInputAction());
+ assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/getQuoteResponse", axisOperation.getOutputAction());
+ assertEquals("http://jaxws.axis2.apache.org/metadata/addressing/action/Service1/getQuote/Fault/TestException", axisOperation.getFaultAction());
}
public void testPlainAnnotation() {
@@ -63,12 +61,10 @@
AxisService axisService = ed.getAxisService();
Iterator iterator = axisService.getOperations();
- while (iterator.hasNext()) {
- AxisOperation axisOperation = (AxisOperation) iterator.next();
- assertEquals("http://test/input", axisOperation.getInputAction());
- assertEquals("http://test/output", axisOperation.getOutputAction());
- assertEquals("http://test/fault", axisOperation.getFaultAction());
- }
+ AxisOperation axisOperation = (AxisOperation) iterator.next();
+ assertEquals("http://test/input", axisOperation.getInputAction());
+ assertEquals("http://test/output", axisOperation.getOutputAction());
+ assertEquals("http://test/fault", axisOperation.getFaultAction());
}
@WebService(name="Service1", targetNamespace=ns, portName=defaultServicePortName)
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org