The following macros are not currently supported in the header:
  • style

Ejemplo de cliente de llamada Insert

A continuación, se muestra un ejemplo de un programa de cliente de Axis que convoca la operación listServiceRequest para crear/registrar un nuevo ticket de solicitud de servicio con los detalles proporcionados.                

public class ServiceRequestClient
{    


public void main (

String [] args)
   { 


try
      { 
         // Create the request
         ServiceRequestStub                        srqStub     = 

new ServiceRequestStub();
         ServiceRequestStub.Credentials            credentials = 

new ServiceRequestStub.Credentials();
         ServiceRequestStub.ExtendedSettings       extParams   = 

new ServiceRequestStub.ExtendedSettings();
         ServiceRequestStub.ServiceRequest         srqBean     = 

new ServiceRequestStub.ServiceRequest();

         // Initialize Credentials (User Name & User Password / Authorization Token & Slice Token)
         credentials.setUserName (

"wsuser");
         credentials.setUserPassword (

"wsuser");

         // Initialize Extended Settings such as Response Format (XML, JSON)
         extParams.setResponseFormat (

"JSON");

         // Initialize Service Request Bean with neccessary details
         srqBean.setRequester_name (

"Admin, InteQ");
         srqBean.setTicket_description (

"Ticket creation via webservice# " + 

new Date());

         // Invoke the INSERT service
         ServiceRequestStub.DefaultServiceResponse serviceResponse = srqStub.logServiceRequest (credentials, extParams, srqBean);

         // Inspect successful execution of service and retrieve the response text


if (serviceResponse.getResponseStatus ().equals (

"OK"))
         { 


System.out.println(

"JSON Response : " + serviceResponse.getResponseText ());  
         } 
         // Retrieve the status code, status message and error messages, in 

case of failures


else
         { 


System.out.println(

"Status Code : " + serviceResponse.getStatusCode ());


System.out.println(

"Status Message : " + serviceResponse.getStatusMessage ());


System.out.println(

"Errors : " + Arrays.asList (serviceResponse.getErrors ()).toString ());
         } 
      } 


catch (Exception e) 
      { 


System.out.println (

"Exception: " + e.getMessage());
      } 
   } 
} 

© 2017 ServiceAide 1-650-206-8988 http://www.serviceaide.com info@serviceaide.com