Esempio n. 1
0
		public static string GenerateXML(WebResponse response)
		{
			var xml = new XmlSerializer(typeof(WebResponse));
			using (var writer = new StringWriter())
			{
				xml.Serialize(writer, response);
				return writer.ToString();
			}
		}
Esempio n. 2
0
		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;
		}