Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0954B669E for ; Fri, 20 May 2011 20:33:07 +0000 (UTC) Received: (qmail 84806 invoked by uid 500); 20 May 2011 20:33:06 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 84442 invoked by uid 500); 20 May 2011 20:33:06 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 84433 invoked by uid 99); 20 May 2011 20:33:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 May 2011 20:33:06 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aanilkumar@gmail.com designates 209.85.220.173 as permitted sender) Received: from [209.85.220.173] (HELO mail-vx0-f173.google.com) (209.85.220.173) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 May 2011 20:33:00 +0000 Received: by vxb37 with SMTP id 37so3689546vxb.32 for ; Fri, 20 May 2011 13:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:references:in-reply-to:mime-version :content-transfer-encoding:content-type:message-id:cc:x-mailer:from :subject:date:to; bh=0hdPTgyb8zJSH3/BEoiK+nrs2smy9S/OOOb0jxU35OI=; b=k3quki+w+FK/0obHkVDDeHmumNzJEh4BWMicq1+Fcq9tT01+0JUnn2ffxnxar+Mkzd 0ZJg/OP2uh3apHASfasPn5inpxMijHsYOb6iJ6J8XdSx/x8GnAz9h9MCpQplT3GK/j6U omBwIzF5+fniMqhBYdkSLxcGuaQ5AIlETqYYk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=dOXvVFv6Yrs5Z079XD7zhbxRv0H/vp7C06dLC1/HzfGbeGOWa0bjs+C1lAD4d7wZoa 7rd3vUIu1ZNt29g6aOtee5zF5nRoG2yDQO0bXMsUeP7xr9nUgxYMGeAELW4aam1Q/1vd AeJ40sikplUyZ2LxhJeIu7He349rurGigc6D4= Received: by 10.52.100.136 with SMTP id ey8mr80960vdb.136.1305923558716; Fri, 20 May 2011 13:32:38 -0700 (PDT) Received: from [10.9.189.12] (mobile-198-228-195-253.mycingular.net [198.228.195.253]) by mx.google.com with ESMTPS id i7sm880912vdu.21.2011.05.20.13.32.36 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 May 2011 13:32:37 -0700 (PDT) References: In-Reply-To: Mime-Version: 1.0 (iPhone Mail 8C148) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <83565D56-4381-4A2D-8B00-654A43A9F8DE@gmail.com> Cc: "java-dev@axis.apache.org" X-Mailer: iPhone Mail (8C148) From: Anil Atyam Subject: Re: getDataHandler returns Null.. AXIS2 1.2.11-- Smart Programming? Date: Fri, 20 May 2011 16:32:31 -0400 To: "java-dev@axis.apache.org" X-Virus-Checked: Checked by ClamAV on apache.org My apologies. I didn't mean to question the ability of the programmers. Ther= e could be a compelling reason to do so which I don't follow. Otherwise, I h= ave highest respect to these programmers and open source contributors.=20 Thanks Anil Atyam Ph: 703 473 0039 On May 20, 2011, at 3:48 PM, Andreas Veithen wro= te: > You should be very, very careful before posting comments suggesting > that the developers in this project are not doing "smart programming", > especially if these comments tend to show your own inexperience in > Java programming. >=20 > I recommend reading the following article to learn about the do's and > don'ts for a public mailing list: >=20 > http://www.catb.org/~esr/faqs/smart-questions.html >=20 >=20 > On Fri, May 20, 2011 at 19:40, Anil Atyam wrote: >> Folks >>=20 >>=20 >> getDataHandler method of org.apache.axiom.attachments.Attachments returns= >> NULL when it can't find the content part it is looking based on the conte= nt >> id. Shouldn't it return something else? I mean, if you return null its v= ery >> obvious that you get null pointer exception from this call is originiated= , >> in my case, org.apache.axiom.attachments.Attachments.getSOAPPartContentTy= pe. >>=20 >> I am not really sure why would you want to return null. Instead, You can >> handle the null case and throw an exception stating, required content bas= ed >> on content id not found in message etc. >>=20 >>=20 >>=20 >>=20 >>=20 >> I have copied my response MIME encoded message and please let me know if i= ts >> missing any MIME parts. My response schema has NO element of type >> base64Binary, howerver, the response is MIME encoded. >>=20 >>=20 >>=20 >>=20 >>=20 >> Checks whether the MIME part is already parsed by checking the attachment= s >> HashMap. If it is not parsed yet then call the getNextPart() till the >> required part is found. >>=20 >> Parameters: blobContentID (without the surrounding angle brackets and "ci= d:" >> prefix) Returns: The DataHandler of the mime part referred by the Content= -Id >> or *null* if the mime part referred by the content-id does not exist >> Checks whether the MIME part is already parsed by checking the attachment= s >> HashMap. If it is not parsed yet then call the getNextPart() till the >> required part is found. >>=20 >> Parameters: blobContentID (without the surrounding angle brackets and "ci= d:" >> prefix) Returns: The DataHandler of the mime part referred by the Content= -Id >> or *null* if the mime part referred by the content-id does not exist >>=20 >>=20 >>=20 >> 342 public DataHandler getDataHandler(String blobContentID) { >> 343 DataHandler dataHandler; >> 344 if (attachmentsMap.containsKey(blobContentID)) { >> 345 dataHandler =3D (DataHandler) >> attachmentsMap.get(blobContentID); >> 346 return dataHandler; >> 347 } else if (!noStreams) { >> 348 //This loop will be terminated by the Exceptions thrown if= >> the Mime >> 349 // part searching was not found >> 350 while ((dataHandler =3D this.getNextPartDataHandler()) !=3D= null) >> { >> 351 if (attachmentsMap.containsKey(blobContentID)) { >> 352 dataHandler =3D (DataHandler) >> attachmentsMap.get(blobContentID); >> 353 return dataHandler; >> 354 } >> 355 } >> 356 } >> 357 return null; >> 358 } >>=20 >>=20 >>=20 >>=20 >> MIME encoded response from the server side. >>=20 >>=20 >> HTTP/1.1 200 OK >> Connection: close >> Date: Thu, 12 May 2011 14:42:15 GMT >> Server: Microsoft-IIS/6.0 >> X-Powered-By: ASP.NET >> X-AspNet-Version: 2.0.50727 >> Cache-Control: private, max-age=3D0 >> Content-Type: multipart/related; type=3D"application/xop+xml"; >> boundary=3D--MIMEBoundary634407937359568655; >> start=3D"<0.634407937359568655@example.org>"; start-info=3D"text/xml; >> charset=3Dutf-8" >> Content-Length: 890 >>=20 >> ----MIMEBoundary634407937359568655 >> content-id: <0.634407937359568655@example.org> >> content-type: application/xop+xml; charset=3Dutf-8; type=3D"text/xml; >> charset=3Dutf-8" >> content-transfer-encoding: binary >>=20 >> > xmlns:soap=3D"http://schemas.xmlsoap.org/soap/envelope/" >> xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" >> xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" >> xmlns:wsa=3D"http://schemas.xmlsoap.org/ws/2004/08/addressing" >> xmlns:wsse=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wss= ecurity-secext-1.0.xsd" >> xmlns:wsu=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse= curity-utility-1.0.xsd">> Version=3D"1.000" xmlns=3D"http://www.amtrak.com/schema/2010/01/01">> /> >> ----MIMEBoundary634407937359568655-- >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org > For additional commands, e-mail: java-dev-help@axis.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org