当我运行下面的代码时,我收到错误,例如 ex = {“远程服务器返回错误:(500) 内部服务器错误。”} 谁能帮我解决这个问题...
HttpWebRequest request = WebRequest.Create("http://project.i-engage.org/tasks/webservices/bugnetservices.asmx/GetCategories?ProjectID=17") as HttpWebRequest;
request.Credentials = new NetworkCredential("rolland", "409cleaner");
request.ContentType = "application / json; charset = utf - 8";
request.Method = "POST";
using (Stream stm = request.GetRequestStream())
{
using (StreamWriter stmw = new StreamWriter(stm))
{
stmw.Write(soap);
}
}
// Get response
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
// Get the response stream
StreamReader reader = new StreamReader(response.GetResponseStream());
// Console application output
Console.WriteLine(reader.ReadToEnd());
}