Thanks. However, I just debugged a bit (in Tuscany 1.7 snapshot), and see the
import.sdo processing being done in class
org.apache.tuscany.sca.databinding.sdo.ImportSDOProcessor
which is deprecated according to its Javadoc. I guess there may be a patch
that never made it into Tuscany 1.x?
Further, although SDOTypesModelResolver is not used, ImportSDOProcessor would
seem able
to load XSDs from HTTP-URIs alright in its importWSDL method (which is
misleadingly named),
and the same would be true of SDOTypesModelResolver#defineFromXSD.
The trouble is, it never gets a chance, because the ArtifactModelResolver only
checks against resource imports (which in turn are checked only against exports
from other contributions), cf. the following excerpt from the resolveModel()
method:
// If not found, delegate the resolution to the imports (in this case based
on the resource imports)
for (Import import_ : this.contribution.getImports()) {
if (import_ instanceof ResourceImport) {
I feel I do not know enough about Tuscany to decide where to apply a change.
Would it seem alright to change ArtifactModelResolver#resolveModel() to
explicitly create an SDOTypesModelResolver and try to resolve the artifact
using that instance, if the existing resolution through the imports fails?
-- Sebastian
PS: On second thoughts, I believe it would be simpler for me to create a special
contribution holding the XSD-files, load that contribution into every node
together
with all my other global libraries and make the XSD-files available for
<import.sdo>
through export.resource/import.resource in sca-contribution.xml.
It wouldn't be as simple as making them available on a webserver, but less
complicated than copying them to specific directories in every contribution,
which was the situation I was facing. However, it's still a bore having to
distribute the XSD's at all...
-----Original Message-----
From: ant elder [mailto:[email protected]]
Sent: Tuesday, November 16, 2010 2:33 PM
To: [email protected]
Subject: Re: http-locations for <import.sdo> element?
On Tue, Nov 16, 2010 at 1:25 PM, Millies, Sebastian
<[email protected]> wrote:
> Hello there,
>
> I am unsatisfied with the <import.sdo> XML element only
> taking a local file path as the location attribute value.
> It would be much nicer if it were possible to specify an
> HTTP-URL from which to retrieve the XSD file.
>
> Has anyone given thought to this? Where could I find the
> relevant source code if I wanted to attempt to code this
> myself?
>
> -- Sebastian
>
>
Its in the databinding-sdo module -
https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/databinding-sdo/
See the classes such as SDOTypesProcessor and SDOTypesModelResolver
...ant