/// <remarks/>
 public void GetClientTokenAsync(TokenSpecification specification, object userState) {
     if ((this.GetClientTokenOperationCompleted == null)) {
         this.GetClientTokenOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetClientTokenOperationCompleted);
     }
     this.InvokeAsync("GetClientToken", new object[] {
                 specification}, this.GetClientTokenOperationCompleted, userState);
 }
 public string GetClientToken(TokenSpecification specification) {
     object[] results = this.Invoke("GetClientToken", new object[] {
                 specification});
     return ((string)(results[0]));
 }
 /// <remarks/>
 public void GetClientTokenAsync(TokenSpecification specification) {
     this.GetClientTokenAsync(specification, null);
 }
        private string GetToken()
        {
            if (tokenCache == null)
            {
                // Set Bing Maps Developer Account credentials to access the Token Service
                CommonService commonService = new CommonService();
                commonService.Credentials = new System.Net.NetworkCredential("******", "********");

                // Set the token specification properties
                TokenSpecification tokenSpec = new TokenSpecification();
                tokenSpec.ClientIPAddress = "60.226.1.13";
                tokenSpec.TokenValidityDurationMinutes = 60;

                tokenCache = commonService.GetClientToken(tokenSpec);
            }

            return tokenCache;
        }