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 to...@apache.org on 2003/08/11 23:31:17 UTC

cvs commit: xml-axis/java/src/org/apache/axis/message SOAPFaultDetailsBuilder.java

tomj        2003/08/11 14:31:17

  Modified:    java/src/org/apache/axis/message
                        SOAPFaultDetailsBuilder.java
  Log:
  Patch for bug 22204-  WS client throws wrong exception types.
  Contributed by joern.gebhardt@ptv.de (Joern Gebhardt)
  
  Prefer the type information of a fault over the QName which will
  better handle situations where 2 faults have the same message
  QName.
  
  Would love to have a test case for this...
  
  Revision  Changes    Path
  1.11      +13 -10    xml-axis/java/src/org/apache/axis/message/SOAPFaultDetailsBuilder.java
  
  Index: SOAPFaultDetailsBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPFaultDetailsBuilder.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SOAPFaultDetailsBuilder.java	28 May 2003 18:34:18 -0000	1.10
  +++ SOAPFaultDetailsBuilder.java	11 Aug 2003 21:31:17 -0000	1.11
  @@ -136,20 +136,23 @@
           Class faultClass = null;
           QName faultXmlType = null;
           if (op != null) {
  -            FaultDesc faultDesc = op.getFaultByQName(qn);
  +            FaultDesc faultDesc = null;
               // allow fault type to be denoted in xsi:type
  +            faultXmlType = context.getTypeFromAttributes(namespace,
  +                                                         name,
  +                                                         attributes);
  +            if (faultXmlType != null) {
  +                faultDesc = op.getFaultByXmlType(faultXmlType);
  +            }
  +
  +            // If we didn't get type information, look up QName of fault
               if (faultDesc == null) {
  -                faultXmlType = context.getTypeFromAttributes(namespace,
  -                                                           name,
  -                                                           attributes); 
  -                if (faultXmlType != null) {
  -                    faultDesc = op.getFaultByXmlType(faultXmlType);
  -                }
  -            } else {
  -                faultXmlType = faultDesc.getXmlType();    
  +                faultDesc = op.getFaultByQName(qn);
  +                faultXmlType = faultDesc.getXmlType();
               }
  +
  +            // Set the class if we found a description
               if (faultDesc != null) {
  -                // Set the class
                   try {
                       faultClass = ClassUtils.forName(faultDesc.getClassName());
                   } catch (ClassNotFoundException e) {