Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4859

Optional "Ignore Unexpected Elements" mode - allows for forward-compatible clients

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.2, 1.5.3, 1.6.0
    • 1.7.0
    • codegen
    • None

    Description

      Problem: Service provider adds an optional element to the responses it sends, assuming client can handle, while client is unaware and has not (or cannot) retrieve updated WSDL and regenerate client. Axis2 client generated with ADB, cannot handle and throws an exception.

      Solution:
      Optional "Ignore Unexpected Elements" mode for wsdl2java using adb - allows for forward-compatible clients that can recover from unxpected elements in service responses.
      Based on the work in Issue 3037 - This patch is more up to date, is for both trunk and 1_5 branch, handles more scenarios, and will correctly parse the portion of the response after the unexpected element.

      To use, pass the "-Eiu" parameter to wsdl2java

      Handles the following scenarios:
      1) unexpected element in a xsd:choice, xsd:any, xsd:all
      2) appended unexpected element in a xsd:sequence.

      For xsd:sequence, the unexpected element, and subsequent elements within that sequence are not captured. If a service adds a new element within a sequence, it should be appended, as the generated client is strict with ordering, and can't differentiate an out-of-order sequence from an additional inserted element.

      Attachments

        1. iu_1_5.patch
          20 kB
          Dean Holdren
        2. iu_trunk.patch
          20 kB
          Dean Holdren
        3. names_v1.wsdl
          3 kB
          Dean Holdren
        4. names_v1.response
          0.6 kB
          Dean Holdren
        5. names_v2.response
          0.8 kB
          Dean Holdren
        6. iu.patch
          21 kB
          Ping Liu
        7. names_v2.wsdl
          3 kB
          Ping Liu
        8. names_v1_client.zip
          42 kB
          Ping Liu
        9. names_v1_client_with_xsl_change.zip
          43 kB
          Ping Liu
        10. names_v1_service.zip
          64 kB
          Ping Liu
        11. names_v2_client.zip
          59 kB
          Ping Liu
        12. names_v2_service.zip
          99 kB
          Ping Liu

        Issue Links

          Activity

            People

              myapachejira Ping Liu
              deanholdren Dean Holdren
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: