ThinkGeo.com    |     Blog    |     Wiki    |     Support

WMS & ASP.NET Assistance

MapSuite Team,

I am new to WMS and ASP.NET and would appreciate if you would clear up some confusions I have.

Your sample WMS Server is a combined server & client, which is good for demonstration purposes. But in the real-world I have to support 500+ clients with one, and potentially multiple, WMS Server(s).

Is it correct that each client will get their own instance of the Admin Class? If so, does that mean each client will have to load their own Plugin’s and hence have their own instance of WmsLayerPlugin?

If this is true it would consume an awful lot of resources I would think.

The WMS server I am developing will have a few layers to start and the most important is a JEG2000 Raster Layer. How efficient is this going to be if each client has to have their own WmsLayerPlugin?

Is there any way to load just one set of the Plugin’s so that all clients can make use of the same WmsLayerPlugin ?

Appreciate if you would help make this clear for me.

Dennis

Hi Dennis,

In fact our product work on the server side, the client side is for hows how to use it.

The WMS server focus on handle the map things, it doesn’t contain the authentication logic. So for all clients it run the same plugin logic, if you want to save status for different users, you need to write related logic about it.

You can view our wiki for more detail here, it contains some video also: http://wiki.thinkgeo.com/wiki/map_suite_wms_server_edition

Wish that’s helpful.

Regards,

Ethan

Ethan,

Thanks for your response, but I do realize that your product runs on the server. I’m familiar with the WMS samples as that’s where I started. I went back and looked again at all the code in the projects and gleamed some more useful information.

The WmsLayerPlugin are loaded when the Admin page is started. Is there just this one instantiated set of plugins that are then used by all clients?

Also, is it necessary to have a web page as in your WMS sample? It doesn’t appear that the web page is used by the clients. Can’t the plugins be loaded some other way and then used by the clients. I’m very new to ASP.NET so I may be misunderstanding how all this stuff works.

Another thing I’ve been attempting to do is add a property inside the plugin which is set using Reflection when the plugin is loaded. That property is then used during run-time, but at run-time that property is null. Can you tell me how to set a value to a property in WmsLayerPlugin so that it is available at run-time?

Thanks,
Dennis

Hi Dennis,

  1. When a plugin is accessed, it will be cached in server side, by default each plugin will have four instances be cached so all clients access one of them, you can modify the value NumberOfMapConfigurationsPerWorkerProcess in config to modify it.

  2. You don’t need to create a web page for access the WMS server, you can just access that just like the other WMS server.

  3. I am not sure what’s your detail requirement here, but I think you can get the instance from cache like Application[“Plugins”][…]. Maybe you can let us know more detail about your this question.

Wish that’s helpful.

Regards,

Ethan

hi Ethan,

Thanks for your response.

  1. When I set a breakpoint in GetMapConfigurationCore the breakpoint gets hit four times, which I guess is once for each of the instances. Is NumberOfMapConfigurationsPerWorkerProcess supposed to be in web.config as an AppSetting? Is one instance required for each client or are the instances shared among the clients? How many instances would you recommend for 500 clients?

  2. I would like to not have a web page. Since I am totally new to this could you provide a simple project or some code that shows the basics of how this is done? I’m not understanding how these types of programs are structured so a simple example would be extremely helpful.

  3. The reason that I want to have a property within each plugin is so that the property may be set from the main application. I want this because I want to load all the layers and styles before the plugins are loaded so that the all the data may be verified at startup time. I also want to do this because the GetBoundingBoxCore method needs to return the maximum extent when the plugin is loaded. I don’t want to have to manually provide the bounds of the rectangle. I want the BoundingBox to be determined from having loaded the layers. My applications are all data driven so I can’t have anything like BoundingBox hard-coded in code or even in config files. Could you provide a code snippet of how to find the instance of a plugin?

Appreciate your assistance.

Dennis

Hi Dennis,

  1. Yes the NumberOfMapConfigurationsPerWorkerProcess is set in web.config. I guess that’s because your tiles request different instance, the server works don’t related with user but related with each request. In fact we don’t have more experience about the setting, but if your 500 user won’t access your data at the same time, I think you don’t need change the default value.

  2. In fact you can just run the WmsServerEditionSample_WmsPluginService project, which is a server side project. Then you can find the capability page in the page(it’s server side page), and based on that you can create another client side project for example(https://github.com/ThinkGeo/DisplayWmsRasterLayerSample-ForWinForms) then access this server just like access any other public wms server.
    Here we have another sample project which is based on desktop, I think that should be helpful to understand this. http://wiki.thinkgeo.com/wiki/map_suite_wms_server_edition_all_samples

  3. I read the project code again, and I found if you want to pass any value into plugin you can write a customWmsHandler just like the SecureServerRequestsWmsHandler and ThrottleUserRequestsWmsHandler. You need to register them in the web.config, and then write your custom logic in the ProcessRequestCore, you can get the key value from Request context and add your value into the same context, then you can get this value in the function GetMapCore.

Wish that’s helpful.

Regards,

Ethan

Ethan,

  1. I placed NumberOfMapConfigurationsPerWorkerProcess in web.config, but the GetMapConfigurationCore is still call four times. Any idea why this is?

  2. All of the samples I have seen and none seem to shed light on what I’m looking for. There’s many details left out of all the explanations I’ve seen. Is it possible to implement the WmsLayerPlugin in a WMS Server based on Microsoft OWIN? If so do you have any code examples that would get me started?

  3. Thank you for the explanation and I will attempt to implement according to your explanation. I was able to implement by defining a property inside a custom WmsLayerPlugin and then populate and access that property from outside the plugin itself.

Thanks,
Dennis

Hi Dennis,

  1. I tested it, when I modify the value, the GetMapConfigurationCore will be fired just the same number like I set, as below shows when I set it equal 2 the result in debug window.

  2. Sorry we don’t have experience on make our WMS server work with Microsoft OWIN Components. If you met any detail question when you use that please let us know, maybe we can give some suggestion about it.

  3. I am glad to hear you found the way to implement that, any further question please let us know.

Regards,

Ethan