You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "David Kocher (JIRA)" <ax...@ws.apache.org> on 2005/07/01 15:43:01 UTC

[jira] Created: (AXIS-2098) xsi:type added to derived simple types

xsi:type added to derived simple types
--------------------------------------

         Key: AXIS-2098
         URL: http://issues.apache.org/jira/browse/AXIS-2098
     Project: Apache Axis
        Type: Bug
  Components: Basic Architecture  
    Versions: 1.2.1    
    Reporter: David Kocher
 Attachments: helloworld.tar.gz

Given a simple type such as

    <xs:simpleType name="LogicType">
        <xs:restriction base="xs:boolean">
            <xs:pattern value="true"/>
            <xs:pattern value="false"/>
        </xs:restriction>
    </xs:simpleType>

Axis will serialize this as 

               <Logic xsi:type="xsd:boolean">true</Logic>

which won't validate because

Type 'xsd:boolean' is not validly derived from the type definition, 'LogicType', of element 'Logic'.

This is only the case in the request message; the response message of the same type is sent correctly.

See the attached sample project.


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


Re: [jira] Commented: (AXIS-2098) xsi:type added to derived simple types

Posted by Davanum Srinivas <da...@gmail.com>.
 Jongjin,

Please go ahead and commit the code and test case.

thanks,
dims

On 8/1/05, Jongjin Choi (JIRA) <ax...@ws.apache.org> wrote:
>     [ http://issues.apache.org/jira/browse/AXIS-2098?page=comments#action_12317355 ]
> 
> Jongjin Choi commented on AXIS-2098:
> ------------------------------------
> 
> Dims and all.
> 
> I fixed the AXIS-2098 and AXIS-2103.
> I'd like you to review the patches before I commit.
> All-tests passed with the latest cvs.
> The patch and test-case will be attached.
> 
> This is the change log.
> ==================
> Fix for AXIS-2098, 2103
> - WSDDTypeMapping : Register exact type mapping for primtive type at the server-side. (primitive type instead of primitive wrapper)
> - JavaStubWriter : Register exact type mapping for schema derived types in the client side.
> - Serialization : Pass the java class to the SerializationContext to determine actual java type for serialization
> - TypeMappingImpl : find serializer using xml type. (for schema derived types)
> - JavaBeanHelperWriter : write exact type qname for schema ref'ed element. (AXIS-2103)
> ==================
> 
> 
> 
> > xsi:type added to derived simple types
> > --------------------------------------
> >
> >          Key: AXIS-2098
> >          URL: http://issues.apache.org/jira/browse/AXIS-2098
> >      Project: Apache Axis
> >         Type: Bug
> >   Components: Basic Architecture
> >     Versions: 1.2.1
> >     Reporter: David Kocher
> >     Priority: Blocker
> >  Attachments: helloworld.tar.gz, src_2005_08_01.patch
> >
> > Given a simple type such as
> >     <xs:simpleType name="LogicType">
> >         <xs:restriction base="xs:boolean">
> >             <xs:pattern value="true"/>
> >             <xs:pattern value="false"/>
> >         </xs:restriction>
> >     </xs:simpleType>
> > Axis will serialize this as
> >                <Logic xsi:type="xsd:boolean">true</Logic>
> > which won't validate because
> > Type 'xsd:boolean' is not validly derived from the type definition, 'LogicType', of element 'Logic'.
> > This is only the case in the request message; the response message of the same type is sent correctly.
> > See the attached sample project.
> 
> --
> 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
> 
> 


-- 
Davanum Srinivas -http://blogs.cocoondev.org/dims/

[jira] Updated: (AXIS-2098) xsi:type added to derived simple types

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2098?page=all ]

Davanum Srinivas updated AXIS-2098:
-----------------------------------

    Priority: Blocker  (was: Major)

> xsi:type added to derived simple types
> --------------------------------------
>
>          Key: AXIS-2098
>          URL: http://issues.apache.org/jira/browse/AXIS-2098
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2.1
>     Reporter: David Kocher
>     Priority: Blocker
>  Attachments: helloworld.tar.gz
>
> Given a simple type such as
>     <xs:simpleType name="LogicType">
>         <xs:restriction base="xs:boolean">
>             <xs:pattern value="true"/>
>             <xs:pattern value="false"/>
>         </xs:restriction>
>     </xs:simpleType>
> Axis will serialize this as 
>                <Logic xsi:type="xsd:boolean">true</Logic>
> which won't validate because
> Type 'xsd:boolean' is not validly derived from the type definition, 'LogicType', of element 'Logic'.
> This is only the case in the request message; the response message of the same type is sent correctly.
> See the attached sample project.

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


[jira] Commented: (AXIS-2098) xsi:type added to derived simple types

Posted by "Jongjin Choi (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2098?page=comments#action_12315816 ] 

Jongjin Choi commented on AXIS-2098:
------------------------------------

I think that  xsi:type is generated in the SOAP message 
because the xml type from type mapping (xsd:boolean in the case)  is different from the original restricted xml type (LogicType in this case) during serialization.

But when you see the result from Axis, the response message dose not contain xsi:type="xsd:boolean" for LogicType.
For example, this is the response from current CVS:

<?xml version="1.0" encoding="UTF-8"?>
   <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
         <MyResponse xmlns="http://helloworld.ch/schema/types">
            <Helloworld>
               <Logic>true</Logic>
               <String>Hello World --------------------------!</String>
               <Restriction>
                  <LastName>World</LastName>
                  <firstName xsi:nil="true"/>
               </Restriction>
            </Helloworld>
         </MyResponse>
      </soapenv:Body>
   </soapenv:Envelope>

Here is the scenario for current CVS:
1. The typemapping entry registered in client side (by stub) is (boolean, {http://{http://helloworld.ch/schema/types}LogicType).
2. The typemapping entry registered in server side (by WSDDTypeMappingImpl) is (java.lang.Boolean, {http://{http://helloworld.ch/schema/types}LogicType).
    In server-config.wsdd, the registered mapping is boolean and LogicType but In WSDDTypeMapping#getLanguageSpecificType() the primtive type is converted to primitive wrapper.
  
3. In serialization, the boolean value is treated as Object and its class is java.lang.Booean instead of boolean. 
In the client side, the correct type mapping can not be found because the (java.lang.Boolean, LogicType) is not registered,
and the default type mapping for boolean primitive is used, so  'xsi:type' is serialized in the soap message.

In the server side, the type mapping can be found so 'xsi:type' is not serialized  in the soap message.

I think that two solution possible, 
 1. add some code in TypeMappingImpl to find the type mapping by the xml type. (LogicType in this case) .
 2. add java type parameter in the signature of serialize() and actualSerialize() in SerializationContext,
     so we can find type mapping for the value from its original java type (boolean) not relected type (java.lang.Boolean) 

I think option 2 is better solution but it would break the existing signature of SerializationContext. 
I worked on it and currently am doing all-tests and fixing errors caused from other  test-cases.

This issue is related to AXIS-2103.

> xsi:type added to derived simple types
> --------------------------------------
>
>          Key: AXIS-2098
>          URL: http://issues.apache.org/jira/browse/AXIS-2098
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2.1
>     Reporter: David Kocher
>     Priority: Blocker
>  Attachments: helloworld.tar.gz
>
> Given a simple type such as
>     <xs:simpleType name="LogicType">
>         <xs:restriction base="xs:boolean">
>             <xs:pattern value="true"/>
>             <xs:pattern value="false"/>
>         </xs:restriction>
>     </xs:simpleType>
> Axis will serialize this as 
>                <Logic xsi:type="xsd:boolean">true</Logic>
> which won't validate because
> Type 'xsd:boolean' is not validly derived from the type definition, 'LogicType', of element 'Logic'.
> This is only the case in the request message; the response message of the same type is sent correctly.
> See the attached sample project.

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


[jira] Commented: (AXIS-2098) xsi:type added to derived simple types

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2098?page=comments#action_12317358 ] 

Davanum Srinivas commented on AXIS-2098:
----------------------------------------

Jongjin,

Please go ahead and commit the code and test case.

thanks,
dims

> xsi:type added to derived simple types
> --------------------------------------
>
>          Key: AXIS-2098
>          URL: http://issues.apache.org/jira/browse/AXIS-2098
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2.1
>     Reporter: David Kocher
>     Priority: Blocker
>  Attachments: helloworld.tar.gz, src_2005_08_01.patch, test_wsdl_axis2098.zip
>
> Given a simple type such as
>     <xs:simpleType name="LogicType">
>         <xs:restriction base="xs:boolean">
>             <xs:pattern value="true"/>
>             <xs:pattern value="false"/>
>         </xs:restriction>
>     </xs:simpleType>
> Axis will serialize this as 
>                <Logic xsi:type="xsd:boolean">true</Logic>
> which won't validate because
> Type 'xsd:boolean' is not validly derived from the type definition, 'LogicType', of element 'Logic'.
> This is only the case in the request message; the response message of the same type is sent correctly.
> See the attached sample project.

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


[jira] Resolved: (AXIS-2098) xsi:type added to derived simple types

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2098?page=all ]
     
Davanum Srinivas resolved AXIS-2098:
------------------------------------

    Resolution: Fixed

Jongjin,

Applied patch and added test case.

thanks,
dims

> xsi:type added to derived simple types
> --------------------------------------
>
>          Key: AXIS-2098
>          URL: http://issues.apache.org/jira/browse/AXIS-2098
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2.1
>     Reporter: David Kocher
>     Priority: Blocker
>  Attachments: helloworld.tar.gz, src_2005_08_01.patch, test_wsdl_axis2098.zip
>
> Given a simple type such as
>     <xs:simpleType name="LogicType">
>         <xs:restriction base="xs:boolean">
>             <xs:pattern value="true"/>
>             <xs:pattern value="false"/>
>         </xs:restriction>
>     </xs:simpleType>
> Axis will serialize this as 
>                <Logic xsi:type="xsd:boolean">true</Logic>
> which won't validate because
> Type 'xsd:boolean' is not validly derived from the type definition, 'LogicType', of element 'Logic'.
> This is only the case in the request message; the response message of the same type is sent correctly.
> See the attached sample project.

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


[jira] Updated: (AXIS-2098) xsi:type added to derived simple types

Posted by "Jongjin Choi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2098?page=all ]

Jongjin Choi updated AXIS-2098:
-------------------------------

    Attachment: test_wsdl_axis2098.zip

testcase (test/wsdl/axis2098)

> xsi:type added to derived simple types
> --------------------------------------
>
>          Key: AXIS-2098
>          URL: http://issues.apache.org/jira/browse/AXIS-2098
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2.1
>     Reporter: David Kocher
>     Priority: Blocker
>  Attachments: helloworld.tar.gz, src_2005_08_01.patch, test_wsdl_axis2098.zip
>
> Given a simple type such as
>     <xs:simpleType name="LogicType">
>         <xs:restriction base="xs:boolean">
>             <xs:pattern value="true"/>
>             <xs:pattern value="false"/>
>         </xs:restriction>
>     </xs:simpleType>
> Axis will serialize this as 
>                <Logic xsi:type="xsd:boolean">true</Logic>
> which won't validate because
> Type 'xsd:boolean' is not validly derived from the type definition, 'LogicType', of element 'Logic'.
> This is only the case in the request message; the response message of the same type is sent correctly.
> See the attached sample project.

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


[jira] Updated: (AXIS-2098) xsi:type added to derived simple types

Posted by "David Kocher (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2098?page=all ]

David Kocher updated AXIS-2098:
-------------------------------

    Attachment: helloworld.tar.gz

There is a ant build file for running the sample.

> xsi:type added to derived simple types
> --------------------------------------
>
>          Key: AXIS-2098
>          URL: http://issues.apache.org/jira/browse/AXIS-2098
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2.1
>     Reporter: David Kocher
>  Attachments: helloworld.tar.gz
>
> Given a simple type such as
>     <xs:simpleType name="LogicType">
>         <xs:restriction base="xs:boolean">
>             <xs:pattern value="true"/>
>             <xs:pattern value="false"/>
>         </xs:restriction>
>     </xs:simpleType>
> Axis will serialize this as 
>                <Logic xsi:type="xsd:boolean">true</Logic>
> which won't validate because
> Type 'xsd:boolean' is not validly derived from the type definition, 'LogicType', of element 'Logic'.
> This is only the case in the request message; the response message of the same type is sent correctly.
> See the attached sample project.

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


[jira] Commented: (AXIS-2098) xsi:type added to derived simple types

Posted by "Jongjin Choi (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2098?page=comments#action_12317355 ] 

Jongjin Choi commented on AXIS-2098:
------------------------------------

Dims and all.

I fixed the AXIS-2098 and AXIS-2103. 
I'd like you to review the patches before I commit. 
All-tests passed with the latest cvs.
The patch and test-case will be attached.

This is the change log.
==================
Fix for AXIS-2098, 2103
- WSDDTypeMapping : Register exact type mapping for primtive type at the server-side. (primitive type instead of primitive wrapper)
- JavaStubWriter : Register exact type mapping for schema derived types in the client side.
- Serialization : Pass the java class to the SerializationContext to determine actual java type for serialization
- TypeMappingImpl : find serializer using xml type. (for schema derived types)
- JavaBeanHelperWriter : write exact type qname for schema ref'ed element. (AXIS-2103)
==================



> xsi:type added to derived simple types
> --------------------------------------
>
>          Key: AXIS-2098
>          URL: http://issues.apache.org/jira/browse/AXIS-2098
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2.1
>     Reporter: David Kocher
>     Priority: Blocker
>  Attachments: helloworld.tar.gz, src_2005_08_01.patch
>
> Given a simple type such as
>     <xs:simpleType name="LogicType">
>         <xs:restriction base="xs:boolean">
>             <xs:pattern value="true"/>
>             <xs:pattern value="false"/>
>         </xs:restriction>
>     </xs:simpleType>
> Axis will serialize this as 
>                <Logic xsi:type="xsd:boolean">true</Logic>
> which won't validate because
> Type 'xsd:boolean' is not validly derived from the type definition, 'LogicType', of element 'Logic'.
> This is only the case in the request message; the response message of the same type is sent correctly.
> See the attached sample project.

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


[jira] Updated: (AXIS-2098) xsi:type added to derived simple types

Posted by "Jongjin Choi (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2098?page=all ]

Jongjin Choi updated AXIS-2098:
-------------------------------

    Attachment: src_2005_08_01.patch

Patch for ws-axis/java/src

> xsi:type added to derived simple types
> --------------------------------------
>
>          Key: AXIS-2098
>          URL: http://issues.apache.org/jira/browse/AXIS-2098
>      Project: Apache Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2.1
>     Reporter: David Kocher
>     Priority: Blocker
>  Attachments: helloworld.tar.gz, src_2005_08_01.patch
>
> Given a simple type such as
>     <xs:simpleType name="LogicType">
>         <xs:restriction base="xs:boolean">
>             <xs:pattern value="true"/>
>             <xs:pattern value="false"/>
>         </xs:restriction>
>     </xs:simpleType>
> Axis will serialize this as 
>                <Logic xsi:type="xsd:boolean">true</Logic>
> which won't validate because
> Type 'xsd:boolean' is not validly derived from the type definition, 'LogicType', of element 'Logic'.
> This is only the case in the request message; the response message of the same type is sent correctly.
> See the attached sample project.

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