webservice部署在IIS上后,就无法调用。急!!
webservice部署在IIS上后,就无法调用。在本地测试过都是没有问题的。
webservice:
[WebMethod] public string Test(string a) { return a; }
string url = "http://192.168.138.157/Service1.asmx/Test";HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Method = "Post"; request.ContentType = "application/x-www-form-urlencoded"; //byte[] data = Encoding.UTF8.GetBytes("orderid=123456&unionid=0&areaid=5008&userid=1225782045&gold=100&amount=10&timeid=10000001&sign=96c0a37a51f7108388d3e7ccfcfbd49de1c11af0"); byte[] data = Encoding.UTF8.GetBytes("a=dddfg"); request.GetRequestStream().Write(data, 0, data.Length); StreamReader sr = new StreamReader(request.GetResponse().GetResponseStream()); string ret = sr.ReadToEnd();