I’m unable to receive the xml data from my rest POST.
Here is my URL:
When I type my URL directly in my browser (Chrome) I get the xml result; no problem.
To make sure that it is not my code that is faulty, I have saved the xml output to an xml file replaced my request from POST to GET and my URL for my xml file and I’m able to retrieve my data and display it.
When I look inside of my serverout0.txt file I can these lines:
[08:00:59:565]|[09-03-2015]|[com.manageengine.servicedesk.sdpapi.servlet.SDPAPIServlet]|[INFO]|[32]|: SDPAPI ENABLED - operation name GET_REQUEST|
[08:00:59:565]|[09-03-2015]|[com.manageengine.servicedesk.sdpapi.servlet.SDPAPIServlet]|[INFO]|[32]|: List of parameters received in API Request [OPERATION_NAME, TECHNICIAN_KEY]|
[08:00:59:565]|[09-03-2015]|[com.manageengine.servicedesk.sdpapi.servlet.SDPAPIServlet]|[INFO]|[32]|: The KEY DO for technician - is empty false|
[08:00:59:565]|[09-03-2015]|[com.adventnet.servicedesk.utils.WOTemplateUtil]|[INFO]|[32]|: WO personality is null, hence fetching the object|
[08:00:59:674]|[09-03-2015]|[com.manageengine.servicedesk.sdpapi.request.SDPAPIRequestUtil]|[INFO]|[32]|: WorkOrder Details Retrieved Successfully for the WorkOrderID: 100217|
[08:00:59:674]|[09-03-2015]|[com.manageengine.servicedesk.sdpapi.servlet.SDPAPIServlet]|[INFO]|[32]|: Writing output response for operation name - GET_REQUEST|
So it does look like I’m hitting the server and the server seems to be sending me back data but it never makes it.
Here is a snippet of my very basic ajax code:
======8<======
$(document).ready(function(){
$("#dvContent").append("<ul></ul>");
$.ajax({
type: "POST",
data: { OPERATION_NAME: "GET_REQUEST", TECHNICIAN_KEY: "9E467594-02CD-490F-9729-CF35E9A411D5" },
dataType: "xml",
success: function(xml){
$(xml).find('parameter').each(function(){
var sName = $(this).find('name').text();
var sValue = $(this).find('value').text();
$("<li></li>").html(sName + ", " + sValue).appendTo("#dvContent ul");
});
},
error: function() {
alert("An error occurred while processing XML.");
}
});
});
======8<======
Any suggestions?
Thx
JEC