SipUssdMessage implements XMLSerializable { public String getUssdString() { return ussdString; } SipUssdMessage();  SipUssdMessage(String ussdString, String language);  SipUssdMessage(int errorCode);  SipUssdMessage(CBSDataCodingScheme dataCodingScheme, USSDString sourceUSSDString);  SipUssdMessage(SipUssdErrorCode sipUssdErrorCode); String getLanguage(); String getUssdString(); int getErrorCodeNumeric(); SipUssdErrorCode getErrorCode(); AnyExt getAnyExt(); void setAnyExt(AnyExt anyExt); boolean isSuccessMessage(); boolean isErrorMessage(); static CBSDataCodingScheme getCBSDataCodingSchemeForLanguage(String language); CBSDataCodingScheme getCBSDataCodingScheme(); USSDString getUSSDString(MAPProvider mapProvider); MAPErrorMessage getMAPErrorMessage(MAPProvider mapProvider); @Override String toString(); static final String USSD_DATA; static final String LANGUAGE; static final String USSD_STRING; static final String ERROR_CODE; static final String ANY_EXT; }
@Test(groups = { "Sip" }) public void testXMLSerialize2() throws Exception { byte[] bt = new byte[] { 0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x27, 0x31, 0x2e, 0x30, 0x27, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x27, 0x55, 0x54, 0x46, 0x2d, 0x38, 0x27, 0x3f, 0x3e, 0x0a, 0x3c, 0x75, 0x73, 0x73, 0x64, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3e, 0x0a, 0x3c, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x22, 0x61, 0x72, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x75, 0x73, 0x73, 0x64, 0x2d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x22, (byte) 0xd8, (byte) 0xa7, (byte) 0xd8, (byte) 0xae, (byte) 0xd8, (byte) 0xaa, (byte) 0xd8, (byte) 0xb1, 0x20, (byte) 0xd9, (byte) 0x85, (byte) 0xd9, (byte) 0x86, 0x20, (byte) 0xd8, (byte) 0xa7, (byte) 0xd9, (byte) 0x84, (byte) 0xd8, (byte) 0xaa, (byte) 0xd8, (byte) 0xa7, (byte) 0xd9, (byte) 0x84, (byte) 0xd9, (byte) 0x8a, 0x26, 0x23, 0x78, 0x61, 0x3b, 0x31, 0x20, (byte) 0xd8, (byte) 0xa7, (byte) 0xd9, (byte) 0x84, (byte) 0xd8, (byte) 0xac, (byte) 0xd9, (byte) 0x88, 0x26, 0x23, 0x78, 0x61, 0x3b, 0x32, 0x20, (byte) 0xd8, (byte) 0xa7, (byte) 0xd9, (byte) 0x84, (byte) 0xd8, (byte) 0xb1, (byte) 0xd8, (byte) 0xb5, (byte) 0xd9, (byte) 0x8a, (byte) 0xd8, (byte) 0xaf, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x61, 0x6e, 0x79, 0x45, 0x78, 0x74, 0x3e, 0x0a, 0x3c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3e, 0x75, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x64, 0x53, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x3c, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3e, 0x0a, 0x3c, 0x2f, 0x61, 0x6e, 0x79, 0x45, 0x78, 0x74, 0x3e, 0x0a, 0x3c, 0x2f, 0x75, 0x73, 0x73, 0x64, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x3e }; String templ = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><ussd-data><language value=\"en\"/><ussd-string value=\"AAAA&#xa;BBB\"/></ussd-data>"; SipUssdMessage copy = factory.deserializeSipUssdMessage(templ.getBytes()); char[] ch = copy.getUssdString().toCharArray(); int[] ii1 = new int[ch.length]; for (int i = 0; i < ch.length; i++) { ii1[i] = ch[i]; } int ggg = 0; ggg++; }