From: Richard G. <rg...@re...> - 2004-12-15 18:23:53
|
Hi Bill, Comments are inline. >I've run into a problem w/ gt2 parsing a WMS capabilities document that >contains vendor specific elements. In version 2.1M1, it seemed to be handled >correctly in that it was ignored and the reminder of the parse completed >successfully. However, in the latest dev build 2.1.x (last svn update of >12/13), parsing throws a SAXException and terminates the parse. > The big change between versions was the change of the XML parser. Initially I used JDOM because it was easy to use, but certain servers with malformed links to the DTD document were un-parseable. So I moved over to the XML framework within GeoTools itself. But that introduced the VenderSpecificCapabilities bug located at: http://jira.codehaus.org/browse/GEOT-330 I will re-open the bug report and add in the data you have provided. >Also, since >this happens while attempting to negotiate the WMS version >(WebMapServer.negotitateVersion) it results in additional GetCapabilities >requests. This continues until all gt2 supported server versions are tried >then it goes into an infinite loop, effectively hanging the app at this >point. > > This is interesting - I will look into it. I remember that that server froze when a request was made for 1.0.0 capabilities. I designed the version negotiation to always attempt to retrieve the highest possible version available, as this is desireable for our other project, uDig. I can see how giving more control would be a good idea. The server seems to be down right now so I am unable to do further testing. >I would think the correct handling is to ignore vendor specific elements in >a capabilities doc as what seemed to happen in version 2.1M1. Unfortunately, >I don't have the expertise/familiarity with the parsing code to suggest I >could find a fix. However, I'd be willing to try if someone had a quick fix >in mind or a reasonable starting point. > > That was my intention and I am not sure if there is quickfix. As for specifying version negotiation, there is a quick hack that you can do until something more elegant is in place. (I will not have time to do so this week. Hopefully I can next week) Created a subclass of WebMapServer and use that in its place. Override the setupSpecifications() method and ignore the WMS 1.3.0 version. Here is what you probably want: protected void setupSpecifications() { specs = new Specification[3]; specs[0] = new WMS1_0_0(); specs[1] = new WMS1_1_0(); specs[2] = new WMS1_1_1(); } That should achieve what you are looking for. >Our immediate requirement is for the client to support up to 1.1.1 WMS >servers. Also, we don't ,at this time, what to handle to complexity of the >1.3.0 differences. > > With the WMS code in GeoTools, I have written it to be version transparent - the complexity should be hidden behind the API for you. > It would also be useful in the case(s) where server which negotiate to >1.3.0 don't handle 1.3.0 request correctly. For ex, the following >getFeatureInfo request: > >http://www2.demis.nl/wms/wms.asp?INFO_FORMAT=text/html&LAYERS=Topography,Cit >ies,Coastlines,Rivers,Highways,Airports&FEATURE_COUNT=5&WMS=WorldMap&FORMAT= >image/png&TRANSPARENT=TRUE&HEIGHT=358&J=202&REQUEST=GetFeatureInfo&I=284&WID >TH=608&BBOX=-121.99539105504564,23.515328950386387,-52.004608944954356,56.48 >467104961361&STYLES=,,,,,&SRS=EPSG:4326&QUERY_LAYERS=Airports,Cities,Highway >s,Rivers,Topography&VERSION=1.3.0 > >Results in an WMS exception result saying the X and Y parameters are >missing. In 1.3.0, the x coordinate is specified by the I parameter and y by >the J parameter as sent in the above string. Gt2 will always negotiate to >1.3.0, which won't work, I need to send a 1.1.1 request. > >About the x/t missing exception result: any idea why this is happening >except for incorrect handling by the server? > > This is interesting. Looks like the server doesn't implement the 1.3.0 specification correctly. In 1.3.0 X and Y were renamed to I and J. Once the WebMapServer class has determined which version it can communicate to the server with, it will always use that same version to communicate with the server. Currently there is no way to override it. (Aside from the above fix, which would totally remove all 1.3.0 compatibility) Anyway. I don't have time to work on this at all this week. Maybe next week if I am lucky. And I am always looking for help on it. If you were interested in working on it I could see if I could get you commit access. Richard Gould |