none
Use Bing map soap API get map imagery, some time will throw exceptin RRS feed

  • Question

  • Hi, all

         Right now, I use bing map soap api develop small program. when I use via soap api to get BMMetaData information, sometimes will failure.

          API:http://dev.virtualearth.net/webservices/v1/imageryservice/imageryservice.svc"

          example code:

          

     BMMetaData bmMeatData = new BMMetaData();

                ImageryMetadataRequest metadataRequest = new ImageryMetadataRequest();

                // Set credentials using a valid Bing Maps token
                metadataRequest.Credentials = new Credentials();
                //metadataRequest.Credentials.Token = BingMapsToken.GetInstance().Content;
                metadataRequest.Credentials.ApplicationId = BingMapKeys.GetInstance().KeyContent;

                MapStyle mapStyle = BMMapStyle2MapStyle(bmMapStyle);
                metadataRequest.Style = mapStyle;

                // Make the imagery metadata request
                ImageryServiceClient imageryService = new ImageryServiceClient();
                ImageryMetadataResponse metadataResponse = imageryService.GetImageryMetadata(metadataRequest);

                ImageryMetadataResult result = metadataResponse.Results[0];

                string uriTemplate = result.ImageUri;

                //t0,t1,t2,t3           
                string[] subDomains1 = result.ImageUriSubdomains;
                for (int i = 0; i < subDomains1.Length; i++)
                {
                    bmMeatData.SubDomain.Add(subDomains1[i]);
                }

                bmMeatData.UriTemplate.UriTemplate = uriTemplate;
                bmMeatData.UriTemplate.MapStyle = bmMapStyle;

                return bmMeatData;

    exception:

               System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://dev.virtualearth.net/webservices/v1/imageryservice/imageryservice.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---&gt; System.Net.WebException: The remote name could not be resolved: &apos;dev.virtualearth.net&apos;
       at System.Net.HttpWebRequest.GetRequestStream(TransportContext&amp; context)
       at System.Net.HttpWebRequest.GetRequestStream()
       at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
       --- End of inner exception stack trace ---

    Server stack trace:
       at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
       at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
       at IImageryService.GetImageryMetadata(ImageryMetadataRequest request)
       at Accela.GIS.Provider.VirtualEarth.BMUriTemplateManage.GetBMUriTemplate(BMMapStyle bmMapStyle)
       at Accela.GIS.Provider.VirtualEarth.BMUriTemplateManage.InitBMMetaData()
       at Accela.GIS.Provider.VirtualEarth.BMUriTemplateManage..cctor()
       --- End of inner exception stack trace ---
       at Accela.GIS.Provider.VirtualEarth.BMUriTemplateManage.get_LstBMUriTemplate()
       at Accela.GIS.Provider.VirtualEarth.ProviderVirtualEarth.GetBMInitialData()

    Anyone can told me cause the issues root reason?

    Thanks

    • Moved by JOshiro Monday, March 26, 2012 6:14 PM Bing Maps SOAP issue (From:Live Connect)
    Monday, March 26, 2012 2:54 AM

Answers

  • Are you making a lot of requests in a loop? If so it's possible that part of the request is being lost due to the high number requests on your network. Have you looked at using the REST services? They are faster.

    http://rbrundritt.wordpress.com

    Friday, April 13, 2012 11:25 AM