public static string GenerateXML(WebResponse response) { var xml = new XmlSerializer(typeof(WebResponse)); using (var writer = new StringWriter()) { xml.Serialize(writer, response); return writer.ToString(); } }
public static string CheckAPIKey(string apiKey, string requiredAPIKey) { if (apiKey != requiredAPIKey) { var response = new WebResponse(ResponseTypes.Error) { ErrorMessage = "Invalide API Key" }; return ResponseTool.GenerateXML(response); } return null; }