Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 7 of 7

Is this possible? Run MP as Windows Service and connect via .NET Web Service

This is a discussion on Is this possible? Run MP as Windows Service and connect via .NET Web Service within the Development forums, part of the MapPoint Desktop Discussion category; Hey there. I just started learning MapPoint and found this excellent forum. In the past few days, thanks to sample ...

  1. #1
    rubin-mark is offline Junior Member White Belt
    Join Date
    Jul 2009
    Posts
    2

    Is this possible? Run MP as Windows Service and connect via .NET Web Service

    Hey there. I just started learning MapPoint and found this excellent forum. In the past few days, thanks to sample code and helpful previous posts, I've been able to do what would have taken weeks. I've been tasked with coming up with a prototype for the following scenario; On a laptop with no connection to the Internet, install MapPoint and have it be used as another application's mapping service. We buy a license for each user. The other application is a Java Servlet. Uses would be generating mutli-stop directions, extracting geocode information from addresses, etc.

    After a few days of reading these forums, I've got a .NET 3.5 web service setup and a Windows Program to test it. The web service right now takes in a list of addresses, opens MapPoint as a COM/Interop object, calculates a route from all addresses and then saves the result to the hard drive as a PTM file. That file can then be opened by an HTML page with the ActiveX control or the Map Point application by the Java Servlet.

    That's pretty cool (considering this is way outside my usual skillset), but right now the web service is just so slow being that it has to open a new copy of MapPoint in the background for every function call. Is there a way to run MapPoint as a Windows Service and be able to have my web service talk to it? Sample code would be great, links to articles would be good, even giving me search terms to use on Google would be OK since I haven't been able to find anything.

    Thanks in Advance,
    Mark
    Last edited by rubin-mark; 07-30-2009 at 05:38 PM.

  2. #2
    renatoa is offline Junior Member Yellow Belt
    Join Date
    Feb 2006
    Posts
    29

    Re: Is this possible? Run MP as Windows Service and connect via .NET Web Service

    Short, yes is possible. Unfortunately can't provide you code because all I have is a commercial application.
    As a guideline: create a new project of type Windows service, in the OnStart event open the single MapPoint instance you will use, and implement a communication mechanism between this service and your external client apps requesting MapPoint calls.
    You can even implement your webservice together with the Windows Service, I don't see the why "it has to open a new copy of MapPoint in the background for every function call".
    Open it once and query !

  3. #3
    rubin-mark is offline Junior Member White Belt
    Join Date
    Jul 2009
    Posts
    2

    Re: Is this possible? Run MP as Windows Service and connect via .NET Web Service

    Quote Originally Posted by renatoa View Post
    Short, yes is possible. Unfortunately can't provide you code because all I have is a commercial application.
    As a guideline: create a new project of type Windows service, in the OnStart event open the single MapPoint instance you will use, and implement a communication mechanism between this service and your external client apps requesting MapPoint calls.
    You can even implement your webservice together with the Windows Service, I don't see the why "it has to open a new copy of MapPoint in the background for every function call".
    Open it once and query !

    Thanks for confirming.

    What's the technique for "implement a communication mechanism?" I've seen onCustomCommand(int command) but I don't see how to pass data back from the service

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Is this possible? Run MP as Windows Service and connect via .NET Web Service

    Hi,

    You can let the 2 applications talk to each other by using a named pipe, or a tcp session, or even a file.

  5. #5
    stevec1508 is offline Junior Member White Belt
    Join Date
    Sep 2009
    Posts
    1

    Re: Is this possible? Run MP as Windows Service and connect via .NET Web Service

    Have you any performance stats on passing say 30 stops to mappoint and generating an optimised plan?
    Online seems much faster.
    Does the mappoint com object run faster postcodes or postcodes and full addresses ? Can it run using grid refs?
    Any experience of how to improve runtimes ?

    Thanks

  6. #6
    MrMap is offline Junior Member White Belt
    Join Date
    Aug 2009
    Posts
    4

    Re: Is this possible? Run MP as Windows Service and connect via .NET Web Service

    After hosting MapPoint in a separate application and then calling it,
    MapPoint seems quite slow for this number of routes and it if it has a problem with a stop then it can take a while to time out.

    Does anyone know if it is much faster for postcodes compared to full addresses?

  7. #7
    gemma-the-husky is offline Junior Member Yellow Belt
    Join Date
    Oct 2009
    Location
    UK
    Posts
    26

    Re: Is this possible? Run MP as Windows Service and connect via .NET Web Service

    I was interested in timing route calculation

    I had a circular route with 4 waypoints, about 300 miles, taking about 35secs. Posters here thought that was on the high side - but maybe its similar to results you are getting

    Single shorter A-B routes (<20 miles) were taking about 1sec each.

    I am using access, and can just put an hourglass and a progress bar on the screen while the routes are evaluating

    I would think optimising 30 stops would be a long process. I dont think network analysis is a solved mathematical problem, and I would expect the time to approximate a decent solution would grow at least linearly, maybe geometrically, or even exponentially.

    I would try smaller numbers of stops, to get a feel for the timings.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 03-26-2009, 09:25 AM
  2. The MapPoint Web Service Helper - Part I: Windows and Web Applications
    By Eric Frost in forum MP2K Magazine Articles
    Replies: 0
    Last Post: 01-05-2008, 10:43 AM
  3. [Pb] : VB6 + Service
    By Vincent BENNER in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 02-17-2005, 03:49 PM
  4. Speed of the service
    By sbedin in forum Bing Maps and MapPoint Web Service
    Replies: 0
    Last Post: 12-21-2004, 11:13 AM
  5. NT Service and MP
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-23-2003, 03:31 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127