Hi Oshani,
thanks for the updates. I wanted to make sure you were happy with my
changes to the DOM impl before making changes to OM, etc. But I certainly
can make the same changes to OM now, if you haven't done them already.
There may be other changes to follow as I am still reviewing the code.
I will also make the IllegalArgumentException change in the setSource
methods.
Regarding the try/catch block in reader.createElementSource, you wrote:
> The error still has to be recorded there some how,isn't it?
The IllegalArgumentException will contain the formatted WSDL019 error
message. This type of error (invalid input to setSource) should be exposed
directly to the client application by throwing the exception. It's up to
the client application to catch it and use exception.printStackTrace or
exception.getMessage to see see the details. We shouldn't use
printStackTrace() with the Woden implementation (although I've just noticed
some uses of it that we'll need to remove).
The Woden approach to reporting errors is:
(1) if we can continue from an error then it gets reported by the
ErrorReporter.reportError method and processing continues. The
ErrorReporter will invoke the ErrorHandler to actually do handle the
reporting and it's up to the ErrorHandler implementation to decide what
that is. The default error handler provided with Woden just prints to
Sysout.
(2) if we can't continue from an error then we throw an exception
containing a formatted error message. This might be a WSDLException or a
more specific runtime exception like IllegalArgumentException. Sometimes
the Woden implementation catches a checked exception like
MalformedURLException which we wrap as a WSDLException and rethrow.
So, in createElementSource we should just instantiate the ElementSource
object, setting the ErrorReporter, then call setSource and if it throws an
IllegalArgumentException just let it surface up to the client application
(it's a runtime exception so we don't need to declare a throws clause).
regards,
John
"Oshani
Seneviratne"
<[EMAIL PROTECTED] To
m> [email protected]
cc
08/09/2006 10:03
Subject
Re: WODEN-44 ElementSource feedback
Please respond to
[EMAIL PROTECTED]
he.org
Hi John,
Please see my comments in line.
On 9/8/06, John Kaputin <[EMAIL PROTECTED]> wrote:
>
> Oshani,
> in the WODEN-44 branch...
>
> I have added some error messages to the Messages.properties file and
> updated the error numbers used in the code.
>
Thanks for reviewing the code and making the necessary changes!
> I have made some other changes to some of the DOM impl classes, but not
yet
> to the OM impl classes.
>
Are you planning to do the same changes to the OM impl classes? (I
mean correcting the error code and the checks for null arguments).
Is there anything else that needs to be changed in your opinion?
> I now think that ElementSource.setSource implementations should throw an
> IllegalArgumentException rather than a WSDLException if the source
argument
> is of the wrong type. 'throws WSDLException' can then be removed from the
> DOMElementSource.setSource method declaration. Then in the
> reader.createElementSource method implementation, the try/catch block can
> be removed. What do you think?
+1. Let's make that change.
However I do not understand what you mean by "Then in the
reader.createElementSource method implementation, the try/catch block
can be removed." The error still has to be recorded there some how,
isn't it?
I believe I forgot to discuss about the introduction of the
createElementSource method in the WSDLReader interface. The rationale
behind introducing it there was to enable any element in the WSDL to
wrap itself in an ElementSource (obviously :) ) through any of the
reader implementations. I hope it's okay to have such an element level
method in the WSDLReader interface. If not, let's discuss.
Thanks,
Oshani.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]