Thank you for your feedback.
Form temporarily unavailable. Please try again or contact to submit your comments.

Recordless SOAPMessageV2 example

Log in to subscribe to topics and get notified when content changes.

Recordless SOAPMessageV2 example

You can use the SOAPMessageV2() constructor with no parameters to define a SOAP message entirely in the script.

When using this constructor you must provide an endpoint and SOAP action. In this example, the script creates an empty SOAP message and sets the values needed to insert an incident record.

var s = new sn_ws.SOAPMessageV2(); //create an empty SOAP message
s.setSOAPAction(''); //set the SOAP action to perform
s.setEndpoint('http://<instance>'); //set the web service provider endpoint
s.setRequestBody('<soapenv:Envelope xmlns:soapenv=\"\" xmlns:inc=\"\"><soapenv:Header/><soapenv:Body><inc:insert><short_description>Test Dynamic SOAP</short_description></inc:insert></soapenv:Body></soapenv:Envelope>');
var response = s.execute();
var xmldoc = new XMLDocument(response.getBody());
var incident_sysid = xmldoc.getNodeText('//sys_id');