Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8904

TransformInInterceptor and SAAJInInterceptor - Getting SoapFault when accessing WSDL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 3.5.3
    • None
    • JAX-WS Runtime
    • None
    • Unknown

    Description

      Due to my peculiar usecase, i had to configure both org.apache.cxf.feature.StaxTransformFeature (to transform namespaces) and SAAJInInterceptor  (to modify soap body for a case).

      But due to this, when i accessed webservice ?wsdl in browser, its failing with below exception:

      org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
              at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor.handleMessage(SAAJInInterceptor.java:145) ~[cxf-rt-bindings-soap-3.5.
      3.jar:3.5.3]
        Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
       _at [row,col

      {unknown-source}

      ]: [1,0]_
              at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:701) ~[woodstox-core-6.2.8.jar:6.2.8]
              at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2235) ~[woodstox-core-6.2.8.jar:6.2.8]

       

      When i looked into source code of  org.apache.cxf.binding.soap.saaj.SAAJInInterceptor$SAAJPreInInterceptor, found below code to validate whether its GET request or not, which is failing and so it proceeded further and thrown that exception:

       
      public boolean isGET(T message) {

      String method = (String) message.get("org.apache.cxf.request.method");

      return "GET".equals(method) && message.getContent(XMLStreamReader.class) == null;

      }

      Here, this condition, message.getContent(XMLStreamReader.class) == null, is failing and reason i found is, its being set in TransformInInterceptor, which is gettng added to Interceptor Chain when StaxTranformFeature configured to cxf bus.

      To fix it (for now), i can remove that condition by extending the interceptor and overriding isGET method. But i just want to know is this expected or a bug ? And if i remove that condition, any other issues i may get? Or is there any other solution to address my problem?
       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Sreeni Sreenivas K
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: