Axiom
  1. Axiom
  2. AXIOM-282

Get Payload QName information without building OMElement

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Problem:
      The Axis2 code invokes MessageContext.isFault() before starting the phases. This causes an Axiom tree to be built up to and including the
      first child element (payload) in the soap body. The problem is that the phases might have special CustomBuilders. Building the Axiom tree past the payload
      can defeat these kinds of optimizations.

      Solution1:
      The first solution is tactical and will work with all parsers. The proposal is to add some simple, protected "look ahead" code in the StaXOMBuilder.
      The Axiom SOAPBody can use this information to determine whether the payload is a fault, without actually building the object. I am working on the tests and code for this first solution, and will have it ready in the next day or two.

      Solution 2:
      The second solution is support a custom property on the parser. The SOAPEnvelope can then call the custom property on the backing parser to get the soap body payload qname. The idea is that the parser (woodstox or ibm, etc.) may have already looked ahead in the text before the StAX events are fully pulled.
      The benefit of this solution is that calls, like MessageContext.isFault(), will not cause the expansion of the header elements. I will work on this solution
      after solution 1 is done. I don't have a proposed name for the property yet.

      (Note that both of these solutions will require some minor changes to the Axis2 code.)

      P.S. I am working with Takahide Nogayama on these changes.
      Thanks,
      Rich Scheuerle

        Activity

        Hide
        Hudson added a comment -

        Integrated in ws-axiom-trunk #938 (See https://builds.apache.org/job/ws-axiom-trunk/938/)
        Slightly changed the code for the optimization introduced by AXIOM-282 so that it interacts in a better way with the feature introduced by AXIOM-399. More precisely, a call to SOAPBody#hasFault() will now no longer expand an OMSourcedElement with unknown name present in the body. (Revision 1334113)

        Result = SUCCESS
        veithen :
        Files :

        • /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPBodyImpl.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultWithOMSEUnknownName.java
        Show
        Hudson added a comment - Integrated in ws-axiom-trunk #938 (See https://builds.apache.org/job/ws-axiom-trunk/938/ ) Slightly changed the code for the optimization introduced by AXIOM-282 so that it interacts in a better way with the feature introduced by AXIOM-399 . More precisely, a call to SOAPBody#hasFault() will now no longer expand an OMSourcedElement with unknown name present in the body. (Revision 1334113) Result = SUCCESS veithen : Files : /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPBodyImpl.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultWithOMSEUnknownName.java
        Hide
        Hudson added a comment -

        Integrated in ws-axiom-trunk #937 (See https://builds.apache.org/job/ws-axiom-trunk/937/)
        Added some unit tests to more thoroughly test the optimization implemented by AXIOM-282 so that we can safely modify that code to take into account AXIOM-399. (Revision 1333884)

        Result = SUCCESS
        veithen :
        Files :

        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/FirstElementNameWithParserTestCase.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFirstElementLocalNameWithParser.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFirstElementNSWithParser.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultWithParserNoFault.java
        Show
        Hudson added a comment - Integrated in ws-axiom-trunk #937 (See https://builds.apache.org/job/ws-axiom-trunk/937/ ) Added some unit tests to more thoroughly test the optimization implemented by AXIOM-282 so that we can safely modify that code to take into account AXIOM-399 . (Revision 1333884) Result = SUCCESS veithen : Files : /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/FirstElementNameWithParserTestCase.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFirstElementLocalNameWithParser.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestGetFirstElementNSWithParser.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/body/TestHasFaultWithParserNoFault.java
        Hide
        Hudson added a comment -

        Integrated in ws-axiom-trunk #935 (See https://builds.apache.org/job/ws-axiom-trunk/935/)
        Refactored the unit test for AXIOM-282 (r631309). (Revision 1333644)

        Result = SUCCESS
        veithen :
        Files :

        • /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/TestConstants.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soap11/soapmessage.xml
        • /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soap12/soapmessage.xml
        • /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soapmessage.xml
        • /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPImplementationTest.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPImplementationTest.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/builder/CustomBuilderTest.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/builder/TestRegisterCustomBuilderForPayloadAfterSOAPFaultCheck.java
        Show
        Hudson added a comment - Integrated in ws-axiom-trunk #935 (See https://builds.apache.org/job/ws-axiom-trunk/935/ ) Refactored the unit test for AXIOM-282 (r631309). (Revision 1333644) Result = SUCCESS veithen : Files : /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/TestConstants.java /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soap11/soapmessage.xml /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soap12/soapmessage.xml /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/soap/soapmessage.xml /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPImplementationTest.java /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/soap/impl/llom/SOAPImplementationTest.java /webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/builder/CustomBuilderTest.java /webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/builder/TestRegisterCustomBuilderForPayloadAfterSOAPFaultCheck.java
        Hide
        Hudson added a comment -

        Integrated in ws-axiom-trunk #797 (See https://builds.apache.org/job/ws-axiom-trunk/797/)
        Implemented a regression test for r631687 (AXIOM-282). (Revision 1293553)

        Result = SUCCESS
        veithen :
        Files :

        • /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMContainerHelper.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetSOAPBodyFirstElementLocalNameAndNSWithParser.java
        Show
        Hudson added a comment - Integrated in ws-axiom-trunk #797 (See https://builds.apache.org/job/ws-axiom-trunk/797/ ) Implemented a regression test for r631687 ( AXIOM-282 ). (Revision 1293553) Result = SUCCESS veithen : Files : /webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMContainerHelper.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestGetSOAPBodyFirstElementLocalNameAndNSWithParser.java
        Hide
        Rich Scheuerle added a comment -

        Fixed

        Show
        Rich Scheuerle added a comment - Fixed

          People

          • Assignee:
            Rich Scheuerle
            Reporter:
            Rich Scheuerle
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development