cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r891036 - in /cxf/trunk: rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ systests/ws-specs/src/test/resources/wsdl_systest_wsspec/ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/interna...
Date Tue, 15 Dec 2009 22:27:25 GMT
Author: dkulp
Date: Tue Dec 15 22:27:25 2009
New Revision: 891036

URL: http://svn.apache.org/viewvc?rev=891036&view=rev
Log:
[CXF-2546] Support for new ws-a metadata namespace

Modified:
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Names.java
    cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/add_numbers.wsdl
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WSActionAnnotator.java

Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=891036&r1=891035&r2=891036&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Tue
Dec 15 22:27:25 2009
@@ -794,6 +794,10 @@
     public static String getAction(Extensible ext) {
         Object o = ext.getExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME);
         if (o == null) {
+            o = ext.getExtensionAttributes().get(new QName(Names.WSA_NAMESPACE_WSDL_METADATA,
+                                                           Names.WSAW_ACTION_NAME));
+        }
+        if (o == null) {
             o = ext.getExtensionAttributes().get(new QName(Names.WSA_NAMESPACE_WSDL_NAME_OLD,
                                                    Names.WSAW_ACTION_NAME));
         }

Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Names.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Names.java?rev=891036&r1=891035&r2=891036&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Names.java (original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/Names.java Tue Dec 15
22:27:25 2009
@@ -40,6 +40,8 @@
 
     public static final String WSA_NAMESPACE_WSDL_NAME_OLD = 
         "http://www.w3.org/2005/02/addressing/wsdl";
+    public static final String WSA_NAMESPACE_WSDL_METADATA = 
+        "http://www.w3.org/2007/05/addressing/metadata";
     public static final String WSA_NAMESPACE_PATTERN = "/addressing";
 
     public static final String WSA_REFERENCE_PARAMETERS_NAME = 

Modified: cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/add_numbers.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/add_numbers.wsdl?rev=891036&r1=891035&r2=891036&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/add_numbers.wsdl (original)
+++ cxf/trunk/systests/ws-specs/src/test/resources/wsdl_systest_wsspec/add_numbers.wsdl Tue
Dec 15 22:27:25 2009
@@ -24,7 +24,8 @@
 	     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 	     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 	     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-	     xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl">
+	     xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+	     xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
     <types>
 	<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" 
 		    elementFormDefault="qualified" 
@@ -90,9 +91,9 @@
 <!-- 	    <fault name="addNumbersFault" message="tns:addNumbersFault"/> -->
 	</operation>
 	<operation name="addNumbers3">
-	    <input message="tns:addNumbers3" wsaw:Action="3in"/>
-	    <output message="tns:addNumbers3Response" wsaw:Action="3out"/>
-	    <fault name="addNumbersFault" message="tns:addNumbersFault" wsaw:Action="3fault"/>
+	    <input message="tns:addNumbers3" wsam:Action="3in"/>
+	    <output message="tns:addNumbers3Response" wsam:Action="3out"/>
+	    <fault name="addNumbersFault" message="tns:addNumbersFault" wsam:Action="3fault"/>
 	</operation>
     </portType>
     <binding name="AddNumbersBinding" type="tns:AddNumbersPortType">

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WSActionAnnotator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WSActionAnnotator.java?rev=891036&r1=891035&r2=891036&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WSActionAnnotator.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/annotator/WSActionAnnotator.java
Tue Dec 15 22:27:25 2009
@@ -27,6 +27,7 @@
 import javax.xml.ws.FaultAction;
 
 import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.service.model.AbstractMessageContainer;
 import org.apache.cxf.service.model.FaultInfo;
 import org.apache.cxf.service.model.MessageInfo;
 import org.apache.cxf.service.model.OperationInfo;
@@ -41,18 +42,36 @@
 public final class WSActionAnnotator implements Annotator {
     private static final QName WSAW_ACTION_QNAME = new QName("http://www.w3.org/2006/05/addressing/wsdl",

                                                              "Action");    
+    private static final QName WSAM_ACTION_QNAME = new QName("http://www.w3.org/2007/05/addressing/metadata",

+                                                             "Action");    
+    private static final QName WSAW_OLD_ACTION_QNAME 
+        = new QName("http://www.w3.org/2005/02/addressing/wsdl", "Action");    
     private OperationInfo operation;
 
     public WSActionAnnotator(final OperationInfo op) {
         this.operation = op;
     }
     
+    private String getAction(AbstractMessageContainer mi) {
+        QName action = (QName)mi.getExtensionAttribute(WSAW_ACTION_QNAME);
+        if (action == null) {
+            action = (QName)mi.getExtensionAttribute(WSAM_ACTION_QNAME);
+        }
+        if (action == null) {
+            action = (QName)mi.getExtensionAttribute(WSAW_OLD_ACTION_QNAME);
+        }
+        if (action != null) {
+            return action.getLocalPart();
+        } 
+        return null;
+    }
+    
     public void annotate(JavaAnnotatable ja) {
         JavaMethod method;
         if (ja instanceof JavaMethod) {
             method = (JavaMethod) ja;
         } else {
-            throw new RuntimeException("RequestWrapper and ResponseWrapper can only annotate
JavaMethod");
+            throw new RuntimeException("Action can only annotate JavaMethod");
         }
 
         boolean required = false;
@@ -64,19 +83,19 @@
 
         JAnnotation actionAnnotation = new JAnnotation(Action.class);
         if (inputMessage.getExtensionAttributes() != null) {
-            QName inputAction = (QName)inputMessage.getExtensionAttribute(WSAW_ACTION_QNAME);
+            String inputAction = getAction(inputMessage);
             if (inputAction != null) {
                 actionAnnotation.addElement(new JAnnotationElement("input", 
-                                                                          inputAction.getLocalPart()));
+                                                                   inputAction));
                 required = true;
             }
         }
 
         if (outputMessage != null && outputMessage.getExtensionAttributes() != null)
{
-            QName outputAction = (QName)outputMessage.getExtensionAttribute(WSAW_ACTION_QNAME);
+            String outputAction = getAction(outputMessage);
             if (outputAction != null) {
                 actionAnnotation.addElement(new JAnnotationElement("output", 
-                                                                          outputAction.getLocalPart()));
+                                                                   outputAction));
                 required = true;
             }
         }
@@ -84,7 +103,7 @@
             List<JAnnotation> faultAnnotations = new ArrayList<JAnnotation>();
             for (FaultInfo faultInfo : operation.getFaults()) {
                 if (faultInfo.getExtensionAttributes() != null) {
-                    QName faultAction = (QName)faultInfo.getExtensionAttribute(WSAW_ACTION_QNAME);
+                    String faultAction = getAction(faultInfo);
                     if (faultAction == null) {
                         continue;
                     }
@@ -98,7 +117,7 @@
                     JAnnotation faultAnnotation = new JAnnotation(FaultAction.class);
                     faultAnnotation.addElement(new JAnnotationElement("className", exceptionClass));
                     faultAnnotation.addElement(new JAnnotationElement("value", 
-                                                                             faultAction.getLocalPart()));
+                                                                      faultAction));
                     faultAnnotations.add(faultAnnotation);
                     required = true;
                 }



Mime
View raw message