You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Simon Laws (JIRA)" <tu...@ws.apache.org> on 2006/06/28 17:17:32 UTC

[jira] Created: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

xsi:type on root element fo XML doc causes problems
---------------------------------------------------

         Key: TUSCANY-505
         URL: http://issues.apache.org/jira/browse/TUSCANY-505
     Project: Tuscany
        Type: Bug

  Components: Java SDO Implementation  
    Versions: Java-M1    
 Environment: Windows XP
    Reporter: Simon Laws


If I read the following doc:

<tns:RootElement xmlns:p="commonj.sdo"
    xmlns:tns="http://www.apache.org/tuscany/interop"
    xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
    <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
</tns:RootElement>

With the following schema

<schema xmlns=" http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://www.apache.org/tuscany/interop"
        xmlns:tns=" http://www.apache.org/tuscany/interop">
 
  <include schemaLocation="interop10.xsd"/>
     
  <!-- top level test type -->      
  <complexType name="ComplexTypeRootType">
    <sequence>
      <!-- simple types -->
      <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>

    </sequence>
  </complexType>
       
  <element name="RootElement" type="tns:ComplexTypeRootType"/>
</schema>

The I get a valid document (doc) with some data objects in it out of the following code:

        FileInputStream inFileStream = new FileInputStream (inFileName);
        XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);

If I try in read in (note I have added and xsi:type attribute):

<tns:RootElement xmlns:p="commonj.sdo"
    xsi:type="tns:ComplexTypeRootType"
    xmlns:tns="http://www.apache.org/tuscany/interop "
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
    <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
</tns:RootElement>

The XMLHelper silently makes an empty document, i.e. the root element is null.

I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

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


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


[jira] Commented: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

Posted by "Simon Laws (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-505?page=comments#action_12418408 ] 

Simon Laws commented on TUSCANY-505:
------------------------------------

1/ Apologies about the spaces in the namespaces in XSD/XML. I have no idea how they got there. I have just checked the source files from which I copied these examples and they do not have spaces. So the spaces appeared in the process of me cutting them out of the example files and pasting them into the JIRA. I know not how but sorry about that. I must be going senile:-(

2/ Let me approach the actual problem in a slightly different way. The XSD/XML/code I gave is actually a contrived example. The problem also occurs in trying to get C++ and Java SCA to interoperate. C++ SCA produces XML with xsi:type entries on the root element. The SDO data binding in Java SCA fails in the way described and hence C++ and Java SCA are not currently interoperable which is a shame. The code that converts the input XML stream to the SDO data object can be found in org.apache.tuscany.databinding.sdo.SDOXMLHelper.java::toDataObject() and does this...

            XMLHelper xmlHelper = SDOUtil.createXMLHelper(typeHelper);
            XMLDocument document = xmlHelper.load(new ByteArrayInputStream(xmlBytes));
            return document.getRootObject();

In the case of a message arriving over SOAP there is no schema in the XML of course but I would expect the type model in SDO to have been created based on the schema in the WSDL. From your testing it seems to work if you have loaded the correct schema beforehand so maybe this means that there is a problem with the typeHelper in the SDO binding code.  I'm just guessing here as I don;t know what SDOUtil.createXMLHelper(typeHelper); does. I haven't managed to track back through the call stack yet to find out how this works but if anyone knows of the top of their head feel free to shout.

For extra information here are the working and non working SOAP messages...

First the message from C++ that doesn't work for the reasons discussed....

POST /interop-stockquote/services/StockQuoteService HTTP/1.1
User-Agent: Axis2/C
SOAPAction: "http://www.quickstockquote.com/StockQuoteService/getQuote"
Content-Length: 713
Content-Type: text/xml;charset=UTF-8
Host: localhost:8080

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:To>http://localhost:8081/interop-stockquote/services/StockQuoteService</wsa:To>
    <wsa:Action>http://www.quickstockquote.com/StockQuoteService/getQuote</wsa:Action>
    <wsa:MessageID>870bf065-6849-47fb-86ad-224b81513541</wsa:MessageID>
  </soapenv:Header>
  <soapenv:Body>
    <getQuote xsi:type="getQuote" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                                  xmlns="http://www.quickstockquote.com/StockQuoteService/" 
                                  xmlns:tns="http://www.quickstockquote.com/StockQuoteService/">
      <symbol>IBM</symbol>
    </getQuote>
  </soapenv:Body>
</soapenv:Envelope>

Here is the same message but from a Java cleint. This does work....

POST /interop-stockquote/services/StockQuoteService HTTP/1.1
User-Agent: Axis/2.0
SOAPAction: http://www.quickstockquote.com/StockQuoteService/getQuote
Host: localhost:8080
Content-Length: 307
Content-Type: text/xml; charset=UTF-8


<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header />
  <soapenv:Body>
    <Service:getQuote xmlns:Service="http://www.quickstockquote.com/StockQuoteService/">
      <symbol>IBM</symbol>
    </Service:getQuote>
  </soapenv:Body>
</soapenv:Envelope>


> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>          Key: TUSCANY-505
>          URL: http://issues.apache.org/jira/browse/TUSCANY-505
>      Project: Tuscany
>         Type: Bug

>   Components: Java SDO Implementation
>     Versions: Java-M1
>  Environment: Windows XP
>     Reporter: Simon Laws

>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop"
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://www.apache.org/tuscany/interop"
>         xmlns:tns=" http://www.apache.org/tuscany/interop">
>  
>   <include schemaLocation="interop10.xsd"/>
>      
>   <!-- top level test type -->      
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>        
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is null.
> I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

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


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


[jira] Updated: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

Posted by "Jim Marino (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Marino updated TUSCANY-505:
-------------------------------

        Fix Version/s:     (was: Java-SCA-M3)
                       Java-SCA-2.0-Alpha
    Affects Version/s:     (was: Java-M1)
                       Java-SCA-2.0-Alpha

> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>                 Key: TUSCANY-505
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-505
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core
>    Affects Versions: Java-SCA-2.0-Alpha
>         Environment: Windows XP
>            Reporter: Simon Laws
>             Fix For: Java-SCA-2.0-Alpha
>
>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop"
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://www.apache.org/tuscany/interop"
>         xmlns:tns=" http://www.apache.org/tuscany/interop">
>  
>   <include schemaLocation="interop10.xsd"/>
>      
>   <!-- top level test type -->      
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>        
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is null.
> I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

-- 
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


[jira] Updated: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-505?page=all ]

Frank Budinsky updated TUSCANY-505:
-----------------------------------

    Component/s: Java SCA Core
                     (was: Java SDO Implementation)

>From Yang's investigation, this seems to be a problem with metadata not being registered in the SCA environment, so changing component to SCA for futher investigation.

> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>                 Key: TUSCANY-505
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-505
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core
>    Affects Versions: Java-M1
>         Environment: Windows XP
>            Reporter: Simon Laws
>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop"
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://www.apache.org/tuscany/interop"
>         xmlns:tns=" http://www.apache.org/tuscany/interop">
>  
>   <include schemaLocation="interop10.xsd"/>
>      
>   <!-- top level test type -->      
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>        
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is null.
> I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

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

        

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


[jira] Updated: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

Posted by "Jean-Sebastien Delfino (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Sebastien Delfino updated TUSCANY-505:
-------------------------------------------

    Fix Version/s:     (was: Java-M2)
                   Java-M3

> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>                 Key: TUSCANY-505
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-505
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core
>    Affects Versions: Java-M1
>         Environment: Windows XP
>            Reporter: Simon Laws
>             Fix For: Java-M3
>
>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop"
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://www.apache.org/tuscany/interop"
>         xmlns:tns=" http://www.apache.org/tuscany/interop">
>  
>   <include schemaLocation="interop10.xsd"/>
>      
>   <!-- top level test type -->      
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>        
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is null.
> I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

Posted by "Ed Slattery (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-505?page=comments#action_12418423 ] 

Ed Slattery commented on TUSCANY-505:
-------------------------------------

The SDO spec says:

When saving the root element, an xsi:type may always be written in the XML to record the
root DataObject's Type. If the rootElementURI and rootElementName correspond to a
valid global element for that DataObject's Type, then an implementation may suppress the
xsi:type.

So, I could suppress the xsi:type, but in theory I should not have to. Isnt it better to get the implementation coping with it, rather than suppress it?

> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>          Key: TUSCANY-505
>          URL: http://issues.apache.org/jira/browse/TUSCANY-505
>      Project: Tuscany
>         Type: Bug

>   Components: Java SDO Implementation
>     Versions: Java-M1
>  Environment: Windows XP
>     Reporter: Simon Laws

>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop"
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://www.apache.org/tuscany/interop"
>         xmlns:tns=" http://www.apache.org/tuscany/interop">
>  
>   <include schemaLocation="interop10.xsd"/>
>      
>   <!-- top level test type -->      
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>        
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is null.
> I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

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


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


[jira] Updated: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

Posted by "ant elder (JIRA)" <tu...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/TUSCANY-505?page=all ]

ant elder updated TUSCANY-505:
------------------------------

    Fix Version/s: Java-M2

> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>                 Key: TUSCANY-505
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-505
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core
>    Affects Versions: Java-M1
>         Environment: Windows XP
>            Reporter: Simon Laws
>             Fix For: Java-M2
>
>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop"
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://www.apache.org/tuscany/interop"
>         xmlns:tns=" http://www.apache.org/tuscany/interop">
>  
>   <include schemaLocation="interop10.xsd"/>
>      
>   <!-- top level test type -->      
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>        
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is null.
> I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

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

        

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


[jira] Commented: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

Posted by "Yang ZHONG (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-505?page=comments#action_12418502 ] 

Yang ZHONG commented on TUSCANY-505:
------------------------------------

Someone has to load the schema before the XML can be loaded "correctly".
What I mean "correctly" is the loaded instance is THE schema's instance, NOT anyType instance.

I don't think SDO spec has defined such behavior that schema will be LOCATED AND loaded automatically by SDO.
Before you manage the spec changed if you ever want to, it seems to me only 2 potential ways out of the problem so far:
2-1. User/You loads the schema before loading XML
2-2. SCA loads the schema automatically (from WSDL) for users/you

Neither of the potential solutions so far seems specific to "Java SDO Implementation".
We may want to change the issue compoenent to SCA if 2-2 is preferred,
otherwise close the issue as "usage error".

Thanks.

> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>          Key: TUSCANY-505
>          URL: http://issues.apache.org/jira/browse/TUSCANY-505
>      Project: Tuscany
>         Type: Bug

>   Components: Java SDO Implementation
>     Versions: Java-M1
>  Environment: Windows XP
>     Reporter: Simon Laws

>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop"
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://www.apache.org/tuscany/interop"
>         xmlns:tns=" http://www.apache.org/tuscany/interop">
>  
>   <include schemaLocation="interop10.xsd"/>
>      
>   <!-- top level test type -->      
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>        
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is null.
> I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

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


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


[jira] Commented: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

Posted by "Yang ZHONG (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-505?page=comments#action_12418335 ] 

Yang ZHONG commented on TUSCANY-505:
------------------------------------

First of all, there're spaces within NameSpace in both XSD and XML, it makes references broken, especially
    <schema xmlns=" http://www.w3.org/2001/XMLSchema"
makes SDO implementation NOT recognizing XSD at all.
My previous commercial product experience has taught me that utilizing XSD and XML validator may save issue opener many time.

I've tried to reproduce, without calling XSDHelper#define, I get
    org.apache.tuscany.sdo.impl.AnyTypeDataObjectImpl
from the XML without xsi:type, and NO root from the XML with xsi:type.
That seems the same result Simon is seeing.

I've also tried XMLHelper#load(inputStream,LOCATION,options) and hope the loader can pick up the XSD since the XMLs have specified schemaLocation as
    xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
Unfortunately, XMLHelper seems ignoring the specified schema.

Calling XSDHelper#define (and having corrected the XSD and XML), then I get things working:

public final class XsiType extends junit.framework.TestCase
{
  public void test () throws java.io.IOException
  {
    final ClassLoader classes = XsiType.class.getClassLoader();
    java.net.URL url = classes.getResource( "interop01.xsd");
    XSDHelper.INSTANCE.define( url.openStream(), url.toString());
      //  IOException may be thrown
//    assertNotNull( XSDHelper.INSTANCE.getGlobalProperty( "http://www.apache.org/tuscany/interop", "RootElement", true));
//    assertNotNull( TypeHelper.INSTANCE.getType( "http://www.apache.org/tuscany/interop", "ComplexTypeRootType"));
    url = classes.getResource( "typeXSI.XML");
    final Object  root = XMLHelper.INSTANCE.load
      //  IOException may be thrown
    ( 
      url.openStream()  
        //  IOException may be thrown
    ).getRootObject();
    assertNotNull( root);
  }
}

So, I think it's a usage error.
On the other hand, not sure if XMLHelper needs to honor schemaLocation. If yes, current XMLHelper#load may have a defect.

> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>          Key: TUSCANY-505
>          URL: http://issues.apache.org/jira/browse/TUSCANY-505
>      Project: Tuscany
>         Type: Bug

>   Components: Java SDO Implementation
>     Versions: Java-M1
>  Environment: Windows XP
>     Reporter: Simon Laws

>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop"
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://www.apache.org/tuscany/interop"
>         xmlns:tns=" http://www.apache.org/tuscany/interop">
>  
>   <include schemaLocation="interop10.xsd"/>
>      
>   <!-- top level test type -->      
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>        
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is null.
> I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

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


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


[jira] Commented: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

Posted by "Yang ZHONG (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-505?page=comments#action_12418515 ] 

Yang ZHONG commented on TUSCANY-505:
------------------------------------

We can take a close look at
    <getQuote xsi:type="getQuote" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                                  xmlns="http://www.quickstockquote.com/StockQuoteService/" 
                                  xmlns:tns="http://www.quickstockquote.com/StockQuoteService/"> 
      <symbol>IBM</symbol> 
    </getQuote> 

"xmlns=" means "getQuote" under "http://www.quickstockquote.com/StockQuoteService/",
I believe that conforms to Simon's XSD.

However, "xmlns=" also means "symbol" also under "http://www.quickstockquote.com/StockQuoteService/",
that's NOT conforming unless Simon's XSD explicitly defines "symbol" GLOBAL element.

As expected, given a XSD without the GLOBAL element definition, "xmlns=" generates this exception to me:
    org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature '...' not found.

In a word, if not all elements are defined as GLOBAL element, "xmlns=" seems still "usage error".

> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>          Key: TUSCANY-505
>          URL: http://issues.apache.org/jira/browse/TUSCANY-505
>      Project: Tuscany
>         Type: Bug

>   Components: Java SDO Implementation
>     Versions: Java-M1
>  Environment: Windows XP
>     Reporter: Simon Laws

>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop"
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://www.apache.org/tuscany/interop"
>         xmlns:tns=" http://www.apache.org/tuscany/interop">
>  
>   <include schemaLocation="interop10.xsd"/>
>      
>   <!-- top level test type -->      
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>        
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is null.
> I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

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


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


[jira] Commented: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

Posted by "Frank Budinsky (JIRA)" <tu...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/TUSCANY-505?page=comments#action_12418510 ] 

Frank Budinsky commented on TUSCANY-505:
----------------------------------------

This all seem quite odd. If the metadata has been registered in the case that the message comes form the Java client, it should also be there in the C++ case, unless there's some special SCA kludge that isn't kicking in this case.

The only things that look different in the C++ message are:

1) the xsi:type.
2) two namespace prefixes for the StockQuoteService namespace:
           xmlns="http://www.quickstockquote.com/StockQuoteService/"
           xmlns:tns="http://www.quickstockquote.com/StockQuoteService/"
     This also seems odd.

Based on Yang's testing, the first one doesn't seem to be a problem for the Java SDO loader. Not sure about the second one. It seems harmless, but maybe Yang can you try an example like that, just to be sure.

At any rate, it seem quite likely that this problem should be switched to the SCA component.

> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>          Key: TUSCANY-505
>          URL: http://issues.apache.org/jira/browse/TUSCANY-505
>      Project: Tuscany
>         Type: Bug

>   Components: Java SDO Implementation
>     Versions: Java-M1
>  Environment: Windows XP
>     Reporter: Simon Laws

>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop"
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://www.apache.org/tuscany/interop"
>         xmlns:tns=" http://www.apache.org/tuscany/interop">
>  
>   <include schemaLocation="interop10.xsd"/>
>      
>   <!-- top level test type -->      
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>        
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is null.
> I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

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


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


[jira] Resolved: (TUSCANY-505) xsi:type on root element fo XML doc causes problems

Posted by "Jean-Sebastien Delfino (JIRA)" <tu...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Sebastien Delfino resolved TUSCANY-505.
--------------------------------------------

    Resolution: Fixed

This should now work with the changes we've made handle SDO registration in an SCA component.

 -If you're using static SDOs, then the SDO databinding will register them automatically in the HelperContext it uses to handle serialization/deserialization

- If you're using dynamic SDOs, then the app developer is responsible for registering the XSDs he cares about in HelperContext.INSTANCE, in the init method of one of his components for example, or in his client code.

Please reopen the JIRA if you can reproduce the issue again.

> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>                 Key: TUSCANY-505
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-505
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core Runtime
>    Affects Versions: Java-SCA-M2
>         Environment: Windows XP
>            Reporter: Simon Laws
>             Fix For: Java-SCA-Next
>
>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop"
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema"
>         targetNamespace="http://www.apache.org/tuscany/interop"
>         xmlns:tns=" http://www.apache.org/tuscany/interop">
>  
>   <include schemaLocation="interop10.xsd"/>
>      
>   <!-- top level test type -->      
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName" type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>        
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is null.
> I talked with Frank and he suggested changing the xsi:type to refer to a type that extends the root element type. This produced the same effect, i.e. and empty document. However xsi:type does seem to behave in both the base type and extension type case when attached to elements other than the root element. 

-- 
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org