axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis SOAPPart.java
Date Thu, 31 Jan 2002 21:36:48 GMT
gdaniels    02/01/31 13:36:48

  Modified:    java/src/org/apache/axis SOAPPart.java
  Log:
  If we have problems serializing a message, attempt to serialize the
  resultant fault instead.  Before this we were getting blank faults for
  serialization errors on the server side.
  
  Revision  Changes    Path
  1.7       +14 -2     xml-axis/java/src/org/apache/axis/SOAPPart.java
  
  Index: SOAPPart.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/SOAPPart.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SOAPPart.java	26 Jan 2002 02:50:51 -0000	1.6
  +++ SOAPPart.java	31 Jan 2002 21:36:48 -0000	1.7
  @@ -330,8 +330,20 @@
               try {
                   env.output(new SerializationContextImpl(writer, getMessage().getMessageContext()));
               } catch (Exception e) {
  -                e.printStackTrace();
  -                return null;
  +                AxisFault fault;
  +                if (e instanceof AxisFault) {
  +                    fault = (AxisFault)e;
  +                } else {
  +                    fault = new AxisFault(e);
  +                }
  +                // Start over, write the fault...
  +                writer = new StringWriter();
  +                try {
  +                    fault.output(new SerializationContextImpl(writer, getMessage().getMessageContext()));
  +                } catch (Exception ex) {
  +                    // OK, now we're *really* in trouble.
  +                    return null;
  +                }
               }
               setCurrentMessage(writer.getBuffer().toString(), FORM_STRING);
               return (String)currentMessage;
  
  
  

Mime
View raw message