[geotk] code for parsing WMS Capabilities docs
sorel
johann.sorel at geomatys.fr
Thu May 20 09:03:23 EDT 2010
Hi,
I can't go any further on this topic, my knowledge about JAXB is limited
and I don't know if some of thoses
verifications are done by it and if it already return subclasses of
jaxbException for each type of parsing errors.
If not, making several passes before parsing will requiere some work and
time (I can't estimate).
I'll let cedric bring mode details if he knows.
johann sorel
Jon Blower wrote:
> Hi Johann,
>
> I agree that a general XmlParseException would be a good idea (perhaps with a subclass indicating a failure of an XML doc to validate with its own schema?)
>
>
>>> 3. An exception that is thrown when the server returns a WMS Exception
>>> (e.g. CurrentUpdateSequence). In this case the server will return an XML
>>> document containing the exception, which Java code should translate into
>>> a checked exception.
>>>
>>>
>> I'm not sure we can do a distinction between 2 and 3 since the stream is
>> directly send to the parser.
>>
>
> In similar code in the past, we have taken the XML stream and tried to validate it against the Capabilities schema. If this works, we parse it as Capabilities. If not, we validate against the XML exceptions schema. If this works, we convert the XML doc to a Java exception and throw it. If this doesn't work, we throw an exception indicating a failure to parse. Can you use the same approach? It's very important for cache control to be able to handle exception documents from the server, since the server indicates "Document not changed" by sending a CurrentUpdateSequence exception. (Personally I think this is a little crazy, but it's in the spec...)
>
> Cheers, Jon
More information about the Geotoolkit
mailing list