faite
2008-10-27 18:15:02 UTC
I am trying to execute the example that you have at
http://go.mappoint.net/mappointmpac/default.aspx?main=article.aspx&id=J20085
but it don't work for me.
Could you help me with this?
Thanks
public class FindAddress
{
public static String username = "xxxxx";
public static String password = "xxxxx";
public static String dataSourceName = "MapPoint.NA";
public static String findAddress = "5873 Northpointe Lane";
public static String findCity = "boynton beach";
public static String findState = "florida";
public static String findZip = "33437";
public static void getRute() throws RemoteException, MalformedURLException,
ServiceException
{
String serviceURL =
"http://routev3.staging.mappoint.net/Route-30/RouteService.asmx";
RouteServiceSoap routeService = new
RouteServiceLocator().getRouteServiceSoap(new URL( serviceURL ));
((RouteServiceSoapStub) routeService).setUsername(username);
((RouteServiceSoapStub) routeService).setPassword(password);
UserInfoRouteHeader routeHeader = new UserInfoRouteHeader();
routeHeader.setDefaultDistanceUnit(DistanceUnit.Kilometer);
CultureInfo cultureInfo = new CultureInfo();
cultureInfo.setName("en");
routeHeader.setCulture(cultureInfo);
((RouteServiceSoapStub)
routeService).setHeader("http://s.mappoint.net/mappoint-30/","UserInfoRouteHeader",routeHeader);
// Calculate a route between 2 latitude and longitude coordinates
LatLong[] latlongs = new LatLong[2];
latlongs[0] = new LatLong();
latlongs[0].setLatitude(new Double(40));
latlongs[0].setLongitude(new Double(-120));
latlongs[1] = new LatLong();
latlongs[1].setLatitude(new Double(41));
latlongs[1].setLongitude(new Double(-121));
Route myRoute = routeService.calculateSimpleRoute(latlongs, "MapPoint.NA",
SegmentPreference.Quickest);
}
http://go.mappoint.net/mappointmpac/default.aspx?main=article.aspx&id=J20085
but it don't work for me.
Could you help me with this?
Thanks
public class FindAddress
{
public static String username = "xxxxx";
public static String password = "xxxxx";
public static String dataSourceName = "MapPoint.NA";
public static String findAddress = "5873 Northpointe Lane";
public static String findCity = "boynton beach";
public static String findState = "florida";
public static String findZip = "33437";
public static void getRute() throws RemoteException, MalformedURLException,
ServiceException
{
String serviceURL =
"http://routev3.staging.mappoint.net/Route-30/RouteService.asmx";
RouteServiceSoap routeService = new
RouteServiceLocator().getRouteServiceSoap(new URL( serviceURL ));
((RouteServiceSoapStub) routeService).setUsername(username);
((RouteServiceSoapStub) routeService).setPassword(password);
UserInfoRouteHeader routeHeader = new UserInfoRouteHeader();
routeHeader.setDefaultDistanceUnit(DistanceUnit.Kilometer);
CultureInfo cultureInfo = new CultureInfo();
cultureInfo.setName("en");
routeHeader.setCulture(cultureInfo);
((RouteServiceSoapStub)
routeService).setHeader("http://s.mappoint.net/mappoint-30/","UserInfoRouteHeader",routeHeader);
// Calculate a route between 2 latitude and longitude coordinates
LatLong[] latlongs = new LatLong[2];
latlongs[0] = new LatLong();
latlongs[0].setLatitude(new Double(40));
latlongs[0].setLongitude(new Double(-120));
latlongs[1] = new LatLong();
latlongs[1].setLatitude(new Double(41));
latlongs[1].setLongitude(new Double(-121));
Route myRoute = routeService.calculateSimpleRoute(latlongs, "MapPoint.NA",
SegmentPreference.Quickest);
}