Bing Maps Geocode request returns 401 Unauthorized error when call is from SharePoint

Answered Bing Maps Geocode request returns 401 Unauthorized error when call is from SharePoint

  • 5 มีนาคม 2555 17:16
     
      มีโค้ด

    I'm developing a SharePoint Timer Job to geocode some lists of addresses held on our SharePoint site.

    I'm using code based on the MSDN samples here: http://msdn.microsoft.com/en-us/library/ff701729.aspx to do the actual Geocoding request.

    The problem I get is that when I call the service from SharePoint (running locally) I get a 401 unauthorised error in return.

    Interestingly, I have also created a small winforms application which does the same thing (but without SharePoint/IIS) using the same code which works perfectly.

    I'm setting the credentials the same way on both apps as follows:

     request.Proxy.Credentials = CredentialCache.DefaultCredentials;

    I'm an enterprise user and I'm using the same key on both apps - but one works and one doesn't - any ideas why this might be? Is it something i need to set in IIS perhaps?

    I tried setting "Pipelined = false" on the request which was a suggestion I read about on but that didn't seem to work.

    Any suggestions gratefully accepted.

     

ตอบทั้งหมด

  • 10 มีนาคม 2555 13:54
    เจ้าของ
     
     คำตอบ
    The error you are seeing is not from Bing Maps. If you are using the same credentials in both apps then it has to be something else. This may be a security issue with SharePoint.

    http://rbrundritt.wordpress.com