tags:

views:

17

answers:

1

Mono won't fire the following code: I get internal server error 500, error writing request error. Code works perfectly under normal .net.... any ideas why its broken and how to fix it?

 [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""&gt;
 <soap:Body>
   <DummyOperation xmlns=""http://mynamespace.com""&gt;      
   </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();
    }
  }
+3  A: 

Have you tried this Visual Studio plugin to see if your code is mono ready? This might be a better question for stackoverflow ....

Kyle Brandt