So, I am expecting to start a new project soon. It will be for writing a little API.
Only thing chosen so far is that clients will send me XML.
I guess I could go with SOAP (still have not been given a full list of requirements)
Anyway, I want to do things properly: using API schemas and XML schema validation (client sends his XML, I compare that to a known schema and return a code if they got the format wrong).
Thing is: I have a very basic idea of what a schema is!
All I know is that you could have a schema document that describes the format of documents created under that type.
Is there a "for dummies"-style book or web page that takes you through API Schemas and XML Schemas from the beginning (understanding what are XML schemas and why are they used) all the way to a decent java project that utilizes some pro-level java tools?
Diagnosed with autism. Please excuse me if I miscommunicated anything.
In terms of terminology,API's don't have schemas. XML documents have schemas.
Schemas describe what is allowed in an XML document and documents are then validated against a particular schema.
In general, for an API ,use REST,it is easier and far more common these days.
The API and parsing the xml are exclusive of each other in terms of tasks .
The browser calls the API the API then calls the classes that do the work.
Put those classes in their own package and include your own .
Regarding what you actually have to do with the XML documents:
1) I would suggest creating an interface first for what you want to do with the XML.
2) Create tests for what you expect to happen when various methods get called.
3) Program the implementation classes that use the interface (s) you created.
An interface example:
In terms of ,implementing the interface there are a number of java libraries . That's something you can Google and pick one or try it out.
A native library is jaxb . You might want to start there.
I've had tasks where I've had to manipulate data from XML documents or create xml documents. If you have to parse documents there are two main classes that I've used DOMParser and SAXParser .
DOMParser is more flexible but requires more memory because it loads the entire document in to memory first. SAXParser goes top to bottom reading the document so it is good for large documents.
After that is implemented and working then start on the API application the client will use . Using interfaces will help you there as well.
That application will use your XML package to do the actual work.
Hopefully,this will help you get started .
Good luck ,