代码不会在单声道下工作,任何想法都错了吗?

时间:2009-08-07 12:56:04

标签: apache mono

Mono不会触发以下代码:我收到内部服务器错误500,错误写入请求错误。代码在正常的.net下完美运行....任何想法为什么破坏它以及如何修复它?

 [WebServiceBinding]
  public class testService : System.Web.Services.Protocols.SoapHttpClientProtocol
   {

       private string DummySoapRequest = @"<?xml version=""1.0"" encoding=""utf-8""?>
      <soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/""   xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
 <soap:Body>
   <DummyOperation xmlns=""http://mynamespace.com"">      
   </DummyOperation>
  </soap:Body>
 </soap:Envelope>";

public void SendDummyRequest()
{
    System.Net.WebRequest req = GetWebRequest(new Uri(Url));
    req.Headers.Add("SOAPAction", "");
    req.ContentType = "text/xml;charset=\"utf-8\"";
    req.Method = "POST";

    using (Stream stm = req.GetRequestStream())
    {
        using (StreamWriter stmw = new StreamWriter(stm))
        {
            stmw.Write(DummySoapRequest);
        }
    }
    System.Net.WebResponse response = req.GetResponse();
    }
  }

1 个答案:

答案 0 :(得分:3)

您是否尝试过此Visual Studio plugin来查看您的代码是否已准备就绪?这可能是stackoverflow的一个更好的问题....