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.
Please note that on Saturday, April 11, 2026, at 8:00 PM Pacific time, our Case Management System will undergo a scheduled maintenance for approximately 30 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
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