2
我有一个方法,web服务,其临危XML作为字符串:Web服务调用的Web方法
[WebMethod]
public int Catch_string(string str)
{
}
我怎么能发送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();
为什么不使用Visual Studio生成Web服务代理(添加Web引用)并以这种方式调用Web服务? – 2010-09-21 04:22:29
我添加了对web服务的引用,下一步是什么?并没有说这个网络方法保存这个文件在服务器上,顺便说一句。 – eba 2010-09-21 04:32:32