调用Web服务时如何传递参数?
我的 C# 代码是:
public partial class CityBlog : PhoneApplicationPage
{
string str = "";
public CityBlog()
{
InitializeComponent();
WebClient wc = new WebClient();
wc.DownloadStringAsync(new Uri("http://kcspl.in/nadalapp.asmx/GetCityBlog"));
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted);
}
void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
str = e.Result.Replace("</string>", "");
str = str.Replace("<?xml version=\"1.0\" encoding=\"utf-8\"?>", "");
str = str.Replace("<string xmlns=\"http://tempuri.org/\">", "");
}
请参见上面的 Uri 语句。那个 Uri 是我的网络服务链接,GetCityBlog
也是我的网络服务类,但在这个网络服务中,我想添加类似id=1
. 如何添加此类参数?