---
sourceDocument: Xanadu API リファレンス
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - ja-JP

ft:publication_title :

    - Xanadu API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# レコードレス SOAPMessageV2 の例

# レコードレス SOAPMessageV2 の例 {#ariaid-title1}

* リリースバージョン: Xanadu
* 
* 更新日 2024年08月01日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：1分

SOAPMessageV2() コンストラクタをパラメーターなしで使用すると、SOAP メッセージ全体をスクリプトで定義できます。
このコンストラクタを使用する場合は、エンドポイントと SOAP アクションを指定する必要があります。この例では、スクリプトは空の SOAP メッセージを作成し、インシデントレコードを挿入するために必要な値を設定します。

    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://<instance>.service-now.com/incident.do?SOAP'); //set the web service provider endpoint
    s.setRequestBody('<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:inc=\"http://www.service-now.com/incident\"><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');


