2

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?
JJD
  • 50,076
  • 60
  • 203
  • 339

1 Answers1

1

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

lexicore
  • 42,748
  • 17
  • 132
  • 221
  • Thank you for the clarification. Could you - with the above asked question in mind - take a look at [another question](http://stackoverflow.com/questions/9237082/how-to-query-a-web-service-via-post-request-in-android) of mine which better describes the project I am trying to implement. I mention [ksoap2-android](http://code.google.com/p/ksoap2-android/) there which is of course not a requirement - just a try of mine. – JJD Mar 15 '12 at 11:13
  • Finally, I understand better: When I add the schema JARs for the different namespaces like WFS, GML, ... to my project I am able to create objects of those types required in the service definition. – JJD Mar 15 '12 at 18:59
  • I added the Java code I came up with to my question: [How to query a web service via POST request in Android?](http://stackoverflow.com/questions/9237082/how-to-query-a-web-service-via-post-request-in-android). Though, `JAXBElement` stops me from being successful. – JJD Mar 15 '12 at 20:42
  • @JJD I think JAXB is not available on Android at all. – lexicore Mar 16 '12 at 08:39
  • Yes, that's my problem. What would you suggest how I can connect to the WFS from Android? The other question desribes it in detail. – JJD Mar 16 '12 at 11:50