6.7. Globalizing FindMapPoint Web Service currently supports 10 different languages, meaning that when you use the Find Service with a desired (and supported) language, the Find results are returned in that language. It is important to note that in the case of the Find service, only city names and other entity information are localized to display in that specific language. Table 6-10 shows the list of languages currently supported in MapPoint Web Service:
The data sources MapPoint.Moon and MapPoint.World support all of these languages as well as Japanese (language code ja and LCID 1041). To send your desired language information to the MapPoint Web Service during your Find Service calls, MapPoint Web Service provides SOAP Headers. With Find Service, these settings use the FindServiceSoap.UserInfoFindHeaderValue field. The UserInfoFindHeaderValue is of type UserInfoFindHeader, and it and provides fields to set values for the location search context (the UserInfoFindHeader.Context field), user preferred culture (the UserInfoFindHeader.Culture field), and default distance unit as either miles or kilometers (the UserInfoFindHeader.DefaultDistanceUnit field). To use Find Service with a search context for Canada (whose country entity ID is 39) with a preferred language of French (name fr), you would have to provide the user information header to the FindServiceSoap: //Create a find service soap object FindServiceSoap findService = new FindServiceSoap(); //Create a user header UserInfoFindHeader userInfoFindHeader = new UserInfoFindHeader(); //Set the country context to Canada userInfoFindHeader.Context = new CountryRegionContext(); userInfoFindHeader.Context.EntityID = 39; //Set the language preference userInfoRenderHeader.Culture = new CultureInfo(); userInfoRenderHeader.Culture.Name = "fr"; //Then assign the header to the find service proxy findService.UserInfoFindHeaderValue = userInfoFindHeader; The entity ID and language name are assigned to the find header before making any find calls. To set the desired culture information, you could also use the Lcid ID for French instead of using the language name. One thing to remember while using the user information header to obtain localized information from Find Service is that the addresses returned by the FindServiceSoap.FindAddress method are never localized. |