This issue is that running the code in the foreground works but once run it the background it gets a 500 error, we need someone to resolve this error.
Window console Application for Fetching Camera details in Milestone management server
1. Calling a web service (http://localhost/ServerAPI/[login to view URL]) for getting XML file at run time data.
The SOAP method GetConfiguration provides more info per camera, and information about other device types.
2. Web service return XML file which contain Camera IP and respective Metadata.
3. Required IP and Metadata is getting by parsing the XML
Typical operations on this SOAP service are:
1. Logon via Active Directory and retrieve an XProtect token for e.g. the ImageServer Protocol
2. Retrieve configuration (if on a XProtect Corporate system)
3. Trigger user-defined events with or without metadata (e.g. camera guids)
4. Create and query bookmarks related to a camera
Running console Application as background service:
1. Calling a web service (http://localhost/ServerAPI/[login to view URL]) for getting XML file at run time data.
Throws Exception: The remote server returned an error: (500) Internal Server Error. at [login to view URL]()
In milestone asp.net web app that dynamically generates an XML file and sends it to a [login to view URL] web service
Things were great in calling console application and Scheduled it in Task scheduler.
But when set to Service (background task) it throws this error --> The remote server returned an error: (500) Internal Server Error. at [login to view URL]()
public void Cam()
{
[login to view URL](@"C:\temp\[login to view URL]", [login to view URL]("Started on {0} {1}", [login to view URL] + " " + [login to view URL], [login to view URL]));
String xmlStr = readXmlFile("http://localhost/ServerAPI/[login to view URL]");
}
private String readXmlFile(String urlStr)
{
[login to view URL](@"C:\temp\[login to view URL]", [login to view URL]("Started on {0} {1}", [login to view URL] + " " + [login to view URL], [login to view URL]));
try
{
HttpWebRequest request = (HttpWebRequest)[login to view URL](urlStr);
[login to view URL] = [login to view URL];
HttpWebResponse response = (HttpWebResponse)[login to view URL]();
Stream iDataStream = [login to view URL]();
StreamReader reader = new StreamReader(iDataStream);
string xmlStr = [login to view URL]();
[login to view URL]();
[login to view URL]();
[login to view URL]();
return xmlStr;
}
catch (Exception e)
{
[login to view URL](@"C:\temp\[login to view URL]", [login to view URL]("Started on {0} {1}", [login to view URL] + " " + DateTime.Now.Millisecond+ " "+e.Message+ " HResult" + [login to view URL] + " [login to view URL] "+ [login to view URL], [login to view URL]));
return "";
}
Hello, can you give me access to sort it out for you. i have experience in c# and also know milestone but iam sure milestone knowledge is not required here
Dear Sir/Madam,
Greetings for the day!
I am Krunal, having 12+ years of exp. having completed majority of projects with MS technologies.
I have resolved many issues in my career. I am confident i can resolve the issue in around 4-5 hours and can deliver you resolved code,
Looking forward to resolve the error and further work.
Regards,
Krunal Doshi.
Hi, I am a Full stack developer in Microsoft technologies.
My area of expertise is web application development (asp.Net web forms, MVC, classic ASP), web services (SOAP & RESTFul), MySql & Sql Server as back end (through stored procedures).
I have 6 plus years of experience as a full time software developer.
Kindly contact me, lets discuss your requirements.