---
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


---

# Java Apache Axis2 Web サービスクライアントの例：insert

# Java Apache Axis2 Web サービスクライアントの例：insert {#ariaid-title1}

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

インシデントレコードを挿入するクラスの例。  

    public class Insert  {
     
      public static void main ( String args [ ] ) { try {
       HttpTransportProperties. Authenticator basicAuthentication  = new HttpTransportProperties. Authenticator ( ) ;
       basicAuthentication. setUsername ( "admin" ) ;
       basicAuthentication. setPassword ( "admin" ) ;
     
       ServiceNowStub proxy  = new ServiceNowStub ( ) ;
     
       proxy._getServiceClient ( ). getOptions ( ). setProperty (org. apache. axis2. transport. http. HTTPConstants. CHUNKED,  Boolean. FALSE ) ;
       proxy._getServiceClient ( ). getOptions ( ). setProperty (org. apache. axis2. transport. http. HTTPConstants. AUTHENTICATE, basicAuthentication ) ;
     
       ServiceNowStub. Insert inc  = new ServiceNowStub. Insert ( ) ;
       ServiceNowStub. InsertResponse resp  = new ServiceNowStub. InsertResponse ( ) ;
     
       inc. setAssigned_to ( "Christen Mitchell" ) ;
       inc. setCategory ( "hardware" ) ;
       inc. setPriority ( BigInteger. ONE ) ;
       inc. setDescription ( "The WI_FI in the reception area is down" ) ;
       inc. setCaller_id ( "Joe Employee" ) ;
     
       resp  = proxy. insert (inc ) ;
     
        System. out. println ( "New Incident: " + resp. getNumber ( ) ) ; } catch ( Exception e ) { System. out. println (e. toString ( ) ) ; }
     
      } }


