You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Dmitry Beransky <dm...@gmail.com> on 2009/07/24 19:44:31 UTC

schema location resolution

Hi,

I have several services deployed under Axis2: S1, S1, S3.  Each
service packages it's own copy of enterprise-common.xsd.  Now I need
to deploy a new service S4 which also has a copy of
enterprise-common.xsd, but this copy is different from those included
with other services (it has new element and type definitions).  The
problem is now, that when I request the schema file like so:
http://localhost/axis2/services/S4/enterprise-common-2.0.xsd, I an
older version of the schema file included with one of the other
services gets served back.

So the question are: 1) why isn't the schema served from the S4
bundle?; 2) is this a bug; 3) is there anything I can do in axis2's
configuration to change this behavior?

Because of the way the build process has historically been set up in
my company, I cannot easily version the schema file (e.g.
enterprise-common-2.1.xsd, doing so would require major changes to the
build process).

Oh, and enterprise-common.xsd gets imported from each service's
specific schema file: [S4.wsdl <-- S4.xsd <-- enterprise.common.xsd].
Axis2 overwrites WSDL's import statement to
schemaLocation="S4?xsd=S4.xsd", but S4.xsd's import statement never
gets overwritten to "schemaLocation=S4?xsd=enterprise-common.xsd"
(which actually works correctly)



thanks
Dmitry

Re: schema location resolution

Posted by Dmitry Beransky <dm...@gmail.com>.
filed as https://issues.apache.org/jira/browse/AXIS2-4451

thanks

On Tue, Jul 28, 2009 at 12:06 PM, Andreas
Veithen<an...@gmail.com> wrote:
> Dmitry,
>
> I already noticed previously that the code responsible for the import
> rewriting and WSDL/XSD request handling looks very suspicious, but I
> didn't realize that it is so broken :-(. Can you please create a JIRA
> report with your findings?
>
> Thanks.
>
> Andreas
>
> On Mon, Jul 27, 2009 at 20:35, Dmitry Beransky<dm...@gmail.com> wrote:
>> On Sat, Jul 25, 2009 at 8:31 AM, Andreas
>> Veithen<an...@gmail.com> wrote:
>>> This means that the XSD file is also in the classpath of the Axis2 web app.
>>
>> I've checked and double checked, there is no other schema file on the
>> classpath.  I've gathered up more data about the issue:
>>
>> So, as I mentioned in the original email, I service S4 uses wsdl from
>> S4.wsdl, which imports schema from S4.xsd, which imports schema from
>> enterprise-common.xsd.
>>
>> The location of service's wsdl is <http://localhost/axis2/services/S4?wsdl>.
>>
>> When Axis2 service the WSDL document, it rewrites schemaLocation to be
>> 'schemaLocation="S4?xsd=S4.xsd"'.  So, S4.xsd's absolute URL becomes
>> <http://location/axis2/services/S4?xsd=S4.xsd>.
>>
>> enterprise-common.xsd location inside of S4.xsd is defined as
>> 'schemaLocation="enterprise-common.xsd"'.  When Axis2 returns S4.xsd
>> it doesn't rewrite schema's location like it does with the wsdl
>> document, so enterprise-common.xsd's absolute URL becomes
>> <http://localhost/axis2/services/enterprise-common.xsd>.
>>
>> When Axis2 recieves a request for
>> <http://localhost/axis2/services/enterprise-common.xsd>, which now
>> doesn't have a service binding in the URL, how does it locate the
>> schema?  From what I can tell, it simply goes through all installed
>> .aars looking for one that has the file.
>>
>> Also, consider these three URLs:
>>
>> 1. http://localhost/axis2/services/enterprise-common.xsd
>> 2. http://localhost/axis2/services/S4/enterprise-common.xsd
>> 3. http://localhost/axis2/services/S4?xsd=enterprise-common.xsd
>>
>> Only #3 returns the schema that is defined inside of S4.aar (the
>> newest version).   #1 & #2 return an older version of
>> enterprise-common.xsd that sits in other .aars.  If I undeploy S1, S2,
>> and S3 .aars, then #1 & #2 return the latest version from S4.
>>
>>
>> Dmitry
>>
>

Re: schema location resolution

Posted by Andreas Veithen <an...@gmail.com>.
Dmitry,

I already noticed previously that the code responsible for the import
rewriting and WSDL/XSD request handling looks very suspicious, but I
didn't realize that it is so broken :-(. Can you please create a JIRA
report with your findings?

Thanks.

Andreas

On Mon, Jul 27, 2009 at 20:35, Dmitry Beransky<dm...@gmail.com> wrote:
> On Sat, Jul 25, 2009 at 8:31 AM, Andreas
> Veithen<an...@gmail.com> wrote:
>> This means that the XSD file is also in the classpath of the Axis2 web app.
>
> I've checked and double checked, there is no other schema file on the
> classpath.  I've gathered up more data about the issue:
>
> So, as I mentioned in the original email, I service S4 uses wsdl from
> S4.wsdl, which imports schema from S4.xsd, which imports schema from
> enterprise-common.xsd.
>
> The location of service's wsdl is <http://localhost/axis2/services/S4?wsdl>.
>
> When Axis2 service the WSDL document, it rewrites schemaLocation to be
> 'schemaLocation="S4?xsd=S4.xsd"'.  So, S4.xsd's absolute URL becomes
> <http://location/axis2/services/S4?xsd=S4.xsd>.
>
> enterprise-common.xsd location inside of S4.xsd is defined as
> 'schemaLocation="enterprise-common.xsd"'.  When Axis2 returns S4.xsd
> it doesn't rewrite schema's location like it does with the wsdl
> document, so enterprise-common.xsd's absolute URL becomes
> <http://localhost/axis2/services/enterprise-common.xsd>.
>
> When Axis2 recieves a request for
> <http://localhost/axis2/services/enterprise-common.xsd>, which now
> doesn't have a service binding in the URL, how does it locate the
> schema?  From what I can tell, it simply goes through all installed
> .aars looking for one that has the file.
>
> Also, consider these three URLs:
>
> 1. http://localhost/axis2/services/enterprise-common.xsd
> 2. http://localhost/axis2/services/S4/enterprise-common.xsd
> 3. http://localhost/axis2/services/S4?xsd=enterprise-common.xsd
>
> Only #3 returns the schema that is defined inside of S4.aar (the
> newest version).   #1 & #2 return an older version of
> enterprise-common.xsd that sits in other .aars.  If I undeploy S1, S2,
> and S3 .aars, then #1 & #2 return the latest version from S4.
>
>
> Dmitry
>

Re: schema location resolution

Posted by Dmitry Beransky <dm...@gmail.com>.
On Sat, Jul 25, 2009 at 8:31 AM, Andreas
Veithen<an...@gmail.com> wrote:
> This means that the XSD file is also in the classpath of the Axis2 web app.

I've checked and double checked, there is no other schema file on the
classpath.  I've gathered up more data about the issue:

So, as I mentioned in the original email, I service S4 uses wsdl from
S4.wsdl, which imports schema from S4.xsd, which imports schema from
enterprise-common.xsd.

The location of service's wsdl is <http://localhost/axis2/services/S4?wsdl>.

When Axis2 service the WSDL document, it rewrites schemaLocation to be
'schemaLocation="S4?xsd=S4.xsd"'.  So, S4.xsd's absolute URL becomes
<http://location/axis2/services/S4?xsd=S4.xsd>.

enterprise-common.xsd location inside of S4.xsd is defined as
'schemaLocation="enterprise-common.xsd"'.  When Axis2 returns S4.xsd
it doesn't rewrite schema's location like it does with the wsdl
document, so enterprise-common.xsd's absolute URL becomes
<http://localhost/axis2/services/enterprise-common.xsd>.

When Axis2 recieves a request for
<http://localhost/axis2/services/enterprise-common.xsd>, which now
doesn't have a service binding in the URL, how does it locate the
schema?  From what I can tell, it simply goes through all installed
.aars looking for one that has the file.

Also, consider these three URLs:

1. http://localhost/axis2/services/enterprise-common.xsd
2. http://localhost/axis2/services/S4/enterprise-common.xsd
3. http://localhost/axis2/services/S4?xsd=enterprise-common.xsd

Only #3 returns the schema that is defined inside of S4.aar (the
newest version).   #1 & #2 return an older version of
enterprise-common.xsd that sits in other .aars.  If I undeploy S1, S2,
and S3 .aars, then #1 & #2 return the latest version from S4.


Dmitry

Re: schema location resolution

Posted by Andreas Veithen <an...@gmail.com>.
This means that the XSD file is also in the classpath of the Axis2 web app.

Andreas

On Fri, Jul 24, 2009 at 19:44, Dmitry Beransky<dm...@gmail.com> wrote:
> Hi,
>
> I have several services deployed under Axis2: S1, S1, S3.  Each
> service packages it's own copy of enterprise-common.xsd.  Now I need
> to deploy a new service S4 which also has a copy of
> enterprise-common.xsd, but this copy is different from those included
> with other services (it has new element and type definitions).  The
> problem is now, that when I request the schema file like so:
> http://localhost/axis2/services/S4/enterprise-common-2.0.xsd, I an
> older version of the schema file included with one of the other
> services gets served back.
>
> So the question are: 1) why isn't the schema served from the S4
> bundle?; 2) is this a bug; 3) is there anything I can do in axis2's
> configuration to change this behavior?
>
> Because of the way the build process has historically been set up in
> my company, I cannot easily version the schema file (e.g.
> enterprise-common-2.1.xsd, doing so would require major changes to the
> build process).
>
> Oh, and enterprise-common.xsd gets imported from each service's
> specific schema file: [S4.wsdl <-- S4.xsd <-- enterprise.common.xsd].
> Axis2 overwrites WSDL's import statement to
> schemaLocation="S4?xsd=S4.xsd", but S4.xsd's import statement never
> gets overwritten to "schemaLocation=S4?xsd=enterprise-common.xsd"
> (which actually works correctly)
>
>
>
> thanks
> Dmitry
>