axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Afkham Azeez <afk...@gmail.com>
Subject [AXIS2] Issue with writing SOAPMessage to stream in SAAJ over DOOM
Date Thu, 22 Dec 2005 10:15:25 GMT
Hi Folks,
I'm curently implementing SAAJ over DOOM. I am facing the following issue;

In one of my unit tests, I have the following method:

public void testEnvelope() throws Exception {

        String msg =
                "<?xml version='1.0' encoding='UTF-8'?>\n" +
                "<soapenv:Envelope
xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'\n" +
                "                  
xmlns:xsd='http://www.w3.org/2001/XMLSchema'\n" +
                "                  
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\n" +
                " <soapenv:Body>\n" +
                "    <echo><arg0>Hello</arg0></echo>" +
                " </soapenv:Body>\n" +
                "</soapenv:Envelope>";

        MessageFactory factory = MessageFactory.newInstance();
        SOAPMessage message =
                factory.createMessage(new MimeHeaders(),
                                      new ByteArrayInputStream(msg.getBytes()));
        SOAPPart part = message.getSOAPPart();
        SOAPEnvelope envelope = part.getEnvelope();
        message.writeTo(System.out);
        assertTrue(envelope != null);
        assertTrue(envelope.getBody() != null);
    }

when I try to do message.writeTo(System.out) I get a
NullPointerException. See http://rafb.net/paste/results/rqqrV612.html
for the stacktrace. However, if I define a default namespace or
namespace qualify the the <echo> and <arg0> elements, everything works
fine. Has anyone encountered a similar issue or Is this issue specific
to DOOM?

--
Thanks in Advance
Afkham Azeez

Mime
View raw message