BruTile and GeoServer

Mar 4, 2011 at 10:40 AM

Hi, I'm using the BruTile Provider in SharpMap to conect to a internal GeoServer map Server (


I'm having this exception ([System.ApplicationException] = {"No service tag found!"}):


in BruTile.Web.WmsCapabilities.ParseCapabilities(XmlDocument doc)  

in BruTile.Web.WmsCapabilities..ctor(Uri uri, WebProxy proxy)  

in BruTile.Web.WmscTileSource.TileSourceBuilder(Uri uri, WebProxy proxy)  

in WinFormSamples.Samples.TiledWmsSample.InitializeMap()

in cofee@sharpmap\WinFormSamples\Samples\TiledWmsSample.cs:line 27  

in WinFormSamples.FormMapBox.radioButton_Click(Object sender, EventArgs e)

in cofee@sharpmap\WinFormSamples\FormMapBox.cs:line 41

string url = "http://dev:8080/geoserver/ows?service=wms&version=1.1.1&request=GetCapabilities";
List<ITileSource> source = WmscTileSource.TileSourceBuilder(new System.Uri(url), null);

This Exception occurs when I'm getting the List of TileSource.


I've tried to connect to :

string url = ";request=GetCapabilities&amp;service=wms-c";

and it's working ok, but not with GeoServer.


Any ideas?

Mar 4, 2011 at 11:18 AM

There is problem with parsing the WMS capabilties. You can see the exception thrown here:

The error is on the very first node of the xml so I would excpect what is returned from the service is not the capabilities as it would expect. 

Could you paste here (or through codeplex message if it is confidnetial) what you get when you paste this url in your browser:




Mar 4, 2011 at 2:22 PM

I think that the problem is with the GeoServer that I'm using that doesn't show all the Capabilities namely TileSets.


I'm using 2.0.2 and I will try the 2.1 RC1.


Thank You 


Mar 4, 2011 at 5:07 PM

the url you request specifies service=wms. So isnt is an ordinary WMS?


Mar 4, 2011 at 5:36 PM

Hi Pauldendulk


I've found 1 Bug:

In the File WmscTileSource , in line:

string[] resolutions = xnResolutions.InnerText.Split(new char[] {' '});

the resolutions can have an empty entry with "", this should be removed or tested before iterating through the resolutions array. this will throw an Exception.


XML Example that throws this exception:

      <BoundingBox SRS="EPSG:900913" minx="-2.003750834E7" miny="-2.003750834E7"  maxx="2.003750834E7"  maxy="2.003750834E7" />
      <Resolutions>156543.03390625 78271.516953125 39135.7584765625 19567.87923828125 9783.939619140625 4891.9698095703125 2445.9849047851562 1222.9924523925781 611.4962261962891 305.74811309814453 152.87405654907226 76.43702827453613 38.218514137268066 19.109257068634033 9.554628534317017 4.777314267158508 2.388657133579254 1.194328566789627 0.5971642833948135 0.29858214169740677 0.14929107084870338 0.07464553542435169 0.037322767712175846 0.018661383856087923 0.009330691928043961 0.004665345964021981 </Resolutions>


Mar 6, 2011 at 10:45 AM

thanks for reporting!

I fixed it with StringSplitOptions.RemoveEmptyEntries:

                string[] resolutions = xnResolutions.InnerText.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

and added the extra spaced data to the unit test input.