Ajadex Ajadex - 2 years ago 813
C# Question

How can I communicate with the Kronos API?

I have a Kronos entry point http://kronos../wfc/XmlService that I should be able to access however when I open it in the brower the response is:

<Response Status="Failure" ErrorCode="1332" Message="WFP-01110 The MIME type of the request is invalid. Type Found: . Valid types: text/xml, application/xml."></Response>

What should I do to use the web services?

By the way, I'm using C# to communicate with the server.


Answer Source

You get that with the brower because the Kronos server only support POST requests and the Browser is issuing a GET Request. The reason for that is because Kronos requires an XML in the body and the POST is the most adecuate method to do so.

The way to access the Kronos XML API, is making a WebRequest to the URL you have with the Method set to POST like this:

HttpWebRequest reqFp = (HttpWebRequest)HttpWebRequest.Create(KronosServerUrl);
reqFp.Method = "POST";
reqFp.ContentType = "text/xml";

Note how the ContentType is also set to text/xml.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download