[ 
https://issues.apache.org/jira/browse/TUSCANY-3559?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868570#action_12868570
 ] 

Mike Edwards commented on TUSCANY-3559:
---------------------------------------

The WSDL processing uses StaXHelper.createXMLStreamReader( URL url) when 
opening a WSDL for reading.

This method creates an XMLStreamReader using a simple InputStream, which 
unfortunately means that the original URL for the WSDL, passed in to the 
method, is in effect thrown away since the InputStream retains no knowledge of 
its originating URL.  Thus, when the reference to an external file (the DTD for 
example) is encountered, there is no context for the reference and so a simple 
reference using a relative URL like "foobar.dtd" cannot be resolved (the 
intention in using such relative URLs is effectively to say "use the same 
directory as the original file...").

This can be changed quite simply, by instead using a StreamSource instead of an 
InputStream - since a StreamSource remembers the original URL and with the 
result that the XML Parser can successfully resolve the relative URLs of the 
kind shown above.

So, the change to resolve this JIRA is to change the implementation of 
StaXHelper.createXMLStreamReader( URL url) (in tuscany-common-xml) to use the 
following sequence:

            StreamSource scdlSource = new StreamSource( openStream(url), 
url.toString() );
            return inputFactory.createXMLStreamReader(scdlSource);


> Enable Tuscany to process WSDL files that contain DTDs
> ------------------------------------------------------
>
>                 Key: TUSCANY-3559
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-3559
>             Project: Tuscany
>          Issue Type: Improvement
>          Components: Java SCA Core Runtime
>    Affects Versions: Java-SCA-2.0-M4
>            Reporter: Mike Edwards
>            Assignee: Mike Edwards
>            Priority: Minor
>             Fix For: Java-SCA-2.0-M5
>
>
> Currently, Tuscany cannot process WSDL files that contain references to DTDs.
> This is an unnecessary limitation and prevents the parameterization of WSDL 
> files through the use of Entity References, since it is external DTDs that 
> provide the means of separately setting the values of Entities that can then 
> be referenced within the WSDLs.
> This is needed for the OASIS testcases, where in particular there is the need 
> to parameterize Web service endpoint addresses, which vary from one SCA 
> runtime to another.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to