Hi,

Thank you for reporting the issue.

1) The targetNamespace attribute shoudn't be in the sca-definitions.xml
2) Even with that, I tried a similar case and the result is good, i.e. {http://mytest.com}CalculatorComposite is returned.

Which level of Tuscany code are you using?

Thanks,
Raymond

----- Original Message ----- From: "Andrew Mak" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, September 13, 2007 12:19 PM
Subject: reading in sca-contribution.xml file


Hi,

I am trying to read in a simple sca-contribution.xml file using Tuscany.
Here is the contribution file:

<?xml version="1.0" encoding="UTF-8"?>
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0";
   targetNamespace="http://myexample.com/";
   xmlns:test="http://mytest.com/";>
   <deployable composite="test:CalculatorComposite"/>
</contribution>

My test code looks like this:

AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
ContributionFactory contributionFactory = new ContributionFactoryImpl();

ContributionMetadataProcessor processor = new
ContributionMetadataProcessor(assemblyFactory, contributionFactory, null);


InputStream stream = new
FileInputStream("D:\\temp\\sca-contribution.xml");
XMLStreamReader reader =
XMLInputFactory.newInstance().createXMLStreamReader(stream);

Contribution contribution = processor.read(reader);

List<Composite> composites = contribution.getDeployables();

for (Composite composite : composites)
       System.out.println(composite.getName());


The output which I get from running the code is:

{http://myexample.com/}CalculatorComposite

I'm puzzled by the fact the namespace for my composite is
http://myexample.com, which is the targetNamespace of my contribution
file.  I expected the QName of my composite to be {
http://mytest.com/}CalculatorComposite since it's prefixed with "test". If
I remove the targetNamespace attribute completely, then my composite has
no namespace at all.  What am I missing here?  Is there something wrong
with my contribution file and/or my test code?

Thanks in advance.  Any help is much appreciated.

Andrew


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to