257
252
located here are the descriptions of the JSON representations those
260
======================================
261
Description of the service root itself
262
======================================
264
Let's whittle down the complexity a little by taking a look at the
265
description of the service root resource itself.
255
Description of the full service
256
--------------------------------
258
The first two tags in the WADL file are human-readable documentation
259
for the entire web service.
267
262
>>> from lxml.etree import _Comment
268
263
>>> children = [child for child in tree
269
264
... if not isinstance(child, _Comment)]
270
>>> resources, service_root_type, service_root_repr = children[:3]
266
>>> service_doc, version_doc = children[:2]
267
>>> print service_doc.attrib['title']
269
>>> for p_tag in service_doc:
271
This is a web service.
274
>>> print version_doc.attrib['title']
276
>>> for p_tag in version_doc:
278
The unstable development version.
279
Don't use this unless you like changing things.
281
Description of the service root itself
282
--------------------------------------
284
Let's whittle down the complexity a little more by taking a look at
285
the description of the service root resource itself.
287
>>> resources, service_root_type, service_root_repr = children[2:5]
271
288
>>> # We'll deal with the rest of the children later.
272
>>> other_children = children[3:]
289
>>> other_children = children[5:]
274
291
The service root is an instance of a special resource type that
275
292
responds only to GET.