ws-woden-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Kaputin <KAPU...@uk.ibm.com>
Subject Plan to handle parsing errors and validation.
Date Wed, 12 Oct 2005 09:54:17 GMT
Yesterday I discussed the qname issue and other validation issues with
Lawrence.  This is a summary of how we plan to progress for milestone 2.
Any comments or suggestions are welcome.

Don't store the string values of attributes with prefixed names (as
proposed in John Kaputin's earlier posting). Resolve the namespaces and
create QNames at parse-time, reporting any namespace resolution errors as
they occur. If a namespace error does occur, create the QName with a ""
(empty string) namespace and whatever the local part and prefix are in the
xml. An empty string namespace will indicate to the Woden validator that a
namespace error exists for that QName. Note that unqualified names in the
WSDL will have the default namespace so the QName created will have a
namespace value equal to the default namespace, a local part equal to the
unqualified name and a prefix of "" (i.e. it won't use "" in the namespace
field, so we can use the "" convention described here for indicating QName
namespace errors).

WSDL validation in Woden includes schema validation (if supported by the
xml parser) and checking of the WSDL object model by the Woden validator.
Terminating errors in Woden include configuration errors and parser
exceptions such as DOMException. These will be wrapped, if necessary, and
thrown as WSDLExceptions and any in-progress parsing will stop.
Non-terminating errors are parse-time WSDL errors from which we can
continue, even if we can't build the complete wsdl model.

Unless terminating errors are encountered when parsing the WSDL, we should
try to create as much of the wsdl model as we can, even if we end up with a
partially complete wsdl model.   If wsdl validation is turned on in Woden,
report the parse-time errors and carry on completing as much of the model
as possible. If validation is turned off, carry on creating the model if
possible without reporting the errors. One usage scenario for creating a
partially complete wsdl model with parse-time validation turned off is when
a WSDL editing tool is being used to work on an incomplete WSDL document
and the WSDL only gets validated when requested by the user.

TODO - consider the scenario where a runtime system may run with validation
turned off for performance - here, a parse-time error should probably
terminate with a WSDLException, not return a partially complete model.
Consider how to distinguish this scenario from the WSDL editor scenario
above (perhaps via reader configuration features)

For now, report any non-terminating, parse-time errors as they occur (e.g.
qname namespace resolution errors, xml parser warnings and non-fatal
errors). Later we can decide if these error messages should be cached at
parse-time and handled by the validator instead.

We will need a mechanism to determine at the end of the parse if any errors
have been reported either by Woden or by the xml parser so as not to
continue on with validating the Component model (i.e. report and fix the
known errors in the xml first).

In the xml-based wsdl model represented by the org.apache.woden.wsdl20.xml
interfaces (i.e. the xxxElement interfaces), we should base element
references on real xxxElement objects, not QNames or prefixed name strings.
For example, BindingElement should represent the <binding> element's
'interface' attribute with a reference to an InterfaceElement object (not
to its QName object).

We need to capture at parse-time the line/column numbers for the start tag
of each wsdl element. These are used by the ErrorReporter. We also plan to
use them for calculating offsets to pinpoint errors at a more fine-grained
level (e.g. error reporting that highlights particular attributes or
attribute values).


regards,
John Kaputin


---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org


Mime
View raw message