// This function uses the ASWBXML class to decode // a WBXML stream into XML. private string DecodeWBXML(byte[] wbxml) { try { ASWBXML decoder = new ASWBXML(); decoder.LoadBytes(wbxml); return decoder.GetXml(); } catch (Exception ex) { ASError.ReportException(ex); return ""; } }
// This function uses the ASWBXML class to encode // XML into a WBXML stream. private byte[] EncodeXMLString(string xmlString) { try { ASWBXML encoder = new ASWBXML(); encoder.LoadXml(xmlString); return encoder.GetBytes(); } catch (Exception ex) { ASError.ReportException(ex); return null; } }