我已经从 asp.net Web 应用程序中的 wsdl 文件生成了存根。我的问题是如何将这些函数调用添加到 httpwebrequest?我已经做到了这一点,但不知道如何完成它并将肥皂放在电线上。
public HttpWebRequest CreateWebRequest(string webMethod)
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("");
webRequest.Headers.Add(@"SOAPAction", "\"http://www.multispeak.org/Version_3.0/"+ webMethod +"\"");
webRequest.ContentType = "text/xml;charset=\"utf-8\"";
webRequest.Accept = "text/xml";
webRequest.Method = "POST";
return webRequest;
}
protected void Button1_Click(object sender, EventArgs e)
{
MR_ServerSoapClient soapClient = new MR_ServerSoapClient(endPoint,uri);
PingURLRequest request = new PingURLRequest();
PingURLResponse response = new PingURLResponse();
}