public static string ConvertToXML(byte[] wbxml) { string xml; WBXMLConvWBXML2XMLParams parms = new WBXMLConvWBXML2XMLParams(); parms.gen_type = WBXML_ENCODER_XML_GEN_CANONICAL; parms.lang = WBXML_LANG_AIRSYNC; parms.indent = 0; parms.keep_ignorable_ws = 0; UInt32 retval = wbxml_conv_wbxml2xml(wbxml, wbxml.Length, out xml, ref parms); if (retval == 0) { // skip the document type part, which is quite bogus anyway return xml.Substring(104); } else { throw new Exception(String.Format("Failed to parse wbxml: {0}", retval)); } }
public static string ConvertToXML(byte[] wbxml) { string xml; WBXMLConvWBXML2XMLParams parms = new WBXMLConvWBXML2XMLParams(); parms.gen_type = WBXML_ENCODER_XML_GEN_CANONICAL; parms.lang = WBXML_LANG_AIRSYNC; parms.indent = 0; parms.keep_ignorable_ws = 0; UInt32 retval = wbxml_conv_wbxml2xml(wbxml, wbxml.Length, out xml, ref parms); if (retval == 0) { // skip the document type part, which is quite bogus anyway return(xml.Substring(104)); } else { throw new Exception(String.Format("Failed to parse wbxml: {0}", retval)); } }
protected static extern UInt32 wbxml_conv_wbxml2xml( byte[] wbxml, int wbxml_size, out string xml, ref WBXMLConvWBXML2XMLParams parms);