我有一种将 xml 作为字符串接收的方法的 web 服务:
[WebMethod]
public int Catch_string(string str)
{
}
如何从 win 表单将 xml 文件发送到此方法?
为什么它不起作用^
HttpWebRequest req =
(HttpWebRequest)WebRequest.Create("http://localhost/test/service.asmx");
req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
outXml.Save(stm);
stm.Close();