Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 65230 invoked from network); 4 May 2005 16:26:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 May 2005 16:26:52 -0000 Received: (qmail 51549 invoked by uid 500); 4 May 2005 16:22:59 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 51375 invoked by uid 500); 4 May 2005 16:22:54 -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: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 51137 invoked by uid 99); 4 May 2005 16:22:52 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 04 May 2005 09:22:52 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 66BB4307 for ; Wed, 4 May 2005 17:47:09 +0200 (CEST) Message-ID: <2057177059.1115221629419.JavaMail.jira@ajax.apache.org> Date: Wed, 4 May 2005 17:47:09 +0200 (CEST) From: "Venkat Reddy (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Resolved: (AXIS-1537) getPreviousSibling results in NullPointerException on Envelopes In-Reply-To: <1202482239.1093982660299.JavaMail.apache@nagoya> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/AXIS-1537?page=all ] Venkat Reddy resolved AXIS-1537: -------------------------------- Resolution: Cannot Reproduce > getPreviousSibling results in NullPointerException on Envelopes > --------------------------------------------------------------- > > Key: AXIS-1537 > URL: http://issues.apache.org/jira/browse/AXIS-1537 > Project: Axis > Type: Bug > Components: SAAJ > Versions: beta-3 > Environment: Windows 2000, JDK 1.3 > Reporter: Michael Theroux > Assignee: Venkat Reddy > Priority: Minor > Attachments: MessageElement.java.patch, MessageElement.java.patch, NodeImpl.java.diff > > I am attempting to run an XSLT directly against a result SOAPEnvelope and have hit a couple of issues. > One issue is that SOAPEnvelope.getPreviousSibling() will result in a NullPointerException. Below is a code snippet: > /* > * Copyright 2001-2004 The Apache Software Foundation. > * > * Licensed under the Apache License, Version 2.0 (the "License"); > * you may not use this file except in compliance with the License. > * You may obtain a copy of the License at > * > * http://www.apache.org/licenses/LICENSE-2.0 > * > * Unless required by applicable law or agreed to in writing, software > * distributed under the License is distributed on an "AS IS" BASIS, > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > * See the License for the specific language governing permissions and > * limitations under the License. > */ > import org.apache.axis.client.Call; > import org.apache.axis.client.Service; > import javax.xml.namespace.QName; > public class Test > { > public static void main(String [] args) { > try { > String endpoint = > "http://webservices.sonicsw.com:8080/axis/CreditCheck.jws"; > Service service = new Service(); > Call call = (Call) service.createCall(); > call.setTargetEndpointAddress( new java.net.URL(endpoint) ); > call.setOperationName(new QName("http://webservices.sonicsw.com:8080/axis/CreditCheck.jws", "checkCredit") ); > // Call to addParameter/setReturnType as described in user-guide.html > call.addParameter("custid", > org.apache.axis.Constants.XSD_STRING, > javax.xml.rpc.ParameterMode.IN); > call.addParameter("amount", > org.apache.axis.Constants.XSD_FLOAT, > javax.xml.rpc.ParameterMode.IN); > call.setReturnType(org.apache.axis.Constants.XSD_BOOLEAN); > Boolean ret = (Boolean) call.invoke( new Object[] { "1234", new Float( 1.24 ) } ); > org.w3c.dom.Node n = call.getResponseMessage().getSOAPEnvelope(); > n.getPreviousSibling(); > /* Node parentNode = n.getParentNode(); > if( parentNode == null ) > System.err.println( "PARENT NODE IS NULL!" );*/ > // String test = com.sonicsw.xqimpl.script.Util.getElementAsString( (org.w3c.dom.Element)n, true ); > String test = org.apache.axis.utils.DOM2Writer.nodeToString( n, true ); > System.out.println("Resulting XML: " + test ); > } catch (Exception e) { > e.printStackTrace(); > System.err.println(e.toString()); > } > } > } > n.getPreviousSibling() throws a NullPointerException. > A workaround is to call getAsDOM() on the Envelope. > However, performance may make this undesireable. getAsDOM() will cause Axis's object model to be serialized as a string, then a subsequent deserialization will occur to create a native DOM because of performanceit results in a serialization of Axis's DOM structure to a string, then another deserialization occurs to create a DOM in your parser (such as Xerces). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira