flash on 2013-8-2
written to troubleshoot the issue in this StackOverflow question:
http://stackoverflow.com/questions/4456438/how-can-i-pass-the-string-null-through-wsdl-soap-from-as3-to-coldfusion-web/18000768
Filed bug FLEX-33644 in response to these results
♥0 |
Line 50 |
Modified 2013-08-03 08:43:25 |
MIT License
archived:2017-03-09 16:29:50
ActionScript3 source code
/**
* Copyright benjamin.c.burns ( http://wonderfl.net/user/benjamin.c.burns )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/jYIm
*/
//written to troubleshoot the issue in this StackOverflow question:
//http://stackoverflow.com/questions/4456438/how-can-i-pass-the-string-null-through-wsdl-soap-from-as3-to-coldfusion-web/18000768
//Filed bug FLEX-33644 in response to these results
package {
import flash.display.Sprite;
import flash.text.*;
import mx.rpc.xml.*;
public class FlashTest extends Sprite {
private var myTextBox:TextField = new TextField();
private var myTextBox2:TextField = new TextField();
private var myTextBox3:TextField = new TextField();
private var myTextBox4:TextField = new TextField();
private var myTextBox5:TextField = new TextField();
private var myTextBox6:TextField = new TextField();
private var myTextBox7:TextField = new TextField();
public function FlashTest() {
myTextBox.width = 400;
myTextBox2.y = 15;
myTextBox2.width = 400;
myTextBox3.y = 30;
myTextBox3.width = 400;
myTextBox4.y = 45;
myTextBox4.width = 400;
myTextBox5.y = 60;
myTextBox5.width = 400;
myTextBox6.y = 75;
myTextBox6.width = 400;
myTextBox7.y = 120;
myTextBox7.width = 400;
addChild(myTextBox);
addChild(myTextBox2);
addChild(myTextBox3);
addChild(myTextBox4);
addChild(myTextBox5);
addChild(myTextBox6);
addChild(myTextBox7);
myTextBox7.text = "See http://stackoverflow.com/q/4456438/203705 and FLEX-33644 for more info."
var s:String = "null";
var enc:XMLEncoder = new XMLEncoder();
var schemaConstants:SchemaConstants = SchemaConstants.getConstants();
var sm:SchemaMarshaller = new SchemaMarshaller(schemaConstants, SchemaDatatypes.getConstants(schemaConstants.xsdURI));
var x:XMLList = new XMLList();
myTextBox.text = "Value to encode: " + s;
myTextBox2.text = "new XMLEncoder().encode(value).toXMLString(): " + enc.encode(s);
myTextBox3.text = "Encoded value is null? " + (enc.encode(s) === null ? "true" : "false");
myTextBox4.text = "new XML().appendChild(value).toXMLString(): " + new XML().appendChild(s).toXMLString();
myTextBox5.text = "SchemaMarshaller.marshall(value): " + sm.marshall(s);
var myXML:XML = new XML();
myXML.text = s;
myTextBox6.text = "var myXML:XML = new XML(); myXML.text = value; myXML.toString(): " + myXML.toXMLString();
}
}
}