insert

  • リリースバージョン: Washingtondc
  • 更新日 2024年02月01日
  • 読む4読むのに数分
  • URL でターゲットとなるテーブルの新規レコードを作成します。

    入力フィールド

    システムフィールドを除く、ターゲットテーブルのすべてのフィールド。システムディクショナリーで必須として設定されたフィールドは、属性 minOccurs=1 で WSDL に反映されます。

    出力フィールド

    表 : 1. メソッド出力フィールドの挿入
    テーブルのタイプ 出力フィールド
    正規 sys_id フィールドとターゲットテーブル (table) の表示値が返されます。
    インポートセット

    インポートセット行の sys_id、変換されたターゲットテーブル (table) の名前、変換されたターゲットテーブルの display_name、変換されたターゲット行の display_value、および status フィールド (insertedupdated、または error)。

    status=error の場合は、オプションの status_message フィールドまたは error_message フィールド値を指定できます。

    挿入によってターゲット行が変換されなかった (キー値が指定されていないためにスキップされた) 場合、sys_id フィールドには、ターゲットの変換テーブルではなくインポートセット行の sys_id が含まれます。

    複数の変換を含むインポートセット このタイプの挿入からの応答には、multiInsertResponse 親要素にラップされた通常のインポートセットテーブル挿入からの複数のフィールドセットが含まれます。各セットには、どの変換マップが応答を作成したかを示す map フィールドが含まれています。

    通常のテーブルのサンプル SOAP メッセージ

    次の例は、簡単な説明のみを指定する挿入を示しています。

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <SOAP-ENV:Envelope xmlns:tns="http://www.service-now.com/incident" 
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
      xmlns:m="http://www.service-now.com"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <SOAP-ENV:Body>
            <insert xmlns="http://www.service-now.com">
                <short_description xsi:type="xsd:string">This is a test</short_description>
            </insert>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    結果として生じる応答は、次のようになります。

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
      xmlns:m="http://www.service-now.com" 
      xmlns:tns="http://www.service-now.com/incident" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <SOAP-ENV:Body>
            <insertResponse xmlns="http://www.service-now.com">
                <sys_id>6b06494fc611227d00b5f87caf618831</sys_id>
            </insertResponse>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    言語固有のサンプルメッセージ

    言語固有の insert のサンプルについては、次のトピックを参照してください。

    Perl SOAP::Lite

    Java Apache Axis2

    Python