Hi there,
I am attempting to run the following suitescript code when a sales order is saved in netsuite.
function connectionsProcess( ) { /* service URL for US address verification web service. */ var strikeIronServiceUrl = 'http://<span style="text-decoration:underline"><span style="color:'#666666'">myurl.co.uk</span></span>/connectionsProcess.asmx'; var salesOrderInternalId = '44332'; var runType = 'internal'; var response = null; var serviceUrl = strikeIronServiceUrl; var soapBody = wrapSoapBody( salesOrderInternalId, runType ); var soapPayload = wrapPayload( soapBody ); var soapHeaders = new Array(); /* Add required SOAP header indicating the intent of this service call. */ soapHeaders['SOAPAction'] = 'http://myurl.co.uk/connectionsProcess.asmx'; response = nlapiRequestURL( strikeIronServiceUrl, soapPayload, soapHeaders ); var responseCode = response.getCode(); var soapText = response.getBody(); var soapXML = nlapiStringToXML( soapText ); var ResponseInfo = nlapiSelectNode( soapXML, "//*[name()='startConnectionsProcessResponse']" ); var ResponseCode = nlapiSelectValue( ResponseInfo, "//*[name()='startConnectionsProcessResult']" ) } function wrapPayload(payload) { var soap = ''; soap += '&lt;soap:Envelope xmlns:soap="<a target="_blank" href="http://schemas.xmlsoap.org/soap/envelope/"'">http://schemas.xmlsoap.org/soap/envelope/"'</a>; soap += ' xmlns:xsi="<a target="_blank" href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>" xmlns:s="<a target="_blank" href="http://www.w3.org/2001/XMLSchema"'">http://www.w3.org/2001/XMLSchema"'</a>; soap += ' xmlns:enc="<a target="_blank" href="http://schemas.xmlsoap.org/soap/encoding">'">http://schemas.xmlsoap.org/soap/encoding"&gt;'</a>; soap += payload; soap += '&lt;/soap:Envelope&gt;'; return soap; } function wrapSoapBody(salesOrderInternalId, runType) { var soap = ''; soap += '&lt;soap:Body&gt;'; soap += '&lt;startConnectionsProcess xmlns="<a target="_blank" href="http://myurl.co.uk/">'">http://myurl.co.uk/"&gt;'</a>; soap += '&lt;salesOrderInternalId&gt;'+salesOrderInternalId+'&lt;salesOrderInternalId&gt;'; soap += '&lt;runType&gt;'+runType+'&lt;/runType&gt;'; soap += '&lt;/startConnectionsProcess&gt;'; soap += '&lt;/soap:Body&gt;'; return soap; } It currently fails with the following message:<span style="font-size:'2'"> Date & Time: 2/19/2007 4:29 pm Record Type: Sales Order Internal ID: 44332 Execution Time: 0.58s Script Usage: 10 Script: connectionsProcess() Error: SSS_MISSING_REQD_ARGUMENT nlapiStringToXML: Missing a required argument: text Stack Trace: #connectionsProcess() </span>
If the web service is being called, the response should return the argument that is reported missing. Therefore the web service cannot be getting called. Can you please help me? what i am doing wrong here? Can someone post a simple example of a working web service call from server side suitescript?