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 "Rainer Montag (JIRA)" <ax...@ws.apache.org> on 2007/07/14 14:18:04 UTC

[jira] Commented: (AXIS-2677) wrong order of elements in response message for complex types

    [ https://issues.apache.org/jira/browse/AXIS-2677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512709 ] 

Rainer Montag commented on AXIS-2677:
-------------------------------------

In the meantime we resolved, this as an classloader issue, when the classloader was not able to load the Serializer classes.

Anyway, we found the code that was "detecting" the problem, but unfortunately does not log the error:

org.apache.axis.description.TypeDesc

    public static TypeDesc getTypeDescForClass(Class cls)
    {
        Map classMap = getTypeDescMap(cls.getClassLoader());
        // First see if we have one explicitly registered
        // or cached from previous lookup
        TypeDesc result = (TypeDesc)classMap.get(cls);
        if (result == null) {
            try {
                Method getTypeDesc =
                    MethodCache.getInstance().getMethod(cls,
                                                        "getTypeDesc",
                                                        noClasses);
                if (getTypeDesc != null) {
                    result = (TypeDesc)getTypeDesc.invoke(null, noObjects);
                    if (result != null) {
                        classMap.put(cls, result);
                    }
                }
            } catch (Exception e) {
            }
        }
       
        return result;
    }

During the downcast of the result a ClassCastException occurs. It would help a lot, if the catch block would log an error.



> wrong order of elements in response message for complex types
> -------------------------------------------------------------
>
>                 Key: AXIS-2677
>                 URL: https://issues.apache.org/jira/browse/AXIS-2677
>             Project: Axis
>          Issue Type: Bug
>          Components: Serialization/Deserialization
>    Affects Versions: 1.4
>         Environment: SunOS 5.10, Windows XP SP 2
>            Reporter: Rainer Montag
>            Priority: Critical
>
> Axis does not respect the XSD schema definition in WSDL files, therefore the responses generated by the Web service may not match what is defined in the WSDL file. If you have complex types that contain a sequence of elements, the order of the elements in the response message does not match the order defined in the WSDL file. They are instead sorted alphabetically.
> This Problem applies to Axis 1.3 and 1.4.
> I did find many similar bug reports to this issue, but never a comment on this issue explaining the bug.
> extract from WSDL:
> ---------------------------------------------
>             <xsd:complexType name="CustomerData">
>                 <xsd:sequence>
>                     <xsd:element name="msisdn" type="xsd:string" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="lastName" type="xsd:string" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="firstName" type="xsd:string" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="sex" type="xsd:int" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="title" type="xsd:string" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="country" type="xsd:string" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="place" type="xsd:string" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="zip" type="xsd:string" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="street" type="xsd:string" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="dateOfBirth" type="xsd:long" minOccurs="1" maxOccurs="1" nillable="true"/>
>                     <xsd:element name="houseNo" type="xsd:string" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="email" type="xsd:string" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="state" type="xsd:int" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="pkk" type="xsd:string" minOccurs="1" maxOccurs="1"/>
>                     <xsd:element name="pkkType" type="xsd:int" minOccurs="1" maxOccurs="1"/>
>                 </xsd:sequence>
>             </xsd:complexType>
>             <xsd:element name="getCutomerDataResponse">
>                 <xsd:complexType>
>                     <xsd:sequence>
>                         <xsd:element name="customerData" type="xsd1:CustomerData" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
>                     </xsd:sequence>
>                 </xsd:complexType>
>             </xsd:element>
> ------------------------------------------------------
> Actual generated response from Axis (elements below customerData are sorted alphabetically):
> <?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>
>          <getCustomerDataResponse xmlns="http://www.danet.de/LoopOnline.xsd1">
>             <customerData>
>                <country>D</country>
>                <dateOfBirth xsi:nil="true"/>
>                <email xsi:nil="true"/>
>                <firstName xsi:nil="true"/>
>                <houseNo xsi:nil="true"/>
>                <lastName xsi:nil="true"/>
>                <msisdn>491790901035</msisdn>
>                <pkk xsi:nil="true"/>
>                <pkkType>0</pkkType>
>                <place xsi:nil="true"/>
>                <sex>1</sex>
>                <state>0</state>
>                <street xsi:nil="true"/>
>                <title xsi:nil="true"/>
>                <zip xsi:nil="true"/>
>             </customerData>
>          </getCustomerDataResponse>
>       </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.


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