Element srcEnv = DOMUtils.parse(srcXML);
ByteArrayInputStream bais = getFastInputStream(srcXML);
MessageFactoryImpl factory = new MessageFactoryImpl();
factory.addFeature(new FastInfosetFeature());
SOAPMessage soapMessage = factory.createMessage(null, bais);
SOAPEnvelope resEnv = soapMessage.getSOAPPart().getEnvelope();
assertEquals(srcEnv, resEnv);
}
private ByteArrayInputStream getFastInputStream(String srcXML) throws IOException