public void GetText() { foreach (string url in testUrls) { string text = XmlHttpClient.GetText(url + XmlHttpMethods.GetText, true); Assert.IsNotEmpty(text, "url=" + url); Console.WriteLine("GetText() called. url=" + url); Console.WriteLine("returns = " + text); } }
/// <summary> /// HTTP GET 방식으로 서버로부터 XML 정보를 얻는다. /// </summary> /// <param name="uri">서버 주소</param> /// <param name="isAsync">비동기 여부</param> /// <param name="timeoutMilliseconds">통신 Timeout (단위: milliseconds)</param> /// <param name="userId">계정 Id</param> /// <param name="password">계정 비밀번호</param> /// <returns>응답 내용 (XML 문자열)</returns> public static string GetText(string uri, bool isAsync = false, int timeoutMilliseconds = System.Threading.Timeout.Infinite, string userId = null, string password = null) { uri.ShouldNotBeWhiteSpace("uri"); if(IsDebugEnabled) log.Debug( "XmlHttp 통신... 일반 Text 형식으로 GET... uri=[{0}], isAsync=[{1}], timeoutMilliseconds=[{2}], userId=[{3}], password=[{4}]", uri, isAsync, timeoutMilliseconds, userId, password); var xmlHttp = new XmlHttpClient(uri, isAsync, timeoutMilliseconds, userId, password); return xmlHttp.GetText(); }
/// <summary> /// HTTP GET 방식으로 서버로부터 XML 정보를 얻는다. /// </summary> /// <param name="uri">서버 주소</param> /// <param name="isAsync">비동기 여부</param> /// <param name="timeoutMilliseconds">통신 Timeout (단위:milliseconds)</param> /// <param name="userId">계정 Id</param> /// <param name="password">계정 비밀번호</param> /// <returns>응답 내용 (XML 문자열)</returns> public static string GetText(string uri, bool isAsync = false, int timeoutMilliseconds = System.Threading.Timeout.Infinite, string userId = null, string password = null) { uri.ShouldNotBeWhiteSpace("uri"); if(IsDebugEnabled) log.Debug("GetText... uril=[{0}], isAsync=[{1}], timeoutMilliseconds=[{2}], userId=[{3}], password=[{4}]", uri, isAsync, timeoutMilliseconds, userId, password); var xmlHttp = new XmlHttpClient(uri, isAsync, timeoutMilliseconds, userId, password); var result = xmlHttp.GetText(); if(IsDebugEnabled) log.Debug("GetText uri=[{0}], result=[{1}]", uri, result.EllipsisChar(255)); return result; }
/// <summary> /// HTTP GET 방식으로 서버로부터 XML 정보를 얻는다. /// </summary> /// <param name="uri">서버 주소</param> /// <param name="isAsync">비동기 여부</param> /// <param name="timeoutMilliseconds">통신 Timeout (단위: milliseconds)</param> /// <param name="userId">계정 Id</param> /// <param name="password">계정 비밀번호</param> /// <returns>응답 내용 (XML 문자열)</returns> public static string GetText(string uri, bool isAsync = false, int timeoutMilliseconds = System.Threading.Timeout.Infinite, string userId = null, string password = null) { uri.ShouldNotBeWhiteSpace("uri"); if (IsDebugEnabled) { log.Debug( "XmlHttp 통신... 일반 Text 형식으로 GET... uri=[{0}], isAsync=[{1}], timeoutMilliseconds=[{2}], userId=[{3}], password=[{4}]", uri, isAsync, timeoutMilliseconds, userId, password); } var xmlHttp = new XmlHttpClient(uri, isAsync, timeoutMilliseconds, userId, password); return(xmlHttp.GetText()); }
/// <summary> /// HTTP GET 방식으로 서버로부터 XML 정보를 얻는다. /// </summary> /// <param name="uri">서버 주소</param> /// <param name="isAsync">비동기 여부</param> /// <param name="timeoutMilliseconds">통신 Timeout (단위:milliseconds)</param> /// <param name="userId">계정 Id</param> /// <param name="password">계정 비밀번호</param> /// <returns>응답 내용 (XML 문자열)</returns> public static string GetText(string uri, bool isAsync = false, int timeoutMilliseconds = System.Threading.Timeout.Infinite, string userId = null, string password = null) { uri.ShouldNotBeWhiteSpace("uri"); if (IsDebugEnabled) { log.Debug("GetText... uril=[{0}], isAsync=[{1}], timeoutMilliseconds=[{2}], userId=[{3}], password=[{4}]", uri, isAsync, timeoutMilliseconds, userId, password); } var xmlHttp = new XmlHttpClient(uri, isAsync, timeoutMilliseconds, userId, password); var result = xmlHttp.GetText(); if (IsDebugEnabled) { log.Debug("GetText uri=[{0}], result=[{1}]", uri, result.EllipsisChar(255)); } return(result); }