2
votes

I am trying to generate java classes that describe the web service offered here which belongs to this page. Please mind that I am not convinced that the XML is the one needed to run the following steps!

  1. I save the XML of the API to a file: getcapabilities.xml
  2. I run the following trang command to generate an XSD: java -jar trang.jar getcapabilities.xml getcapabilities.xsd
  3. I get the following files: getcapabilities.xsd, ogc.xsd, wfs.xsd, xlink.xsd, xsi.xsd
  4. I run the following command to generate java classes: xjc getcapabilities.xsd
  5. The following error message is prompted

parsing a schema... [ERROR] no-xsi: The {target namespace} of an attribute declaration must not match 'http://www.w3.org/2001/XMLSchema-instance'.
line 7 of file:xsi.xsd
Failed to parse a schema.

Questions:

  • Do you get the same error message?
  • What can I do about it?
  • Is my approach meant to be successful at all?
1

1 Answers

1
votes

You're dealing with an OGC Web Feature Service. There's a couple of peculiarities with that.