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

JAX-WS Client: HolderInInterceptor misbehaving on multipart/repalted SwA message: IndexOutOfBoundException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 3.1.8
    • Invalid
    • JAX-WS Runtime
    • None
    • Oracle JDK 1.7.0_79 64-Bit, Linux (OpenSuse 42.1)

    • Unknown

    Description

      Hi.
      I'm getting a IndexOutOfBoundException when receiving a SwA message (multipart/related).
      I produce the stubs with Wsdl2Java with params
      "-verbose -autoNameResolution -client" on my wsdl; operation looks ok with this output:
      ****************
      Loading FrontEnd jaxws ...
      Loading DataBinding jaxb ...
      wsdl2java -verbose -autoNameResolution -client -d cxfIssuesJira3 ./apache-cxf-3.1.8/ricercaImprese1.2-icar.wsdl
      wsdl2java - Apache CXF 3.1.8

      Nov 14, 2016 12:16:40 PM org.apache.cxf.wsdl11.WSDLServiceBuilder checkForWrapped
      INFO: Operation

      {http://it.ictechnology.pcad.ws}

      ricercaImpreseCodiceFiscale cannot be unwrapped, input and output messages (if present) must contain only a single part
      Nov 14, 2016 12:16:40 PM org.apache.cxf.wsdl11.WSDLServiceBuilder checkForWrapped
      INFO: Operation

      {http://it.ictechnology.pcad.ws}

      ricercaImpreseNRea cannot be unwrapped, input and output messages (if present) must contain only a single part
      Nov 14, 2016 12:16:40 PM org.apache.cxf.wsdl11.WSDLServiceBuilder checkForWrapped
      INFO: Operation

      {http://it.ictechnology.pcad.ws}

      ricercaImpreseDenominazione cannot be unwrapped, input and output messages (if present) must contain only a single part
      ************

      This generates the Port/Service/Holders architecture. I populate data for the request and then I launch the generated client program untouched, except for:

      • Using BindingProvider.ENDPOINT_ADDRESS_PROPERTY to set the target
      • adding WSS4JOutInterceptor to provide USERNAME_TOKEN & password callback method to the endpoint (getting a proxy)

      Upon invocation, I get:

      /***********/
      WARNING: Interceptor for

      {http://it.ictechnology.pcad.ws}

      ricercaImpreseService#

      {http://it.ictechnology.pcad.ws}

      ricercaImpreseCodiceFiscale has thrown exception, unwinding now
      java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
      at java.util.ArrayList.rangeCheck(ArrayList.java:635)
      at java.util.ArrayList.get(ArrayList.java:411)
      at org.apache.cxf.message.MessageContentsList.get(MessageContentsList.java:80)
      at org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(HolderInInterceptor.java:69)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1670)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1551)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1348)
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
      at com.sun.proxy.$Proxy33.ricercaImpreseCodiceFiscale(Unknown Source)
      at ws.pcad.ictechnology.it.RicercaImprese_RicercaImprese_Client.main(RicercaImprese_RicercaImprese_Client.java:101)

      Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Index: 3, Size: 3
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161)
      at com.sun.proxy.$Proxy33.ricercaImpreseCodiceFiscale(Unknown Source)
      at ws.pcad.ictechnology.it.RicercaImprese_RicercaImprese_Client.main(RicercaImprese_RicercaImprese_Client.java:101)
      Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
      at java.util.ArrayList.rangeCheck(ArrayList.java:635)
      at java.util.ArrayList.get(ArrayList.java:411)
      at org.apache.cxf.message.MessageContentsList.get(MessageContentsList.java:80)
      at org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(HolderInInterceptor.java:69)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1670)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1551)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1348)
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
      ... 2 more

      /***********/

      Looks to me that the incoming Swa/Multipart message is not parsed correctly, or the indeces of the message parts are not set correctly upon extraction.

      The incoming multipart/related message looks correct to me and I'm trying to attach a sample to this ticket

      Attachments

        Activity

          People

            Unassigned Unassigned
            Diego1 Diego Pietralunga
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: