Axis
  1. Axis
  2. AXIS-667

Patch for .Net interoperability with zero length nested arrays

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.1RC1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Operating System: Windows NT/2K
      Platform: PC

      Description

      The Microsoft .Net Framework 1.0 is unable to deserialize complex objects that
      contain nested zero length arrays. As detailed in previous postings to the
      axis-user list [1], this is due to a bug in .Net 1.0 where Microsoft's
      deserializer is unable to handle the minimized tags that Axis 1.1rc generates
      for these empty arrays such as:

      <myArray xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[0]"/>

      The work around is to instead send the non-minimized version:

      <myArray xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[0]"></myArray>

      which is equivalent, yet does not trigger the bug in .Net.

      The attached patch adds a new global configuration option to Axis called
      "sendMinimizedElements". When this option is set to false, Axis will never
      generate minimized elements; this will work around the .Net bug and allow Axis
      to send empty arrays to Microsoft clients.

      The default value for the new option is "true", which does not change Axis's
      previous behavior.

      I feel this patch should be included in Axis 1.1 final. It is extremely small
      and low risk, and it does not change Axis's behavior unless the new
      "sendMinimizedElements" option is set to false. However, it is a big
      interoperability win, as it allows .Net clients consume objects that include 0
      length arrays from Axis.

      [1] http://marc.theaimsgroup.com/?l=axis-user&m=102432107114992&w=2The Microsoft
      .Net Framework 1.0 is unable to deserialize complex objects that contain nested
      zero length arrays. As detailed in previous postings to the axis-user list [1],
      this is due to a bug in .Net 1.0 where Microsoft's deserializer is unable to
      handle the minimized tags that Axis 1.1rc generates for these empty arrays such as:

      <myArray xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[0]"/>

      The work around is to instead send the non-minimized version:

      <myArray xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[0]"></myArray>

      which is equivalent, yet does not trigger the bug in .Net.

      The attached patch adds a new global configuration option to Axis called
      "sendMinimizedElements". When this option is set to false, Axis will never
      generate minimized elements; this will work around the .Net bug and allow Axis
      to send empty arrays to Microsoft clients.

      The default value for the new option is "true", which does not change Axis's
      previous behavior.

      I feel this patch should be included in Axis 1.1 final. It is extremely small
      and low risk, and it does not change Axis's behavior unless the new
      "sendMinimizedElements" option is set to false. However, it is a big
      interoperability win, as it allows .Net clients consume objects that include 0
      length arrays from Axis.

      [1] http://marc.theaimsgroup.com/?l=axis-user&m=102432107114992&w=2

        Activity

        Hide
        dave_marquard added a comment -

        Created an attachment (id=4835)
        patch against 1.1rc1 to add 'sendMinimizedElements' option

        Show
        dave_marquard added a comment - Created an attachment (id=4835) patch against 1.1rc1 to add 'sendMinimizedElements' option
        Hide
        James Snell added a comment -

        This isn't a bug in Axis and we're not going to start making special case
        changes to deal with bugs in other Web service products. .NET 1.1 apparently
        fixes this issue.

        Show
        James Snell added a comment - This isn't a bug in Axis and we're not going to start making special case changes to deal with bugs in other Web service products. .NET 1.1 apparently fixes this issue.
        Hide
        dave_marquard added a comment -

        Can this bug be reopened and the patch applied in time for 1.1rc2? From the
        discussion on axis-dev last week, it sounds like most committers are in favor of
        the patch (or at least not against it).

        Show
        dave_marquard added a comment - Can this bug be reopened and the patch applied in time for 1.1rc2? From the discussion on axis-dev last week, it sounds like most committers are in favor of the patch (or at least not against it).
        Hide
        Davanum Srinivas added a comment -

        Re-opening

        Show
        Davanum Srinivas added a comment - Re-opening
        Hide
        Davanum Srinivas added a comment -

        Checked in patch since Glen issued a VOTE request and no one objected.

        – dims

        Show
        Davanum Srinivas added a comment - Checked in patch since Glen issued a VOTE request and no one objected. – dims
        Hide
        Steve Loughran added a comment -

        I just renamed the property, giving it an axis. prefix, as per all the other
        recent properties being added to axis. This stops us conflicting so much when we
        run Axis inside another webapp.

        Oh, and documented it too. Remember, we like documentation to go with code.

        Show
        Steve Loughran added a comment - I just renamed the property, giving it an axis. prefix, as per all the other recent properties being added to axis. This stops us conflicting so much when we run Axis inside another webapp. Oh, and documented it too. Remember, we like documentation to go with code.

          People

          • Assignee:
            Unassigned
            Reporter:
            dave_marquard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development