axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johan Andersson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2-484) Relative SchemaLocations for Xml Schema Imports in WSDL
Date Mon, 03 Apr 2006 17:58:03 GMT
    [ http://issues.apache.org/jira/browse/AXIS2-484?page=comments#action_12372980 ] 

Johan Andersson commented on AXIS2-484:
---------------------------------------

The problem is not the need to include the referenced schemas (in my case they are already
on the server), it's getting WSDL4J to actually locate them in the file system.

Consider this example: 

Axis2 is deployed in Tomcat in the c:\tomcat\webapps\axis2 folder.
Tomcat is started from the command line using a startup.bat script located in c:\tomcat\bin
A service specifying a schema import with the schemaLocation attribute set to "../schemas/schema_to_include.xsd"
is deployed.

Axis2/WSDL4J (not sure which) will now try to load the included schema off the filesystem
relative to the path where the JVM started.

So schemaLocation "../schemas/schema_to_include.xsd" is resolved to c:\tomcat\bin\../schemas/my_included_schema.xsd
and the WSDL cannot be loaded due to not being able to resolve the import (I have no interest
in putting schema files in the tomcat installation directory).
In Websphere this gets even more ugly.

I suggest to either load included schemas through http so a wsdl located at "http://myhost/axis2/services/MyService?wsdl"
including a schema at relative location "../schemas/schema_to_include.xsd" would go looking
for the schema at "http://myhost/axis2/schemas/schema_to_include.xsd".

Or if a similar behaviour could be achieved when loading schemas from the filesystem through
specifying a root from which relative import will be resolved, preferably the WEB-INF folder.

Hope this clear things up.
If not I can try to dig through the code and come up with a fix

> Relative SchemaLocations for Xml Schema Imports in WSDL
> -------------------------------------------------------
>
>          Key: AXIS2-484
>          URL: http://issues.apache.org/jira/browse/AXIS2-484
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>   Components: wsdl
>     Versions: 0.94
>  Environment: WinXP, Tomcat 4, 5, Websphere 6
>     Reporter: Johan Andersson

>
> If an xml schema import (xsd:import) is added in the WSDL, Axis2 will go looking for
that import in locations the developer has no control over.
> It seems that Axis2 parses the WSDL into an object structure server side when the service
is first loaded. 
> If a relative schema import is in the WSDL the parser (WSDL4J) will try to load the import
off the filesystem relative to where the jvm (application server) started. 
> Then this fails the WSDL will not be available for download/consumption from the Axis2
server.
> It seems (not sure) a possible solution could be to set a context root for WSDL4J to
work with.
> Preferably this would be the logical "services" context in the webapp so that the relative
path would work for both WSDL4J parsing the WSDL serverside and for a webservice consumer
downloading the WSDL and imports.

-- 
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


Mime
View raw message