---
sourceDocument: Referência de API do Xanadu
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - pt-BR

ft:publication_title :

    - Referência de API do Xanadu

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Inserção de exemplos de cliente de serviços web do Java Apache Axis2

# Inserção de exemplos de cliente de serviços web do Java Apache Axis2 {#ariaid-title1}

* Versão de lançamento: Xanadu
* 
* Atualizado 1 de ago. de 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 min. de leitura

Uma classe de exemplo para inserir um registro de incidente.  

    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 ( ) ) ; }
     
      } }


