none
SOAP Geocode query not returning results initially, then returing results on subsequent attempts for exact same query. RRS feed

  • Question

  • I'm having an issue today where a SOAP Geocode query is not returning results initially, but then it returns results on subsequent attempts for exact same query.

    To easily reproduce this issue, I set up a geocode that runs the exact same query every 30 seconds until it gets a result back. The geocode returned no results for about the first 12 attempts, then magically returned the correct result on the 13th attempt. I've included the failure and success TraceIds at the end of this message. Here is my test code using .NET 4.0, with auto-generated WCF service reference through VS2010:

    BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None);
    var client = new BingMaps.GeocodeServiceClient(binding, new EndpointAddress("http://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc"));
    for (int i = 1; i <= 100; i++)
    {
    	BingMaps.GeocodeRequest request = new BingMaps.GeocodeRequest();
    	request.Credentials = new BingMaps.Credentials();
    	request.Credentials.ApplicationId = "***my app id";
    	request.Query = "Waukesha, WI";
    	var response = client.Geocode(request);
    	if (response.Results == null || response.Results.Length == 0)
    	{
    		Console.WriteLine("No results: " + response.ResponseSummary.TraceId);
    	}
    	else
    	{
    		Console.WriteLine(string.Format("Result: Trace: {0}, Address: {1}", response.ResponseSummary.TraceId, response.Results[0].DisplayName));
    		break;
    	}
    	System.Threading.Thread.Sleep(TimeSpan.FromSeconds(30));
    }

    Here are the trace ids of the multiple failures, and finally the success:

    No results: c6816efe578e489a93c4341a0959b017|CH1M001454|02.00.83.1900|CH1MSNVM003901
    No results: 00564f7df6b64c709195965729162f9a|CH1M001473|02.00.83.1900|CH1MSNVM001385
    No results: c6581db2c3c043f69e9b6c9c73d6ab78|CH1M001452|02.00.83.1900|CH1MSNVM004151
    No results: 9b75f05c66f743febe5388d23d1ea736|CH1M001451|02.00.83.1900|CH1MSNVM001395
    No results: db8f46d52ad7421ba4b253df41c7601d|CH1M001456|02.00.83.1900|CH1MSNVM004152
    No results: 1c8b93dd736f44718fe313d72de83567|CH1M001469|02.00.83.1900|CH1MSNVM001388
    No results: 81f5f0738a784ef2a60a1b39212ed487|CH1M001462|02.00.83.1900|CH1MSNVM001382
    No results: ea84a301b79343328e2abaa85ec8c1ad|CH1M001471|02.00.83.1900|CH1MSNVM004154
    No results: 8048f8ea40b448d99a830e264b531568|CH1M001451|02.00.83.1900|CH1MSNVM003905
    No results: 3f4706f87beb4eff81bfe0c232a389cd|CH1M001458|02.00.83.1900|CH1MSNVM001384
    No results: e94809b68067473facca699673378cc3|CH1M001456|02.00.83.1900|CH1MSNVM001382
    ****THE SUCCES***** Result: Trace: 76a804a273964dc4b8fb297a1deb03b6|CH1M001465|02.00.83.1900|CH1MSNVM001385, CH1MSNVM004163, CH1MSNVM004159, CH1MSNVM000045, CH1MSNVM002952, Address: Waukesha, WI

    Thursday, December 6, 2012 5:49 PM

Answers

  • It sounds like you are being rate limited. If you make a high rate of calls to the REST or SOAP services your application will receive empty results. All trial and basic keys are rate limited. Enterprise keys are not rate limited. Rate limiting ensures that your application stays within the 50,000 service transactions limit in a 24 hour period.

    Also, the SOAP services are an old legacy service. You would have much better performance using the Bing Maps REST services. Information on how to use the REST services in .NET can be found here: http://msdn.microsoft.com/en-us/library/jj819168.aspx


    http://rbrundritt.wordpress.com

    Friday, December 7, 2012 8:53 AM