You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ba...@apache.org on 2007/06/25 22:17:46 UTC

svn commit: r550594 - /webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java

Author: barrettj
Date: Mon Jun 25 13:17:44 2007
New Revision: 550594

URL: http://svn.apache.org/viewvc?view=rev&rev=550594
Log:
AXIS2-2597
Add support for WS-A actions when using annontations w/o WSDL.  Contributed by Roy Wood Jr.

Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java

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?view=diff&rev=550594&r1=550593&r2=550594
==============================================================================
--- 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 Mon Jun 25 13:17:44 2007
@@ -19,6 +19,7 @@
 package org.apache.axis2.jaxws.description.impl;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.wsdl.WSDL11ActionHelper;
 import org.apache.axis2.description.AxisMessage;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisOperationFactory;
@@ -243,6 +244,76 @@
 
         newAxisOperation.setName(determineOperationQName(this.methodComposite));
         newAxisOperation.setSoapAction(this.getAction());
+
+        //*************************************************************************************
+        //NOTE: assumption here is that all info. need to generate the actions will have to come
+        //      from annotations (or default values)
+        //*************************************************************************************
+        
+        String messageExchangePattern = newAxisOperation.getMessageExchangePattern();
+        String targetNS = getEndpointInterfaceDescriptionImpl().getTargetNamespace();        
+        String portTypeName = getEndpointInterfaceDescriptionImpl().getEndpointDescriptionImpl().getName();
+        ArrayList inputActions = new ArrayList();
+         
+        //We don't have a name at this point, shouldn't matter if we have the MEP
+        //String inputName = newAxisOperation.getName().getLocalPart();
+        String inputName = null;
+        String inputAction = 
+                WSDL11ActionHelper.getInputActionFromStringInformation(messageExchangePattern, 
+                                                                       targetNS, 
+                                                                       portTypeName, 
+                                                                       newAxisOperation.getName().getLocalPart(), 
+                                                                       inputName);
+                
+        if (inputAction != null) {
+            inputActions.add(inputAction);
+            newAxisOperation.setWsamappingList(inputActions);
+        }
+        
+        //Map the action to the operation on the actual axisService
+        //TODO: Determine whether this should be done at a higher level in the 
+        //      description hierarchy
+        getEndpointInterfaceDescriptionImpl().getEndpointDescriptionImpl().
+            getAxisService().mapActionToOperation(inputAction, newAxisOperation);
+        
+        //set the OUTPUT ACTION
+
+        //We don't have a name at this point, shouldn't matter if we have the MEP
+        //String outputName = newAxisOperation.getName().getLocalPart();  //REVIEW:
+        String outputName = null;
+        String outputAction = 
+                WSDL11ActionHelper.getOutputActionFromStringInformation(messageExchangePattern,
+                                                                        targetNS, 
+                                                                        portTypeName, 
+                                                                        newAxisOperation.getName().getLocalPart(), 
+                                                                        outputName);
+        
+        if (outputAction != null) {
+                newAxisOperation.setOutputAction(outputAction);
+        }
+        
+        //Set the FAULT ACTION
+        // Walk the fault information
+        FaultDescription[] faultDescs = getFaultDescriptions();
+        if (faultDescs != null) {
+            for (int i=0; i <faultDescs.length; i++) {
+        
+                AxisMessage faultMessage = new AxisMessage();
+                String faultName = faultDescs[i].getName();
+                faultMessage.setName(faultName);
+                
+                String faultAction = 
+                        WSDL11ActionHelper.getFaultActionFromStringInformation( messageExchangePattern, 
+                                        portTypeName, 
+                                        newAxisOperation.getName().getLocalPart(), 
+                                        faultMessage.getName());
+                
+                if (faultAction != null) {
+                        newAxisOperation.addFaultAction(faultMessage.getName(), faultAction);
+                }
+                newAxisOperation.setFaultMessages(faultMessage);
+            }
+        }
 
         //REVIEW: Determine if other axisOperation values may need to be set
         //      Currently, the following values are being set on AxisOperation in 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org