--- title: Preview a SOAP message script description: Generate a sample script to send the SOAP message. locale: en-US canonical_url: https://www.servicenow.com/docs/r/api-reference/web-services/c\_UseASOAPMessageInAScript.html release: brazil product: Web Services classification: web-services topic_type: concept last_updated: "2026-09-10" reading_time_minutes: 1 breadcrumb: [Scripting outbound SOAP, SOAP, Outbound, Web services, API implementation, API implementation and reference] --- # Preview a SOAP message script Generate a sample script to send the SOAP message. After you have developed and tested the SOAP message, click the **Preview script usage** related link in the SOAP Message Function form. The dialog box displays an example of how you can invoke the SOAP message from a script. You can manipulate the resulting XML response body with [XMLDocument](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/api-reference/scripts/c_XMLDocumentScriptObject.md) or with [GlideSystem - getXMLText\(String xml, String xpathQuery\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/api-reference/server-api-reference/c_GlideSystemAPI.md) and [GlideSystem - getXMLNodeList\(String xml\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/api-reference/server-api-reference/c_GlideSystemAPI.md). **Parent Topic:**[Scripting outbound SOAP](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/api-reference/web-services/r_ScriptingOutboundSOAP.md)