我有一个Web服务,其中一个方法接收xml为字符串:
[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();