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

WrapperClassInInterceptor incorrecltly handing SOAP headers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.2
    • 2.0.4
    • JAX-WS Runtime
    • None
    • windows XP, JBoss

    • Novice

    Description

      The following code block in WrapperClassInInterceptor is throwing IndexOutOfBoundsExceptions. The reason is that the newParams list has two (null) list entries, but the MessagePartInfo indeces that are being added to the remove arraylist are 1 and 2.

      List<Integer> removes = null;
      for (MessagePartInfo part : messageInfo.getMessageParts()) {
      if (Boolean.TRUE.equals(part.getProperty(ReflectionServiceFactoryBean.HEADER))) {
      MessagePartInfo mpi = wrappedMessageInfo.getMessagePart(part.getName());
      if (lst.hasValue(mpi))

      { newParams.put(part, lst.get(mpi)); }

      else if (mpi.getTypeClass() == null) {
      //header, but not mapped to a param on the method
      if (removes == null)

      { removes = new ArrayList<Integer>(); }

      removes.add(mpi.getIndex());
      }
      }
      }
      if (removes != null) {
      Collections.sort(removes, Collections.reverseOrder());
      for (Integer i : removes)

      { newParams.remove(i.intValue()); // <= error thrown here }

      }

      The two items being removed are a username and password header set in my WSDL file:

      <wsdl:input name="sayHelloRequest">
      <wsdlsoap:header message="impl:username" part="username" use="literal"/>
      <wsdlsoap:header message="impl:password" part="password" use="literal"/>
      <wsdlsoap:body use="literal"/>
      </wsdl:input>

      It seems the wrappedMessageInfo correctly contains all three message parts (the sayHello invocation, and 2 headers) but messageInfo.getMessageParts() is only returned the latter two.

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            incognito Incognito
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: