I would like to ask if how can I call the PHP SOAP functions of the app using nlapiRequestURL() of NetSuite? So far this is what I have, nlapiRequestURL() but I want to know if how can I use the functions of the wsdl URL. Thanks!
Asked
Active
Viewed 277 times
2 Answers
0
It's going to be very difficult since NetSuite doesn't include a SOAP client. There are JS SOAP libraries you might get to work, but I wouldn't count on it. See if you app has a REST interface as well, which will be much easier to use. You can checkout a similar question here
Another approach would be to put your custom code inside your PHP app, and have it talk to NetSuite's SOAP interface instead.
0
You would have to construct the xml and pass it with nlapiRequestURL. Something like this:
var postBody = '<?xml version="1.0" encoding="UTF-8" ?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Header><sapsess:Session xmlns:sapsess="http://www.sap.com/webas/630/soap/features/session/"><enableSession>true</enableSession></sapsess:Session></SOAP-ENV:Header><SOAP-ENV:Body><ns1:Ztest xmlns:ns1="urn:sap-com:document:sap:soap:functions:mc-style"></ns1:Ztest></SOAP-ENV:Body></SOAP-ENV:Envelope>';
var headers = {"Content-type": "application/xml"};
var url = 'http://sapserver/sap/bc/srt/rfc/sap/ztest/200/ztest/binding';
var aResponse = nlapiRequestURL(url, postBody, headers, 'POST');

Adolfo Garza
- 2,966
- 12
- 15