FileDocCategorySizeDatePackage
TestMessageSerialization.javaAPI DocApache Axis 1.41929Sat Apr 22 18:57:28 BST 2006test.message

TestMessageSerialization

public class TestMessageSerialization extends TestCase
Test serializability of org.apache.axis.Message
author
Davanum Srinivas (dims@yahoo.com)

Fields Summary
Constructors Summary
public TestMessageSerialization(String name)

        super(name);
    
Methods Summary
public voidtest1()

        String messageText = "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" soap:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
            + "<soap:Header>"
            + "</soap:Header> "
            + "<soap:Body>  "
            + "</soap:Body>"
            + "</soap:Envelope>";
        Message message = new Message(messageText);
        ByteArrayOutputStream ostream = new ByteArrayOutputStream();
        ObjectOutputStream os = new ObjectOutputStream(ostream);
        os.writeObject(message);
        ostream.flush();
        
        ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(ostream.toByteArray()));
        Message m2 = (Message) ois.readObject();