You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jarek Gawor (JIRA)" <ax...@ws.apache.org> on 2004/12/06 19:36:36 UTC
[jira] Resolved: (AXIS-1697) RPCParam.getValue() returns null
[ http://nagoya.apache.org/jira/browse/AXIS-1697?page=history ]
Jarek Gawor resolved AXIS-1697:
-------------------------------
Resolution: Fixed
Updated the RPCParam.getValue() to work exactly as before. I belive we could still add this String check for peformance reasons.
> 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