We use cookies on this site to improve your browsing experience, analyze individualized usage and website traffic, tailor content to your preferences, and make your interactions with our website more meaningful. To learn more about the cookies we use and how you can change your preferences, please read our Cookie Policy and visit our Cookie Preference Manager. By clicking “Accept and Proceed,” closing this banner or continuing to browse this site, you consent to the use of cookies.
Please let us know how to improve this content
Save as PDF
Please let us know how to improve this content
Explain this code
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 ( ) ) ; }
} }