Menu

#5 typoe of values not encoded if within a struct - fixed

open
nobody
5
2007-01-10
2007-01-10
Anonymous
No

Hi,

THe MethodCallImpl class doesn't encode the type of values if they are within a STRUCT. This was a problem for me, so I've fixed it in my own version (although it could probably check for doubles etc, i only needed ints.

Existing code:
<snip>
// add value node MemberNode.appendChild(this.createElement("value")); MemberNode.lastChild.appendChild(this.createTextNode(parameter.value[i]));
</snip>

my new code:
<snip>
// add value node
MemberNode.appendChild(this.createElement("value"));
// ammended by atom to wrap a type around the node values
var aval = parameter.value[i];
if (typeof(aval) == "number"){
var subTypeNode:XMLNode = this.createElement("int");
} else if (typeof(aval) == "boolean"){
var subTypeNode:XMLNode = this.createElement("bool");
} else {
// must be a string then.
var subTypeNode:XMLNode = this.createElement("string");
}
subTypeNode.appendChild( this.createTextNode( aval ) );
MemberNode.lastChild.appendChild( subTypeNode );
// end ammended by atom
</snip>

Adam

(adam <at> adamhoyle <dot> co <dot> uk)

Discussion


Log in to post a comment.