"</soap:Envelope>";
public void testISO99591() throws Exception {
ByteArrayInputStream byteInStr = new ByteArrayInputStream(xml.getBytes("iso-8859-1"));
SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(
byteInStr, null);
SOAPEnvelope envelope = builder.getSOAPEnvelope();
envelope.build();
assertEquals("iso-8859-1", builder.getDocument().getXMLStreamReader().getCharacterEncodingScheme());
ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
OMOutputFormat outputFormat = new OMOutputFormat();
outputFormat.setCharSetEncoding("iso-8859-1");
envelope.serialize(byteOutStr, outputFormat);
assertXMLEqual(new InputStreamReader(new ByteArrayInputStream(xml.getBytes("iso-8859-1")),"iso-8859-1"),
new InputStreamReader(new ByteArrayInputStream(byteOutStr.toByteArray()),"iso-8859-1"));
builder.close();
}