Bind to Nothing for Schema

WSDL for webservice here at work apparently does not define a return set (a bunch of holder settings on the Java side) as a complex type. Thus, the WebServiceConnector in Flash doesn’t know wtf to do with it dynamically, and returns only the first value in the set. The emailStatus service for example returns the user’s email address and how many emails they have. The result I get is an integer… simply a number with nothing else. Now, if you treat Flash like VB, and lay out all of your stuff and do a binding, it sets up a schema, type casts the return value as Object, and works like a charm.

I couldn’t for the life of me find a way to set a schema via code, whether via a WebServiceConnector, WebServiceClass, PendingCall, etc. A co-worker found out the above and politely asked that the WSDL’s be “modified” so my Flash can work. Feels like Flash hand-holding to me… makes me feel pretty ashamed, frankly. Whatever.

Until then, so I can hit my deadline, I dropped a WebServiceConnector on stage, and merely add my listener’s and call the trigger method. However, it still doesn’t keep the schema, so I had to bind it to something; in this case, I just bound to a constant value, which is a variable that will never exist; this is a hack I guess just to ensure the schema is kept for the return value since I myself can’t typecast it. I’m sure I can, I just don’t know how.

…so, for the internet archives, if you find yourself needing to typecast a return value from a web service to a specific datatype, use a WebServiceConnector in authortime mode (sacrilege, I know…), and bind to nothing.