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 "Chris Hildebrand (JIRA)" <ax...@ws.apache.org> on 2006/03/31 19:10:37 UTC

[jira] Commented: (AXIS-2437) Axis 1.3 ArraySerializer not specifiying the xsi:type attribute

    [ http://issues.apache.org/jira/browse/AXIS-2437?page=comments#action_12372702 ] 

Chris Hildebrand commented on AXIS-2437:
----------------------------------------

We seem to be having a very similiar issue. The difference in our case is that the array type is not abstract. However, it is sometimes populated with sub types, and these sub types aren't being properly serialized. We encountered this when upgrading the version of axis from 1.1 to 1.3, and with the 1.1 version, the sub type was properly serialized, as shown in the example below.

axis 1.1 (includes targetId element and xsi:type attribute):
    <soapenv:Body>
	<getRequest xmlns="foo1">
	    <ns5:targets xmlns:ns5="foo2" xsi:type="ns5:GetByIdTarget">
		<ns5:targetType>BAR</ns5:targetType>
		<ns5:targetId>357</ns5:targetId>
	    </ns5:targets>
	</getRequest>
    </soapenv:Body>

axis 1.3 (drops targetId element and xsi:type attribute):
    <soapenv:Body>
	<getRequest xmlns="foo1">
	    <ns4:targets xmlns:ns4="foo2">
		<ns4:targetType>BAR</ns4:targetType>
	    </ns4:targets>
	</getRequest>
    </soapenv:Body>


> Axis 1.3 ArraySerializer not specifiying the xsi:type attribute
> ---------------------------------------------------------------
>
>          Key: AXIS-2437
>          URL: http://issues.apache.org/jira/browse/AXIS-2437
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.3
>  Environment: Windows/Linux/HPUX,; Axis 1.3; java 1.4.2.11
>     Reporter: Mike Morris

>
> I have a web service operation that returns an array of complex types.  The operation returns the array (</getContainedEquipmentReturn> elements) but is missing the xsi:type attribute to explicitly identify the type of element contained in the array.  This only seems to cause a problem when the array type is an abstract type, as the axis-generated client cannot determine a concrete type to instantiate.  
>  
> Example 1 below is the way axis serializes the response message out of the box.  Example 2 is how the message can be formatted so that the client can deserialize the message.  
>  
> Is it possible either through configuration or creating a custom array serializer to have the xsi:type specified in the array element nodes?  
>  
> Thank you in advance,
> Mike
>   
> Example 1 :
> <?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>
>         <getContainedEquipmentResponse
>             xmlns="http://soap.service.soa.plt.telcordia.com">
>             <getContainedEquipmentReturn>
>                 <ns169:confirmed xmlns:ns169="http://dto.asi.granite.com"
>                     xsi:type="xsd:boolean">false</ns169:confirmed>
>                 <ns170:confirmedCustom xmlns:ns170="http://dto.asi.granite.com"
>                     xsi:type="xsd:boolean">false</ns170:confirmedCustom>
>                 .......... 
>             </getContainedEquipmentReturn>
>             <getContainedEquipmentReturn>
>                 <ns2:confirmed xmlns:ns2="http://dto.asi.granite.com"
>                     xsi:type="xsd:boolean">false</ns2:confirmed>
>                 <ns3:confirmedCustom xmlns:ns3="http://dto.asi.granite.com"
>                     xsi:type="xsd:boolean">false</ns3:confirmedCustom> 
>                 ..........
>             </getContainedEquipmentReturn>
>         </getContainedEquipmentResponse>
>     </soapenv:Body>
> </soapenv:Envelope>
>  
>  
> Example 2 :
> <?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>
>         <getContainedEquipmentResponse
>             xmlns="http://soap.service.soa.plt.telcordia.com">
>             <getContainedEquipmentReturn>
>                 <ns169:confirmed xmlns:ns169="http://dto.asi.granite.com"
>                     xsi:type="xsd:boolean">false</ns169:confirmed>
>                 <ns170:confirmedCustom xmlns:ns170="http://dto.asi.granite.com"
>                     xsi:type="xsd:boolean">false</ns170:confirmedCustom>
>                 .......... 
>             </getContainedEquipmentReturn>
>             <getContainedEquipmentReturn
>                 xmlns:ns1="http://webservice.dto.asi.granite.com"
>                 xsi:type="ns1:Container">
>                 <ns2:confirmed xmlns:ns2="http://dto.asi.granite.com"
>                     xsi:type="xsd:boolean">false</ns2:confirmed>
>                 <ns3:confirmedCustom xmlns:ns3="http://dto.asi.granite.com"
>                     xsi:type="xsd:boolean">false</ns3:confirmedCustom> 
>                 ..........
>             </getContainedEquipmentReturn>
>         </getContainedEquipmentResponse>
>     </soapenv:Body>
> </soapenv:Envelope>

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