Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
httpResponse.getBody() returning null
I have a suitelet that post an xml to a php page.
It is supposed to return an xml.
I am getting back this xml and I can see it in the page.
response.write( httpResponse.getBody() );
But the getBody function is returning null.
httpResponse.getBody()
Am I doing anything wrong here?
Thanks!
var urlString = "http://...xxx.aspx"; var postXML = createPOXMLxxx(); nlapiLogExecution('DEBUG', "postXML ", postXML); var headerParams = new Array(); headerParams['Content-type'] = "text/xml; charset=UTF-8"; var httpResponse = nlapiRequestURL(urlString, postXML, headerParams, "POST"); var xmlResponse = nlapiStringToXML(httpResponse.getBody()); var strResponse = nlapiXMLToString(xmlResponse); nlapiLogExecution('DEBUG',"xmlResponse = "+xmlResponse); nlapiLogExecution('DEBUG',"strResponse = "+strResponse); nlapiLogExecution('DEBUG',"httpResponse = "+httpResponse); nlapiLogExecution('DEBUG',"error = "+httpResponse.getError()); nlapiLogExecution('DEBUG',"httpResponse code= "+httpResponse.getCode()); nlapiLogExecution('DEBUG',"httpResponse body= "+httpResponse.getBody()); //GET PRICE FROM THE RESPONSE XML var success = strResponse.indexOf("<OK>") nlapiLogExecution('DEBUG',' success = '+success); response.write( httpResponse.getBody() );
0