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 "Pétur Runólfsson (JIRA)" <ji...@apache.org> on 2009/06/22 12:04:07 UTC

[jira] Updated: (AXIS2-4401) xsi:type attribute should be generated for elements declared as xs:anyType when the actual value is a simple type

     [ https://issues.apache.org/jira/browse/AXIS2-4401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pétur Runólfsson updated AXIS2-4401:
------------------------------------

    Attachment: services.xml

> xsi:type attribute should be generated for elements declared as xs:anyType when the actual value is a simple type
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-4401
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4401
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: adb
>    Affects Versions: 1.5
>            Reporter: Pétur Runólfsson
>            Priority: Minor
>         Attachments: Server.java, services.xml, Value.java
>
>
> Currently, the xsi:type attribute is only declared for complex types. This means that if a method that returns xs:anyType returns an object of simple type (for example xs:string or xs:date), the client gets no type information with the object. xsi:type attributes should always be declared for return values for methods that have xs:anyType return types. The same applies when a method returns a complex type that contains a xs:anyType property.
> Example response when xs:string is returned:
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>    <soapenv:Body>
>       <ns:getAnyResponse xmlns:ns="http://ws.apache.org/axis2">
>          <ns:return>Hello</ns:return>
>       </ns:getAnyResponse>
>    </soapenv:Body>
> </soapenv:Envelope>
> Response from same method when a complex type is returned:
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>    <soapenv:Body>
>       <ns:getAnyResponse xmlns:ns="http://ws.apache.org/axis2">
>          <ns:return xsi:type="ax21:Value" xmlns:ax21="http://ws.apache.org/axis2/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>             <ax21:any xsi:nil="true"/>
>          </ns:return>
>       </ns:getAnyResponse>
>    </soapenv:Body>
> </soapenv:Envelope>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.