You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by "John Kaputin (JIRA)" <ji...@apache.org> on 2008/01/04 01:08:33 UTC

[jira] Commented: (WODEN-192) schemaLocation URI not resolved correctly using jar files

    [ https://issues.apache.org/jira/browse/WODEN-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555730#action_12555730 ] 

John Kaputin commented on WODEN-192:
------------------------------------

A solution is to use the java.net.URL constructor URL(contextURL, specString) instead of the URI resolve() method. The contextURL can be created from the jar file path for the WSDL (the baseURI) and passed to this URL constructor along with the schemaLocation value. This will resolve correctly.


> schemaLocation URI not resolved correctly using jar files
> ---------------------------------------------------------
>
>                 Key: WODEN-192
>                 URL: https://issues.apache.org/jira/browse/WODEN-192
>             Project: Woden
>          Issue Type: Bug
>          Components: Parser
>            Reporter: John Kaputin
>            Assignee: John Kaputin
>             Fix For: M8
>
>
> As per the woden-dev thread at [1], when the WSDL and XSD files are packaged inside a jar file, a relative path URI on the schemaLocation attribute of a schema import is not resolved correctly against the base jar URI of the containing WSDL file.
> For example, if the WSDL base URI is "jar:file:///C:/temp/test.jar!/META-INF/foo.wsdl" and this WSDL has an inlined schema containing a schema import with schemaLocation="bar.xsd" and this XSD file is also packaged in the META-INF directory of the jar file, the resolved XSD URI should be "jar:file:///C:/temp/test.jar!/META-INF/bar.xsd".
> Currently, this will only work if a catalog is configured which maps the schemaLocation URI to the jar file URI (see the email thread for more info). Then, Woden's SimpleURIResolver will resolve the XSD path correctly. But this is not convenient for applications that don't have direct access to Woden (e.g. Axis2 user apps).
> The problem is that Woden's SchemaResolverAdapter class, which gets registered with WS-Commons XmlSchema, uses the resolve(URI) method of java.net.URI to resolve the the baseURI and schemaLocation URI - as in, baseURI.resolve(schemaLocation). However, this method does not work if baseURI is opaque - instead, it just returns the schemaLocation which in turn gets resolved against the current directory. A jar file URI ("jar:file:/...") is an opaque URI (see URI javadoc).
> [1] http://mail-archives.apache.org/mod_mbox/ws-woden-dev/200712.mbox/%3cb72c94b30712261948x5b276fe3t103eff70163f1468@mail.gmail.com%3e

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


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