|
Hi,
I developed code for windows service to find particular web service is working on a particular system.
I have developed code like this whether particular web service existing or not in a particular system.
Sending results to eventlog.
I referred interop.msxml.dll
private int testWebService()
{
try
{
MSXML.XMLHTTPRequest tempXML;
string strURL;
int tempid;
tempXML = new MSXML.XMLHTTPRequest();
strURL = "http://localhost/testws/Service.asmx";
tempXML.open("GET", strURL, false, "", "");
tempXML.send("");
tempid = tempXML.status;
return tempid;
}
catch (Exception ex)
{
return 0;
}
It is working fine in my system.
I configured same in other system in this domain only.
It is showing error like
"encountered an error 'Unable to cast COM object of type 'MSXML.XMLHTTPRequestClass' to interface type 'MSXML.IXMLHttpRequest'."
Please let me know, why am i getting this error and how to resolve this??
Regards,
gem
|
|
|
This is the solution.
Instead of MSXML.XMLHTTPRequest use HttpWebRequest
like
String sSourceURL = "http://localhost/testws/service.asmx";
System.Uri myUri;
myUri = new System.Uri(sSourceURL);
HttpWebRequest HttpWRequest;
HttpWRequest = (HttpWebRequest)WebRequest.Create(myUri);
HttpWebResponse HttpWResponse;
HttpWResponse = (HttpWebResponse)HttpWRequest.GetResponse();
int iStatCode = (int)HttpWResponse.StatusCode;
return iStatCode;
|
|
|
Ground shaking content i get form your blog. Very nice post about web service - com. Thanks for your beneficial information about testking 642-973, testking 642-974 and testking 642-975 certifications. These are the best certifications in the world.
|
|
|
Hi there,
I'm new in this forum. I just want to add some information about this windows services. Improving windows services depends on what enabled/disabled or automatic/manual on your operating system.
Before you begin, it is important to remember that if a particular service is disabled, any other service/services that explicitly depend on it will fail to start. You must be careful and make sure on the services does/does not do.
Adjusting services settings incorrectly has the potential to leave your Windows computer in an unbootable condition. It’s important that before you begin making changes to system services in Windows, you have fully functional backups of your system/data.
For more information just view this site;
-http://www.speedypc.net/articles/improve_windows_services.aspx
|
|
|
|
|
|
|
|
|
|