Last post Aug 19, 2014 03:27 AM by AidyF
Aug 19, 2014 02:12 AM|jjbhatt_asp|LINK
I want to access the web service but unable to access it.
Please let me know how would i be able to do it.
i am doing this but i use to get error underlying connection was closed.
I just want to get method get_sysinfo()
WebRequest request = WebRequest.Create("https://ipaddress/webservice/xxxx.wsdl");
HttpWebRequest httpRequest = (HttpWebRequest)request;
httpRequest.Method = "POST";
httpRequest.ContentType = "text/xml";
Stream requestStream = httpRequest.GetRequestStream();
WebResponse webResponse = httpRequest.GetResponse();
Stream responseStream = webResponse.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream);
string s = streamReader.Read().ToString();
Aug 19, 2014 03:27 AM|AidyF|LINK
Is there a reason you are accessing the wsdl file? The path to the wsdl file is what you give Visual Studio in the "Add service reference->Advanced->Add web reference" dialog. It provides clients with the info they need to build proxy classes that you
use. The methods themselves aren't accessed via the wsdl. Google for using a web service from c# for examples, or contact the provider of the service for documentation on what the methods are.