public static string[] TestGet() { String Url = "http://localhost:8080/Loom/factory/get.do"; Hashtable pars = new Hashtable(); pars["id"] = 1; XmlDocument doc = WebServiceCall.QuerySoapWebService(Url, "getMessages", pars); String sDoc = doc.InnerXml; //获得正文内容 return(processSms(sDoc)); }
public static string[] receiverSMS() //接收短信函数 { String Url = "http://122.224.69.42:8181/axis/SendAndGetMessage.jws"; Hashtable pars = new Hashtable(); pars["mainphone"] = s_number; pars["password"] = s_password; XmlDocument doc = WebServiceCall.QuerySoapWebService(Url, "getMessages", pars); String sDoc = doc.InnerXml; //获得正文内容 return(processSms(sDoc)); }
private static Hashtable _xmlNamespaces = new Hashtable(); //缓存xmlNamespace,避免重复调用GetNamespace public static bool sendSMS(String target, String content) //发送短信函数 { String Url = "http://122.224.69.42:8181/axis/SendAndGetMessage.jws"; Hashtable pars = new Hashtable(); pars["mainphone"] = s_number; pars["password"] = s_password; pars["targetnumber"] = target; pars["content"] = content; try { XmlDocument doc = WebServiceCall.QuerySoapWebService(Url, "sendMessages", pars); return(true); } catch (System.Exception ex) { CLog4net.LogError("sendsms " + ex.ToString()); return(false); } }