How long after including the Token service do transactions show up in "View Reports" ?
- Hi All,
We think we have correctly included the Token request into our staging app etc.
Does anyone have any idea of how long it takes for these transactions to show up in the View Reports in our developer account on the CSS site?
Would be good to know that we have set it up correctly.
Cheers
RAW
Answers
- There is an issue with using tokens in the staging environment for the AJAX map control, that being most of it doesn't work, and only works with the production accounts.
- Marked As Answer byRichard_BrundrittMVP, ModeratorSunday, November 29, 2009 8:48 PM
All Replies
- Would it be worth me contact Microsoft direct?
If I can find their email address for this.... - Hi RAW,
It typically will be 1 day before the transactions are shown on CSS, and they will be found in the first two links under the View Reports page. - Thanks Jonathan :)
Ah, I imagine we have done something wrong then as we are not getting anything after 2 days, yet we have no error when we implimented the code as defined here
http://msdn.microsoft.com/en-us/library/bb924353.aspx
Hmm, I shall post exactly what we have done, just give me a moment to get it together - and maybe someone can spot the mistake :(
Cheers
RAW - OK - here are the steps we have taken :)
Step 1
Signed up for a development account and got a Development username (Integer) and password
Step 2
Add a web reference to the bing map service
We gave the following URl to add a webreference
https://staging.common.virtualearth.net/find-30/common.asmx?wsdl
and gave a name TokenService for this reference
Step 3
we add
using TokenService;
and also add the following code in the page_load event
// Place the following code in the Page_Load event of your ASP .NET Web
// application so that it runs before the map control is loaded.
// This code assumes a using reference to the Bing Maps
// Token service.
// Be sure to use an SSL connection to protect your information.
CommonServiceSoap commonService = new CommonServiceSoap();
commonService.Url = https://staging.common.virtualearth.net/find-30/common.asmx?wsdl;
commonService.Credentials =
new System.Net.NetworkCredential(
"Bing Maps Developer Account ID",
"Bing Maps Developer Account password");// Create the TokenSpecification object to pass to GetClientToken.
TokenSpecification tokenSpec = new TokenSpecification();// Use the Page object to retrieve the end-client’s IPAddress.
tokenSpec.ClientIPAddress = Page.Request.UserHostAddress;// The maximum allowable token duration is 480 minutes (8 hours).
// The minimum allowable duration is 15 minutes.
tokenSpec.TokenValidityDurationMinutes = 480;// Now get a token from the Bing Maps Token service.
string clienttoken = commonService.GetClientToken(tokenSpec);
step 4 : Set the Token in the Map control
We add the following code in the javascript of the page
// Retrieve the clienttoken variable from server-side code.
var token = "<%=clienttoken %>";
<script type="text/javascript"
src="http://staging.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2"></script>
var map = new VEMap(‘mymap’);
map.SetClientToken(token);
map.LoadMap();
Step 5: Handle Token Expiration and Error Events
var map = new VEMap(‘mymap’);
map.AttachEvent('ontokenexpire', MyHandleTokenExpire);
map.AttachEvent('ontokenerror', MyHandleTokenError);
function MyHandleTokenExpire()
{
// insert code here to handle token expiration
}
function MyHandleTokenError()
{
// insert code here to handle token errors
}
We are getting no error etc - but after 5 days now we are not getting any results in the reports section.
A quick question though - does our application need to be running on a publicly accessable server? As at the moment it is sitting behind a username and password.
We would love to understand what we are doing wrong and be able to get this working correctly.
Thanks all
RAW - A couple additional things to ensure. When on the "View Reports" page only the first two reports will have information on Bing Maps, the rest are meant for MapPoint. When you select a report it defaults to the production environment. You will have to change this in the drop down box at the top and then click on "View Report". The steps you outlined for setting up the token appear correct.
Windows Live Developer MVP - http://rbrundritt.spaces.live.com - Hi Richard :)
Yes, I am only trying to see the reports in the first 2 links
Transaction Usage and Transaction Usage by Category
I click on one one of these, the date range is automatically the last month (ie 9/23/2009 to 10/23/2009), I select the environment as "Select All" - and click on View Report
And I get...
No data found for the Transaction Usage report for the specified period
A bit baffled.
Is there anyway to test if we have implimented this correctly, other than waiting to see if reports show up ? - There is an issue with using tokens in the staging environment for the AJAX map control, that being most of it doesn't work, and only works with the production accounts.
- Marked As Answer byRichard_BrundrittMVP, ModeratorSunday, November 29, 2009 8:48 PM
- Hi Jonathan :)
So, if this is the case then there is no way for us to guage the transactions we are going to incur once this hits production ??
Is this really the case?? or is there another means by which we can ascertain our usage?
Why have it and document it etc if it is not a supported feature?
Cheers
RAW - There are other things that require tokens to work properly, such as getting the route points from a GetDirections call to draw the route onto a map. Sure GetDirections already draws the route automatically, but you can save the route for later and saves the trouble of making another GetDirections call. It's also pretty much the only way to draw multiple routes onto a map at the same time.
- Hi Johnathan,
We are not using any Get Routes etc - all we are doing is showing the bingmap tiles etc and overlaying this with POI from our own database.
So, all I am after doing is meassuring the tile transactions that our map is going to incur....
And we are still none the wiser - I have emailed Bing maps and posted a post on the support Microsoft community site.
:( - Just an update,
I have finally managed to get in contact with someone at Bing Support - and they are "handling" the case.
Although I have not heard anything for 3 days, since they said they would look at this.
I will keep you informed as to whether the Token service works with staging accounts.
RAW - Still nothing from Bing Support - Does anyone have any experience dealing with Bing Support, how long do they usually take once they say they are looking at your issue ??
- If you can send me an email with the name of who is handling your support case I can look into the status.
Windows Live Developer MVP - http://rbrundritt.spaces.live.com

