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

SOAPFault.addDetail() creates ignored detail / SOAPFault.getDetail() allows proper detail creation

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Incomplete
    • Affects Version/s: 1.5.1
    • Fix Version/s: None
    • Component/s: saaj
    • Environment:

      Description

      We're creating a SOAP message, with a SOAPFault, and attempting to attach details.

      Previous to Axis2 v1.5.1 (don't remember which version), we were doing:

      detail = soapFaultObject.addDetail()
      detail.addDetailEntry(...)
      ... and so on ...

      After upgrading to v1.5.1, this now fails – no matter what you do, you will always get an EMPTY detail entry in your message.

      The resulting XML has:
      <detail></detail>

      After much investigating, the problem appears to be that there is now a pre-created 'detail' object already on the SOAPFault, and if you call 'addDetail' again a SECOND detail is created. This detail object is completely ignored during serialization (not sure if it should be or not?).

      The solution to this is then to do something like:
      detail = soapFaultObject.getDetail()
      if(detail == null)

      { detail = soapFaultObject.addDetail() }

      detail.addDetailEntry(...)

      Once this workaround is know, this is fairly minor impact – but without knowing the workaround, it has a fairly major effect!

      I think that either:
      a. The addDetail should actually add another detail, and this should actually get serialized properly.
      OR
      b. The addDetail method should throw an exception if there is already a detail present.
      OR
      c. There should not event BE an addDetail method.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dlindquist Dave Lindquist
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: