0
我想从REST XML Web服务获取响应,并将其分段为变量,以便我可以在我的程序中使用它们。将REST XML阶段转换为变量
1)这段代码怎么不起作用?我得到一个空字符串...
// Get response
string ws_response="";
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
// Get the response stream
StreamReader reader = new StreamReader(response.GetResponseStream());
// web service response string
ws_response = reader.ReadToEnd; // <---???? I get an empty string
// do phasing here (ie XML element into variable) etc..
//
}