Hi All,
I am trying to calculate simple route from Map Point Web Service with the following code but it is keep telling me 'HTTP Status 401:Unauthorized'. I am using Visual Studio 2008 and added a web reference to http://staging.mappoint.net/standard-30/mappoint.wsdl
Please tell me how to overcome with this issue, is there anything related to web.config or IIS ?
Code:
net.mappoint.staging.RouteServiceSoap objService = new VEMap.net.mappoint.staging.RouteServiceSoap();
objService.PreAuthenticate = true;
objService.Url = " http://staging.mappoint.net/standard-30/mappoint.wsdl";
objService.Credentials = new System.Net.NetworkCredential("xxxxxxx", "xxxxxxx");
net.mappoint.staging.RouteServiceSoap obj = new VEMap.net.mappoint.staging.RouteServiceSoap();
net.mappoint.staging.RouteSpecification r = new VEMap.net.mappoint.staging.RouteSpecification();
net.mappoint.staging.Route objR = new VEMap.net.mappoint.staging.Route();
net.mappoint.staging.LatLong[] ll = new VEMap.net.mappoint.staging.LatLong[2];
ll[0] = new net.mappoint.staging.LatLong();
ll[0].Latitude = double.Parse("45.541474");
ll[0].Longitude = double.Parse("-73.692874");
ll[1] = new net.mappoint.staging.LatLong();
ll[1].Latitude = double.Parse("46.861462");
ll[1].Longitude = double.Parse("-71.2697");
objR = obj.CalculateSimpleRoute(ll, "MapPoint.NA", net.mappoint.staging.SegmentPreference.Quickest);




LinkBack URL
About LinkBacks






Reply With Quote

