--- title: Recordless SOAPMessageV2 example description: You can use the SOAPMessageV2\(\) constructor with no parameters to define a SOAP message entirely in the script. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/web-services/r\_RecordlessSOAPMessageV2Example.html release: australia product: Web Services classification: web-services topic_type: reference last_updated: "2026-03-12" reading_time_minutes: 1 breadcrumb: [Scripting outbound SOAP, SOAP, Outbound, Web services, API implementation, API implementation and reference] --- # 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.setBasicAuth('admin','admin'); s.setSOAPAction('http://www.service-now.com/incident/insert'); //set the SOAP action to perform s.setEndpoint('http://.service-now.com/incident.do?SOAP'); //set the web service provider endpoint s.setRequestBody('Test Dynamic SOAP'); var response = s.execute(); var xmldoc = new XMLDocument(response.getBody()); var incident_sysid = xmldoc.getNodeText('//sys_id'); ``` **Parent Topic:**[Scripting outbound SOAP](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/web-services/r_ScriptingOutboundSOAP.md)