[
http://issues.apache.org/jira/browse/WODEN-5?page=comments#action_12415249 ]
John Kaputin commented on WODEN-5:
----------------------------------
I have committed code to support reading WSDL from other formats such
as a DOM Element or Document or an InputSource, however I have not used
methods like readWSDL(String, Element) on WSDLReader.
I did not want to simply add to the WSDLReader interface WSDL4J-like
methods such as readWSDL(String, Element) or readWSDL(String, Document)
because this would make the WSDLReader API dependant on DOM which defeats
one of Woden's objectives for supporting different types of XML parser
and XML object model without tying the Woden API to any particular one.
Instead I have create an API interface called org.apache.woden.WSDLSource
which stores the WSDL source object and the document base URI. A WSDLSource
object is obtained by calling the WSDLReader.createWSDLSource() method.
The WSDLSource setSource and setBaseURI methods are called before invoking
WSDLReader.readWSDL(WSDLSource) or readWSDL(WSDLSource, ErrorHandler).
WSDLSource.setSource(java.lang.Object) trades compile time type safety for
XML parser independence in the Woden API. The WSDLSource implementation
should provide runtime time type checking in its setSource method.
The concrete reader's implementation of the createWSDLSource() method will
return an implementation of WSDLSource compatible with the reader. That is,
one that will perform runtime type checking in the setSource method to
ensure the source Object is of a type compatible with the reader, and
throw a WSDLException if it's not.
Here's a progamming example based on the existing DOM reader implementation:
WSDLSource wsdlSource = domReader.createWSDLSource();
wsdlSource.setBaseURI(wsdlURI);
//type checking of compatible object types done next
wsdlSource.setSource(domElement);
DescriptionElement desc = reader.readWSDL(wsdlSource);
The Javadoc of WSDLReader and WSDLSource provide further information.
An alternative option was to capture these methods in a DOM-specific Woden API,
like an API subset, but this suggests making some parts of the overall Woden API
optional to implementors (i.e. to a StAX implementor) and this approach
probably requires more thought and discussion.
> The WSDLReader should offer more methods to parse WSDL documents from dom,
> sax, etc...
> --------------------------------------------------------------------------------------
>
> Key: WODEN-5
> URL: http://issues.apache.org/jira/browse/WODEN-5
> Project: Woden
> Type: New Feature
> Components: Parser
> Reporter: Guillaume Nodet
> Assignee: John Kaputin
> Priority: Critical
> Attachments: readWSDL.patch
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]