axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pratibha Mittal" <pmit...@confluentsoftware.com>
Subject Can't create SOAPMessage from Input Stream
Date Mon, 26 Jan 2004 20:23:18 GMT
Hi,
 
I am trying to create SoapMessage object from Input stream
which is a fault response. And Axis is throwing null pointer exception.
This works fine for a regular response message.
Is this a bug? Is there any workaround for this problem? Please
let me know as soon as possible.
 
Here is the code I am trying to execute:
public class SoapFault {
      
    public static void main(String[] args) {
        try {
            FileInputStream is = new FileInputStream(args[0]);
            SOAPMessage jaxSoapMsg = MessageFactory.newInstance().createMessage( new MimeHeaders(),
is );              
            SOAPPart sp = jaxSoapMsg.getSOAPPart();
            System.out.println("SOAP part is " + sp); 
            SOAPEnvelope se = sp.getEnvelope();
            System.out.println("SOAP envelope is " + se); 
            SOAPBody sb = se.getBody();                
            System.out.println("SOAP body is " + sb);    
                
        } catch (IOException ex0) {
            ex0.printStackTrace(System.out);
        }
        catch (SOAPException ex0) {
            ex0.printStackTrace(System.out);
        }
        catch (Exception ex0) {
            ex0.printStackTrace(System.out);
        } 
     
    }
           
}
 
As I said, this works fine for reular response but does not work for
fault response like the one below:
 
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body><SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>http://schemas.xmlsoap.org/soap/envelope/</faultstring>
<faultactor/></SOAP-ENV:Fault>
</SOAP-ENV:Body></SOAP-ENV:Envelope>

 
 
Mime
View raw message