axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Sauthier (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Commented: (AXIS-1697) RPCParam.getValue() returns null
Date Tue, 07 Dec 2004 08:49:11 GMT
     [ http://nagoya.apache.org/jira/browse/AXIS-1697?page=comments#action_56317 ]
     
Guillaume Sauthier commented on AXIS-1697:
------------------------------------------

Yes, that resolves the RPCParam.getValue() returning null.

But that doesn't solve the second comment I wrote here concerning NodeImpl.children not initialized
and returning an empty Iterator instead of returning an Iterator that give access to the underlying
Text node.

=> The SOAP tree structure is not completely instanciated with RPCParam.

Should we open another bug for this ?

> RPCParam.getValue() returns null
> --------------------------------
>
>          Key: AXIS-1697
>          URL: http://nagoya.apache.org/jira/browse/AXIS-1697
>      Project: Axis
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 1.2RC2
>  Environment: JOnAS 4.2.0+
>     Reporter: Guillaume Sauthier
>  Attachments: axis-rpcparam-patch.txt
>
> I've got a JAXRPC client handler, that modify the SOAP Message in the request step. In
order to do this, it navigate from the SOAPMessage of the MessageContext to the SOAPBody;
iterates on the body childs SOAPElement (representing operation name), and for each operation,
it iterates too on the operation childs elements (parameters).
> Finally, it invoke SOAPElement.getValue() on the parameter for retrieving the inner value
of the param (wich is a String in my case). And this call return always null !
> Schematically :
> SOAPMessage
> ->SOAPPart
>  ->SOApEnvelope
>    ->SOAPBody
>      ->* SOAPElement (operation)
>        ->* SOAPElement (parameter)
>          -> getValue() (=null)
> After a little debugging, i found that the final SOAPElement I get is for real a RPCParam
instance. Going a little deeper, I discover that RPCParam "delegate" to MessageElement (its
super class) the getValue() call that return null. Here is a code snippet (comments inside)
:
> //======================================================
>    /**
>     * Get the value of the doc as a string.
>     * This uses {@link #getAsDOM()} so is a heavyweight operation.
>     * @return the value of any child node, or null if there is no node/something went
>     * wrong during serialization. If the first child is text, the return value
>     * is the text itself.
>     * @see javax.xml.soap.Node#getValue() ;
>     */
>    public String getValue() {
>        // no recorder for me
>        // ======================
>        if ((recorder != null) && (!_isDirty)) {
>            StringWriter writer = new StringWriter();
>            TextSerializationContext outputContext =
>                new TextSerializationContext(writer);
>            try {
>                recorder.replay(startEventIndex,
>                                endEventIndex,
>                                new SAXOutputter(outputContext));
>            } catch (Exception t) {
>                log.debug("getValue()", t);
>                return null;
>            }
>            String value = writer.toString();
>            return (value.length() == 0) ? null : value;
>        }
>        // textRep is null for me
>        // ======================
>        if (textRep != null) {
>            // weird case: error?
>            return textRep.getNodeValue();
>        }
>        // objectValue too
>        // ======================
>        if (objectValue != null) {
>            return getValueDOM();
>        }
>        // children too
>        // ======================
>        if (children != null && !children.isEmpty()) {
>            if (children.get(0) instanceof org.apache.axis.message.Text) {
>                return ((org.apache.axis.message.Text)children.get(0)).getNodeValue();
>            }
>        }
>        // then, it always return null
>        // ======================
>        return null;
>    }
> //======================================================
> But there is other thing I view when debugging : RPCParam has a field named "value" with
value accessible via getObjectValue(). And this is this value that I want to be returned.
> Maybe we can add a RPCParam.getValue() that return this.getObjectValue() ?? 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message