我有一个webservice,它有一个将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();
发布于 2010-09-21 12:35:57
将webreference添加到winforms应用程序中,并使用生成的代理类来调用and服务。
有关实现的详细信息,请查看此link。
https://stackoverflow.com/questions/3757272
复制相似问题