How can I communicate with the Kronos API?

前端 未结 4 1200
北海茫月
北海茫月 2020-12-29 12:39

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:



        
4条回答
  •  再見小時候
    2020-12-29 13:39

    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.

提交回复
热议问题