Пример #1
0
        public override XmlDocument RequestWebService(ResquestParams rp)
        {
            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(rp.URL + "/" + rp.MethodName + "?" + ParsToString(rp.Parames));

            request.Method      = "GET";
            request.ContentType = "text/xml; charset=utf-8";
            SetWebRequest(request);
            return(ReadXmlResponse(request.GetResponse()));
        }
        public override XmlDocument RequestWebService(ResquestParams rp)
        {
            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(rp.URL + "/" + rp.MethodName);

            request.Method      = "POST";
            request.ContentType = "application/x-www-form-urlencoded";
            SetWebRequest(request);
            byte[] data = EncodePars(rp.Parames);
            WriteRequestData(request, data);
            return(ReadXmlResponse(request.GetResponse()));
        }
Пример #3
0
 public override XmlDocument RequestWebService(ResquestParams rp)
 {
     if (_xmlNamespaces.ContainsKey(rp.URL))
     {
         return(QuerySoapWebService(rp.URL, rp.MethodName, rp.Parames, _xmlNamespaces[rp.URL].ToString()));
     }
     else
     {
         return(QuerySoapWebService(rp.URL, rp.MethodName, rp.Parames, GetNamespace(rp.URL)));
     }
 }
Пример #4
0
 /// <summary>
 /// 请求WebService
 /// </summary>
 /// <param name="URL">WebService的路径</param>
 /// <param name="MethodName">方法名</param>
 /// <param name="Pars">参数</param>
 /// <returns></returns>
 abstract public System.Xml.XmlDocument RequestWebService(ResquestParams rp);