Description
To improve security, you can set the property to true and call the AddTrustedEntity, DeleteTrustedEntity, and GetTrustedEntitiesAllowedList to prevent XML injection.
Property type
Read-write property
Syntax
| Visual Basic |
|---|
Public Property XmlFiltered() As Boolean |
Example
| C# | Copy Code |
|---|
oCompany.XmlFiltered = true; //add trusted entity int tret = oCompany.AddTrustedEntity(""http://localhost:8800/b1s/v1/Login""); if (tret != 0) { ReportError(oCompany.GetLastErrorCode(), oCompany.GetLastErrorDescription()); return; } oCompany.AddTrustedEntity(""http://localhost:8800/b1s/v1/Items""); //delete trusted entity oCompany.DeleteTrustedEntity(""http://localhost:8800/b1s/v1/Login""); //get trusetd entities Recordset rs = (SAPbobsCOM.Recordset)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset); rs = oCompany.GetTrustedEntitiesAllowedList(); while (!rs.EoF) { int fldCnt = rs.Fields.Count; for (int current = 0; current < fldCnt; ++current) { object val = rs.Fields.Item(current).Value; if (null == val) Console.Out.WriteLine(rs.Fields.Item(current).Name + "" : null""); else Console.Out.WriteLine(rs.Fields.Item(current).Name + "" : "" + val.ToString()); } Console.Out.WriteLine(); rs.MoveNext(); } |
|
See Also