以下のコードを実行すると、ex = {"The remote server returned an error: (500) Internal Server Error."} のようなエラーが発生します。この問題を解決する方法を教えてください...
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());
}