Community of VE/MapPoint Users and Developers
This is a discussion on Setting default distance unit within the MapPoint Web Service and Virtual Earth forums, part of the Map Forums category; I'm using MapPoint Web Service in a Java J2EE architecture. How do I set the default distance unit to miles ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
|
Here's an example of how to set the header elements in Java: The following is a code snippet of how you would set the Distance Unit property of the UserInfoFindHeader and UserInfoRouteHeader. These edits were done to the FindRouteDialog.java file which is in the 'Java Driving Directions' demo located at http://demo.mappoint.net/. try { String findUrl = staging ? findStagingUrl : findProductionUrl; findService = new FindServiceLocator().getFindServiceSoap(new URL(findUrl)); ((FindServiceSoapStub) findService).setUsername(userName); ((FindServiceSoapStub) findService).setPassword(password); //Create a SOAP Header Element and child elements to support setting the Distance unit for the FindService SOAPHeaderElement myUserInfoFindHeader = new SOAPHeaderElement("","UserInfoFindHeader"); MessageElement myDistanceUnit = new MessageElement("","DefaultDistanceUnit"); myDistanceUnit .addTextNode("DistanceUnit.Mile"); myUserInfoFindHeader.addChild(myDistanceUnit); //Set the header using the SOAP Header Element and children created above ((FindServiceSoapStub) findService).setHeader(myUserInfoFindHeader); String routeUrl = staging ? routeStagingUrl : routeProductionUrl; routeService = new RouteServiceLocator().getRouteServiceSoap(new URL(routeUrl)); ((RouteServiceSoapStub) routeService).setUsername(userName); ((RouteServiceSoapStub) routeService).setPassword(password); //Create a SOAP Header Element and child elements to support setting the Distance unit for the Route Service SOAPHeaderElement myUserInfoRouteHeader = new SOAPHeaderElement("","UserInfoRouteHeader"); MessageElement myDistanceUnit = new MessageElement("","DefaultDistanceUnit"); myDistanceUnit .addTextNode("DistanceUnit.Mile"); myUserInfoRouteHeader.addChild(myDistanceUnit); //Set the header using the SOAP Header Element and children created above ((RouteServiceSoapStub) routeService).setHeader(myUserInfoRouteHeader); } catch (Exception e) { ExceptionDialog.displayException(this, e); } Steven Pushee This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use. © 2003 Microsoft Corporation. All rights reserved. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Has anyone had any problems setting the value of t.... | Anonymous | MapPoint 2006/2009 Discussion | 2 | 10-26-2006 07:43 AM |
| European Utilities Business Unit Leader | florence4000 | News and Announcements | 0 | 05-26-2005 05:38 AM |
| Low cost GPS unit with SDK | Anonymous | MapPoint 2006/2009 Discussion | 4 | 11-24-2004 08:22 AM |
| How to change the default country setting | neo | MapPoint 2006/2009 Discussion | 6 | 08-13-2003 12:29 PM |
| Setting Speeds | aarunprakash | MapPoint 2006/2009 Discussion | 0 | 06-06-2003 12:45 PM |
Borovets Ski
Enjoy the stunning scenery of the Rila Mountains when you book a Borovets Ski Holiday in Bulgaria. Holiday Hypermarket makes price comparison between competitors easy.
Best Travel Agent
Travel Counsellors has been named the UK's Best Travel Agent at the Guardian Unlimited Travel awards.
Cuba Holidays
After years of neglect by the western world, Cuba is coming back onto the holiday scene. Cuba Holidays are a unique and enjoyable experience. Book at dealchecker.co.uk.
Holidays in Cyprus
Holidays in Cyprus are enriched by the abundance of churches, ruins and natural wonders. Book a holiday with us today!
Cheap Canaries Holidays
Are you hunting down cheap Canaries holidays? Well check out ulookubook.com to bag a great value holiday. There are numerous festivals taking place all year round. Why not book your holiday around one?
Compare Holidays
Compare holidays online where you can see all the amazing possibilities at Travel.co.uk
Cheap Sharm el Sheikh Holidays
Visit the Red Sea Riviera! Info on cheap Sharm el Sheikh holidays, found at On The Beach.