Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 11514 invoked from network); 24 Aug 2010 13:11:41 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Aug 2010 13:11:41 -0000 Received: (qmail 39867 invoked by uid 500); 24 Aug 2010 13:11:41 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 39677 invoked by uid 500); 24 Aug 2010 13:11:39 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 39669 invoked by uid 99); 24 Aug 2010 13:11:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Aug 2010 13:11:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Aug 2010 13:11:37 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o7ODBHkA020235 for ; Tue, 24 Aug 2010 13:11:17 GMT Message-ID: <13646507.530311282655477030.JavaMail.jira@thor> Date: Tue, 24 Aug 2010 09:11:17 -0400 (EDT) From: =?utf-8?Q?S=C3=A9bastien_=28JIRA=29?= To: issues@cxf.apache.org Subject: [jira] Updated: (CXF-2955) Null message part type class org.apache.cxf.xmlbeans.DataWriterImpl In-Reply-To: <11670692.530141282654998923.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-2955?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] S=C3=A9bastien updated CXF-2955: --------------------------- Description:=20 I've a NullPointerException when I set a SOAP header by using an XmlObject: final XmlObject userDetails =3D getDetails(); final QName name =3D EndUserDetailsDocumentXML.type.getDocumentElementName(= ); final Header userDetailsHeader =3D new Header(name, userDetails, new XmlBea= nsDataBinding()); =20 userDetailsHeader.setDirection(Header.Direction.DIRECTION_OUT); message.getHeaders().add(userDetailsHeader); The problem is that the XmlBeans implementation is guessing that the type c= lass of the message part is not null (part.getTypeClass()). But it's always= null, see the class org.apache.cxf.binding.soap.interceptor.SoapOutInterce= ptor: if (b !=3D null) { MessagePartInfo part =3D 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 out= put) { try { Class typeClass =3D part.getTypeClass(); if (!XmlObject.class.isAssignableFrom(typeClass)) { was: I've a NullPointerException when I set a SOAP header by using an XmlObject: final XmlObject userDetails =3D getDetails(); final QName name =3D EndUserDetailsDocumentXML.type.getDocumentElementName(= ); final Header userDetailsHeader =3D new Header(name, userDetails, new XmlBea= nsDataBinding()); =20 userDetailsHeader.setDirection(Header.Direction.DIRECTION_OUT); message.getHeaders().add(userDetailsHeader); The problem is that the XmlBeans implementation is guessing that the type c= lass of the message part is not null (part.getTypeClass()). But it's always= null, see the class org.apache.cxf.binding.soap.interceptor.SoapOutInterce= ptor: if (b !=3D null) { MessagePartInfo part =3D 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 out= put) { try { Class typeClass =3D part.getTypeClass(); if (!XmlObject.class.isAssignableFrom(typeClass)) { > Null message part type class org.apache.cxf.xmlbeans.DataWriterImpl=20 > -------------------------------------------------------------------- > > Key: CXF-2955 > URL: https://issues.apache.org/jira/browse/CXF-2955 > Project: CXF > Issue Type: Bug > Affects Versions: 2.2.6, 2.2.10 > Reporter: S=C3=A9bastien > > I've a NullPointerException when I set a SOAP header by using an XmlObjec= t: > final XmlObject userDetails =3D getDetails(); > final QName name =3D EndUserDetailsDocumentXML.type.getDocumentElementNam= e(); > final Header userDetailsHeader =3D new Header(name, userDetails, new XmlB= eansDataBinding()); =20 > 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 alwa= ys null, see the class org.apache.cxf.binding.soap.interceptor.SoapOutInter= ceptor: > if (b !=3D null) { > MessagePartInfo part =3D new MessagePartInfo(head= er.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 o= utput) { > try { > Class typeClass =3D part.getTypeClass(); > if (!XmlObject.class.isAssignableFrom(typeClass)) { --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.