axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pratibha Mittal" <>
Subject Can't create SOAPMessage from Input Stream
Date Mon, 26 Jan 2004 20:23:18 GMT
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) {
        catch (SOAPException ex0) {
        catch (Exception ex0) {
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="">

View raw message