Esempio n. 1
0
        private string GetSoapString(SoapHeader header)
        {
            XmlDocument   doc    = new XmlDocument();
            StringBuilder sbSoap = new StringBuilder();

            sbSoap.Append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
            sbSoap.Append("<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ");
            sbSoap.Append(" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"> ");
            if (header != null)
            {
            }

            sbSoap.Append("<soap:Body>");
            sbSoap.Append("<").Append(_str_Action).Append(" xmlns=\"").Append(_str_NameSpace).Append("\"").Append(">");
            if (null != _ht_Args && 0 < _ht_Args.Count)
            {
                foreach (string strKey in _ht_Args.Keys)
                {
                    sbSoap.Append("<").Append(strKey).Append(">");
                    sbSoap.Append(_ht_Args[strKey]);
                    sbSoap.Append("</").Append(strKey).Append(">");
                }
            }
            sbSoap.Append("</").Append(_str_Action).Append(">");
            sbSoap.Append("</soap:Body>");
            sbSoap.Append("</soap:Envelope>");
            return(sbSoap.ToString());
        }
Esempio n. 2
0
 public DynamicService(string url, string nameSpace = null, SoapHeader header = null)
 {
     this.url    = url;
     this.header = header;
     if (!string.IsNullOrEmpty(nameSpace))
     {
         this.nameSpace = nameSpace;
     }
 }