CustomerDataService Class

CustomerDataService Class

Contains the methods to programmatically upload the points of interest data to the MapPoint servers.

Public Class CustomerDataService Inherits System.Web.Services.Protocols.SoapHttpClientProtocol


[C#]
public class CustomerDataService : System.Web.Services.Protocols.SoapHttpClientProtocol

Public Constructors

Name Description
public constructorCustomerDataService Constructor Initializes a new instance of the CustomerDataService class.

Public Methods

Name Description
public methodCopyDataSource

Enables you to move your data between the staging and production environments. This method returns a unique job ID that can be used in subsequent calls.

public methodDeleteDataSource

Enables you to delete custom data sources from the production or staging environment. This method returns a unique job ID that can be used in subsequent calls.

public methodFinishUpload

Marks the data upload job represented by the job ID as complete and submits the uploaded data for geocoding.

public methodGetDownloadFileURL

Returns a URL that can be used to access the data file for a given job.

public methodGetJobState

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

public methodStartBatchGeocode

Starts a batch geocoding job. This method returns a unique job ID that can be used in subsequent calls.

public methodStartDownload

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

public methodStartUpload

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

public methodUploadData

Uploads the point-of-interest data. You can use this method to upload data in multiple chunks. This method returns the number of bytes that were uploaded in the current call.

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

  UploadSpecification Class   |   JobState Enumeration