예제 #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();
			}
		}
예제 #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;
		}