axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [jira] Closed: (AXIS-1281) Process SOAPFault Detail when context is not set
Date Fri, 02 Apr 2004 19:30:43 GMT
Message:

   The following issue has been closed.

   Resolver: Davanum Srinivas
       Date: Fri, 2 Apr 2004 11:28 AM

Fixed. 

Thanks,
dims
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-1281

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-1281
    Summary: Process SOAPFault Detail when context is not set
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: Axis
 Components: 
             Serialization/Deserialization
   Fix Fors:
             current (nightly)
   Versions:
             1.2 Beta

   Assignee: 
   Reporter: Yulin Dong

    Created: Thu, 1 Apr 2004 4:18 PM
    Updated: Fri, 2 Apr 2004 11:28 AM
Environment: Windows 

Description:
This defest is very similar to defect 22363 which only fixed the SOAP Fault part. However,
when SOAP Fault Detail exists, the following exception is thrown:

java.lang.NullPointerException
	at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:95)
	at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:1001)
	at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:446)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:306)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1543)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:348)
	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:539)
	at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:595)
	at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1125)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
	at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:218)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:568)
	at org.apache.axis.SOAPPart.getEnvelope(SOAPPart.java:853)
	at com.novell.wsclient.util.SOAPFaultTest.main(SOAPFaultTest.java:56)
Exception in thread "main" Process terminated with exit code 1


To reproduce, build and run the following code:


import java.io.*;

import javax.xml.soap.*;

public class SOAPFaultTest {
    public static final String soapFault = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
    "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" +
     "<soapenv:Body>" +
      "<soapenv:Fault>" +
       "<faultcode>soapenv:13001</faultcode>" +
       "<faultstring>java.lang.Exception: File already exists</faultstring>" +
       "<faultactor>urn:RiskMetricsDirect:1.0:object-service-service:CreateObject</faultactor>"
+
       "<detail>" +
       "<PO:order xmlns:PO=\"http://gizmos.com/orders/\">Quantity element does not have
a value</PO:order>" +
       "</detail>" +
      "</soapenv:Fault>" +
     "</soapenv:Body>" +
    "</soapenv:Envelope>";


    public static void main(String[] args)
    {
        try {
            ByteArrayInputStream bis = new ByteArrayInputStream( soapFault.getBytes() );
            MessageFactory msgFactory = MessageFactory.newInstance();
            SOAPMessage msg = msgFactory.createMessage ( null, bis );

            //now attempt to access the fault
            if( msg.getSOAPPart().getEnvelope().getBody().hasFault() )	{
                SOAPFault fault =
                    msg.getSOAPPart().getEnvelope().getBody().getFault();
                    System.out.println( "Fault: " + fault.getFaultString() );
            }
        } catch (SOAPException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message