Uploaded image for project: 'Axis'
  1. Axis
  2. AXIS-2677

wrong order of elements in response message for complex types

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      SunOS 5.10, Windows XP SP 2

      Description

      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>

      -------------------------------------------------------------------------------------

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rmontag Rainer Montag
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: