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

Null message part type class org.apache.cxf.xmlbeans.DataWriterImpl

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.6, 2.2.10
    • 2.2.11
    • None
    • None

    Description

      I've a NullPointerException when I set a SOAP header by using an XmlObject:

      final XmlObject userDetails = getDetails();
      final QName name = EndUserDetailsDocumentXML.type.getDocumentElementName();
      final Header userDetailsHeader = new Header(name, userDetails, new XmlBeansDataBinding());
      userDetailsHeader.setDirection(Header.Direction.DIRECTION_OUT);
      message.getHeaders().add(userDetailsHeader);

      The problem is that the XmlBeans implementation is guessing that the type class of the message part is not null (part.getTypeClass()). But it's always null, see the class org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor:

      if (b != null) {
      MessagePartInfo part = new MessagePartInfo(header.getName(), null);
      part.setConcreteName(header.getName());
      b.createWriter(XMLStreamWriter.class)
      .write(header.getObject(), part, writer);

      Later in org.apache.cxf.xmlbeans.DataWriterImpl (line 71):

      public void write(Object obj, MessagePartInfo part, XMLStreamWriter output) {
      try {
      Class<?> typeClass = part.getTypeClass();
      if (!XmlObject.class.isAssignableFrom(typeClass)) {

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            sebge2 Sébastien
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: