Exemple #1
0
        /// <summary>
        /// Post 방식의 XmlHttp 통신. XmlDocument를 받는다.
        /// </summary>
        /// <param name="document"></param>
        /// <returns></returns>
        public XmlDocument PostXml(XmlDocument document) {
            document.ShouldNotBeNull("requestDoc");
            Guard.Assert(document.IsValidDocument(), @"document is not valid xml document.");

            using(Stream stream = PostStream(document)) {
                return XmlTool.CreateXmlDocument(stream);
            }
        }
Exemple #2
0
        /// <summary>
        /// HTTP POST 방식으로 응답을 받아 <see cref="XmlDocument"/> 의 인스턴스로 빌드하여 반환한다.
        /// </summary>
        /// <param name="uri">응답받을 서버 주소</param>
        /// <param name="document">응답 요청시의 Form Parameter 정보</param>
        /// <param name="isAsync">비동기 여부</param>
        /// <param name="timeoutMilliseconds">통신 Timeout</param>
        /// <param name="userId">계정 Id</param>
        /// <param name="password">계정 비밀번호</param>
        /// <returns>응답정보를 담은 <see cref="XmlDocument"/></returns>
        public static XmlDocument PostXml(string uri,
                                          XmlDocument document,
                                          bool isAsync = false,
                                          int timeoutMilliseconds = System.Threading.Timeout.Infinite,
                                          string userId = null,
                                          string password = null) {
            uri.ShouldNotBeWhiteSpace("uri");
            document.ShouldNotBeNull("document");
            Guard.Assert(document.IsValidDocument(), "document is not valid xml document.");

            if(IsDebugEnabled) {
                log.Debug("PostXml... uri=[{0}], isAsync=[{1}], timeout=[{2}], userId=[{3}], password=[{4}], document=[{5}]",
                          uri, isAsync, timeoutMilliseconds, userId, password, document);

                if(document != null)
                    log.Debug("PostXml FormData=[{0}]", document.InnerXml);
            }

            var xmlHttp = new XmlHttpClient(uri, isAsync, timeoutMilliseconds, userId, password);
            return xmlHttp.PostXml(document);
        }
Exemple #3
0
        /// <summary>
        /// 생성자 - <paramref name="document"/>을 읽어서 새로운 <see cref="XmlDocument"/> 인스턴스를 생성한다.
        /// </summary>
        /// <param name="document">원본 XmlDocument</param>
        public XmlDoc(XmlDocument document) {
            document.ShouldNotBeNull("document");
            Guard.Assert(document.IsValidDocument(), "Invalid content of xml document.");

            LoadXml(document.OuterXml);
        }