ASP. NET calls the WS (Get) method manually:
The call is simulated by hand httpwebrequest,httpwebresponse.
Core code:
String strurl= "Http://localhost:21696/service1.asmx/getmythod?aa=1";
HttpWebRequest request= (HttpWebRequest) webrequest.creates (strURL);
Request. Method= "Get"
HttpWebResponse response= (System.Net.HttpWebResponse) request. GetResponse ();
Stream S=response. GetResponseStream ();
XmlTextReader reader=new XmlTextReader (s);
Reader.movetocontent ();
String Strvalue=reader.readerinnerxml ();
Strvalue=strvalue.replace ("<", "<");
Strvalue=strvalue.replace (">", ">");
Regex rx=new Regex (@ "(\r\n+)");
strvalue =rx. Replace (strvalue, "");
Div1. Innerhtml=strvalue;
Reader.close ();
Note: WebService is located in the Web. config to add:
<webServices>
<protocols>
<add name= "HttpPost"/>
<add name= "HttpGet"/>
</protocols>
</webServices>
Increased security risk
ASP. NET calls the WS (Get) method manually: