CustomerDataService.GetJobState Method

Returns the state of the data upload job represented by the jobID parameter.

Public Function GetJobState (jobID As System.String)

      _ As [Namespace].JobState
[C#]
public [Namespace].JobState GetJobState (System.String jobID);

Parameters

  • jobID
    Unique ID that represents a data upload job.

Example

 
[Visual Basic]

'This example assumes that the customer data service namespace 
'has been imported 

'Create an instance of the customer data service proxy.
Dim custDataService As CustomerDataService = New CustomerDataService

'Set PreAuthenticate to True
custDataService.PreAuthenticate = True

'Assign your credentials.
custDataService.Credentials = _
    New NetworkCredential(myUserName, mySecurePassword, myDomainName)
'Get job state by calling the GetJobState method.
Dim myJobState As JobState = custDataService.GetJobState(myJobID)

Select Case (myJobState)
    Case JobState.Pending
        'Still Pending.
    Case JobState.Loading
        'Still Loading
    Case Else
        'None of the above two

End Select


 
[C#]

   //This example assumes that the customer data service namespace 
   //has been imported 

   //Create an instance of the customer data service proxy.
   CustomerDataService cds = new CustomerDataService();
   //Assign your credentials.
   cds.Credentials = new System.Net.NetworkCredential(myUserName, 
           mySecurePassword, myDomainName);

   //Set PreAuthenticate to true
   cds.PreAuthenticate = true;

   try
   {
    //Get job state by calling the GetJobState method.
    JobState myJobStatus = cds.GetJobState(myJobID);
    switch(myJobStatus)
    {
     case JobState.Pending:
      //Still Pending.
      break;
     case JobState.Loading:
      //Still Loading
      break;
     default:
      //None of the above two
      break;
    }
   }
   catch(Exception ex)
   {
    string message = ex.Message;
    //Do your exception handling here.
   }

   
 

See Also

  CustomerDataService Class  |   JobState