@SuppressWarnings("deprecation")
@Test
public void testSerializeExceptionToXML_SOAP12()
                        throws Exception {

    SOAP12Factory factory = new SOAP12Factory();
    SOAPExceptionSerializer soapExceptionSerializer = createExceptionSerializer( factory );
    SOAPException soapException = createException();
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter( stream );
    writer.writeStartDocument();
    soapExceptionSerializer.serializeExceptionToXML( writer, soapException );
    writer.writeEndDocument();
    writer.close();
}