[ 
https://issues.apache.org/jira/browse/AXIS2-4401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722545#action_12722545
 ] 

Pétur Runólfsson commented on AXIS2-4401:
-----------------------------------------

Here is a request and response where the xs:anyType is a property of the return 
value:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:axis="http://ws.apache.org/axis2";>
   <soapenv:Header/>
   <soapenv:Body>
      <axis:getValue>
         <axis:args0>true</axis:args0>
      </axis:getValue>
   </soapenv:Body>
</soapenv:Envelope>

Response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
   <soapenv:Body>
      <ns:getValueResponse 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>Hello</ax21:any>
         </ns:return>
      </ns:getValueResponse>
   </soapenv:Body>
</soapenv:Envelope>


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

Reply via email to