我写了以下代码来连接Web服务。
WebClient wc = new WebClient();
wc.DownloadStringAsync(new Uri("http://www.Webservices.asmx"));
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted);
void wc_DownloadStringCompleted(object sender,DownloadStringCompletedEventArgs e)
{
Debug.WriteLine("Web service says: " + e.Result);
using (var reader = new StringReader(e.Result))
{
String str = reader.ReadToEnd();
}
}
通过使用上述代码,可以获取字符串结果。但我想在HTMLVisualizer中获取结果,以便我知道有哪些方法可以使用该Web服务,然后我就可以轻松访问特定的方法。请告诉我如何在Windows Phone 7中调用Web服务方法?在Web服务中,我有5个Web方法。如何获取并调用特定的Web方法?感谢您提前告诉我。