c# - How to get status of web service -


how can status of web service using c#? whether completed successfully, failed or pending this.

first found question web service database/website status

and should try code;

system.serviceprocess.servicecontroller sc = new system.serviceprocess.servicecontroller("myservice"); return sc.status 

and should examine code;

public static string pinghost(string args)           {               httpwebresponse res = null;                try              {                   // create request passed uri.                   httpwebrequest req = (httpwebrequest)webrequest.create(args);                   req.credentials = credentialcache.defaultnetworkcredentials;                    // response object.                   res = (httpwebresponse)req.getresponse();                    return "service up";               }               catch (exception e)               {                   messagebox.show("source : " + e.source, "exception source", messageboxbuttons.ok);                   messagebox.show("message : " + e.message, "exception message", messageboxbuttons.ok);                   return "host unavailable";               }           }  

and should look;

using session state in web service


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -