Share via


CustomerDataService.StartUpload Method

CustomerDataService.StartUpload Method

Starts a location data upload job. This method returns a unique job ID that should be used in subsequent calls.

Public Function StartUpload (specification As UploadSpecification) As System.String

[C#]
public System.String StartUpload (UploadSpecification specification);

Parameters

  • specification
    Contains the specifications (UploadSpecification object) for the data upload job.

Remarks

  • Calling this method creates a job with a unique ID on the MapPoint Web Service server.

  • The job ID is used in the subsequent calls (UploadData method and FinishUpload method).

  • The job state is set to Loading after this method call.

  • The job is marked Expired if no data is uploaded for 25 minutes after calling this method.

  • Always set your data upload proxy PreAuthenticate property to true (True in Visual Basic .NET) to avoid any errors during the data upload process.

Example

[Visual Basic]

'Create an instance of the customer data service proxy.
Dim custDataService As CustomerDataService = New CustomerDataService
'Assign your credentials.
custDataService.Credentials = _
        New NetworkCredential(myUserName, mySecurePassword, myDomainName)

'Set PreAuthenticate to True
custDataService.PreAuthenticate = True

Try
    'Define an upload specification object
    'and assign all required fields.
    Dim uploadSpec As UploadSpecification = New UploadSpecification
    uploadSpec.DataSourceName = myDataSourceName
    uploadSpec.EntityTypeName = myEntityTypeName
    uploadSpec.Environment = LocationDataEnvironment.Staging
    uploadSpec.MaximumGeocodingLevel = GeocodingLevel.City
    uploadSpec.RejectAmbiguousGeocodes = False
    'Start an upload job and obtain the job ID.
    Dim jobID As String = custDataService.StartUpload(uploadSpec)
Catch e As Exception
    Dim message As String = e.Message
    'Do your exception handling here.
End Try



[C#]

//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
   {
    //Define an upload specification object
    //and assign all required fields.
    UploadSpecification uploadspec = new UploadSpecification();
    uploadspec.DataSourceName = myDataSourceName;
    uploadspec.EntityTypeName = myEntityTypeName;
    uploadspec.Environment = LocationDataEnvironment.Staging;
    uploadspec.MaximumGeocodingLevel = GeocodingLevel.City;
    uploadspec.RejectAmbiguousGeocodes = false;
    //Start an upload job and obtain the job ID.
    string jobID = cds.StartUpload(uploadspec);
   }
   catch(Exception ex)
   {
    string message = ex.Message;
    //Do your exception handling here.
   }


See Also

  CustomerDataService Class   |   UploadSpecification Class