Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 48420 invoked from network); 14 Feb 2006 12:34:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Feb 2006 12:34:50 -0000 Received: (qmail 38937 invoked by uid 500); 14 Feb 2006 12:34:44 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 38915 invoked by uid 500); 14 Feb 2006 12:34:43 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 38903 invoked by uid 99); 14 Feb 2006 12:34:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2006 04:34:43 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of afkham@gmail.com designates 64.233.184.205 as permitted sender) Received: from [64.233.184.205] (HELO wproxy.gmail.com) (64.233.184.205) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2006 04:34:42 -0800 Received: by wproxy.gmail.com with SMTP id 69so617899wri for ; Tue, 14 Feb 2006 04:34:22 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pc++XMi0YWutvdpptkLD0rM1cHY7ofwVYC1uVot0IA2sECblejGCBlQt5Ii1iI1P0FE/DyXzOt/PDZn+81pP6ZTZrMd4KceYEd+kgs28AMW6IXxl9OqY1p35+Pu+IIPGK5iLYao0zmSXJe2hKmeThZdyAixHH7h9ycMORjSAIO0= Received: by 10.65.38.14 with SMTP id q14mr242740qbj; Tue, 14 Feb 2006 04:34:21 -0800 (PST) Received: by 10.65.253.20 with HTTP; Tue, 14 Feb 2006 04:34:21 -0800 (PST) Message-ID: <9b85c45f0602140434q41c11fdexf965b5d47740b866@mail.gmail.com> Date: Tue, 14 Feb 2006 18:34:21 +0600 From: Afkham Azeez To: axis-dev@ws.apache.org Subject: Re: [Axis2] Question about Axis 2 SAAJ implementation In-Reply-To: <9b85c45f0602140325y19819282t6888a87d7d9a399b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <9b85c45f0602140325y19819282t6888a87d7d9a399b@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On second thoughts, interface javax.xml.soap.Node extends org.w3c.dom.Node, hence I agree that wherever we return org.w3c.dom.Node, we should return javax.xml.soap.Node & not org.apache.axis2.om.impl.dom.NodeImpl, in order to be spec compliant. Regards Azeez On 2/14/06, Afkham Azeez wrote: > > > > Consider the following code from the SOAPElementTest: > > > > final String value =3D "foo"; > > soapElem.addTextNode(value); > > > > I should be able to get the javax.xml.soap.Node using several > > different accessors (getChildElements(), getChildNodes(), > > getFirstChild()), etc. > > > > ------------------------------ > > Problem 1: > > Object x =3D soapElem.getChildElements().next(); > > Object y =3D soapElem.getChildElements().next(); > > > > In this case, x and y are both javax.xml.soap.Node objects (good); > > however they are not the same object. The iterator is constructing > > new objects each time it is invoked. This is not efficient and > > incorrect. > > I agree with Ias on this point. Only if you call > soapElem.getChildElements(), new objects will be created. > > > > > ------------------------------- > > Problem 2 > > Object z1 =3D soapElem.getChildNodes().item(0); > > Object z2 =3D soapElem.getFirstChild(); > > > > In both cases, the returned object is not an SAAJ > > javax.xml.soap.Node. This also seems to be a violation of the > > specification. > Note that the javax.xml.SOAPElement extends org.w3c.dom.Node. The > getChildNodes() and getFirstChild() methods are inherited from the > org.w3c.dom.Node interface. Hence we cannot return javax.xml.soap.Node > objects from these methods. For instance, the method signature of > getFirstChild() is; > public org.w3c.dom.Node getFirstChild(); > So now we can see that, we cannot return javax.xml.soap.Node objects. > In order to use only SAAJ interfaces, you need to use the methods that > are directly in the javax.xml.SOAPElement interface. > > Regards > Azeez > -- Thanks Afkham Azeez