geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1157536 - /geronimo/bundles/trunk/axis2/src/main/java/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
Date Sun, 14 Aug 2011 14:32:17 GMT
Author: xuhaihong
Date: Sun Aug 14 14:32:17 2011
New Revision: 1157536

URL: http://svn.apache.org/viewvc?rev=1157536&view=rev
Log:
AXIS2-5034 Incorrect exception name is used for fault message while creating AxisService from
WSDL
Use the changes from Axis2 community

Modified:
    geronimo/bundles/trunk/axis2/src/main/java/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java

Modified: geronimo/bundles/trunk/axis2/src/main/java/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/bundles/trunk/axis2/src/main/java/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?rev=1157536&r1=1157535&r2=1157536&view=diff
==============================================================================
--- geronimo/bundles/trunk/axis2/src/main/java/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
(original)
+++ geronimo/bundles/trunk/axis2/src/main/java/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
Sun Aug 14 14:32:17 2011
@@ -115,6 +115,15 @@ public class WSDL11ToAxisServiceBuilder 
     public static final int COMPONENT_MESSAGE = 2;
     public static final int COMPONENT_BINDING = 3;
 
+    /**
+    * Parameter used on {@link AxisMessage} objects to track the value of the <tt>name</tt>
+    * attribute of the <tt>wsdl:fault</tt>. Note that this is more like a workaround.
The problem
+    * is that {@link AxisMessage} stores the faults as a simple list. A better fix would
be to
+    * replace that by a map with the fault name as key, similar to what WSDL4J does (see
+    * {@link Operation#getFaults()}).
+    */
+    private static final String FAULT_NAME = "faultName";
+    
     protected static final Log log = LogFactory
             .getLog(WSDL11ToAxisServiceBuilder.class);
     private static final boolean isTraceEnabled = log.isTraceEnabled();
@@ -879,7 +888,7 @@ public class WSDL11ToAxisServiceBuilder 
                         Message wsdl4jFaultMessge = wsdl4jFault.getMessage();
 
                         AxisMessage faultMessage = findFaultMessage(
-                                wsdl4jFaultMessge.getQName().getLocalPart(),
+                                wsdl4jFault.getName(),//        wsdl4jFaultMessge.getQName().getLocalPart(),
                                 axisOperation.getFaultMessages());
 
                         AxisBindingMessage axisBindingFaultMessage = new AxisBindingMessage();
@@ -1182,7 +1191,7 @@ public class WSDL11ToAxisServiceBuilder 
         AxisMessage tempMessage;
         for (int i = 0; i < faultMessages.size(); i++) {
             tempMessage = (AxisMessage) faultMessages.get(i);
-            if (name.equals(tempMessage.getName())) {
+            if (name.equals(tempMessage.getParameterValue(FAULT_NAME))) {//if (name.equals(tempMessage.getName()))
{
                 return tempMessage;
             }
 
@@ -1550,10 +1559,11 @@ public class WSDL11ToAxisServiceBuilder 
             Fault fault = (Fault) faults.get(faultKeyIterator.next());
             AxisMessage axisFaultMessage = new AxisMessage();
             addDocumentation(axisFaultMessage,fault.getDocumentationElement());
+            axisFaultMessage.addParameter(FAULT_NAME, fault.getName());
             Message faultMessage = fault.getMessage();
             if (null != faultMessage) {
                 axisFaultMessage
-                        .setName(faultMessage.getQName().getLocalPart());
+                    .setName(faultMessage.getQName().getLocalPart());
 
                 copyExtensibleElements(faultMessage.getExtensibilityElements(),
                                        dif, axisFaultMessage, PORT_TYPE_OPERATION_FAULT);



Mime
View raw message