Send() public method

Posting request xml document to server
public Send ( XmlDoc requestDoc ) : XmlDoc
requestDoc NSoft.NFramework.Xml.XmlDoc
return NSoft.NFramework.Xml.XmlDoc
Ejemplo n.º 1
0
        /// <summary>
        /// RealWeb XML HTTP 통신 모듈 설정이다.
        /// </summary>
        /// <param name="uri">서버 URI</param>
        /// <param name="document">요청용 RclXmlDocument</param>
        /// <param name="isAsync">비동기 통신 여부</param>
        /// <param name="timeoutMilliseconds">통신 제한시간 (default : System.Threading.Timeout.Infinite)</param>
        /// <param name="userId"></param>
        /// <param name="password"></param>
        /// <returns>응답 XmlDocument</returns>
        public static XmlDoc Send(string uri,
                                  XmlDoc document,
                                  bool isAsync            = false,
                                  int timeoutMilliseconds = System.Threading.Timeout.Infinite,
                                  string userId           = null,
                                  string password         = null)
        {
            uri.ShouldNotBeWhiteSpace("uri");

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

            Guard.Assert(document.IsValidDocument(), @"document object is not valid document.");

            var xmlHttp = new XmlHttpClient(uri, isAsync, timeoutMilliseconds, userId, password);
            var xdoc    = xmlHttp.Send(document);

            if (IsDebugEnabled)
            {
                log.Debug("Send xml... uri=[{0}], result=[{1}]", uri, xdoc.Text);
            }

            return(xdoc);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// RealWeb XML HTTP 통신 모듈 설정이다.
        /// </summary>
        /// <param name="uri">서버 URI</param>
        /// <param name="document">요청용 RclXmlDocument</param>
        /// <param name="isAsync">비동기 통신 여부</param>
        /// <param name="timeoutMilliseconds">통신 제한시간 (default : System.Threading.Timeout.Infinite)</param>
        /// <param name="userId"></param>
        /// <param name="password"></param>
        /// <returns>응답 XmlDocument</returns>
        public static XmlDoc Send(string uri,
                                  XmlDoc document,
                                  bool isAsync = false,
                                  int timeoutMilliseconds = System.Threading.Timeout.Infinite,
                                  string userId = null,
                                  string password = null) {
            uri.ShouldNotBeWhiteSpace("uri");

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

            Guard.Assert(document.IsValidDocument(), @"document object is not valid document.");

            var xmlHttp = new XmlHttpClient(uri, isAsync, timeoutMilliseconds, userId, password);
            var xdoc = xmlHttp.Send(document);

            if(IsDebugEnabled)
                log.Debug("Send xml... uri=[{0}], result=[{1}]", uri, xdoc.Text);

            return xdoc;
        }