The result you get from the operation's invocation will be strongly typed. If you are using a CallResponder, the lastResult property will contain the result (strongly typed). You can cast (or use the as operator) - var book:BookVO = responder.lastResult as BookVO;
Thanks for your answer, Sameer. Yes, I see what you're saying, but it's not what I'm looking for. As you say, I need to explicitly cast the result to the known return type. But what if the return type in the WSDL changes for a given web service method? Even though I regenerate the proxy classes, my application will still fail, at run time! I'll have to manually change all the cast statements throughout the code base. This is not necessary, is it? I want to be able to write type-safe code and know the return type at compile time. Especially since the code generator actually knows the type. In my understanding, the custom ResultEvents that were previously generated allow exactly that. So I reiterate: where have they gone, suddenly? How am I supposed to tackle this?
The data wizards which existed in Flex Builder 3 are replaced by Data Centric Development (Feature) in Flash Builder 4 which offers a better way of working with different types of services.
In your case, you can use a model to store the results. Then, you'll be required to change the cast in one place only i.e., the model.
More articles on web-services (using DCD) here -
I have had a look at those articles, and they don't go beyond stock functionality. I must say that I can't see how a "model" is going to help, either. I would have to write a wrapper for every single web service method, or rather, write my own Event classes. In any case, that means manual work and testing every time the WSDL changes. Disappointing, especially since the required functionality was apparently there in the previous version of Flash Builder.
I also take it that there is no way to automatically generate Exceptions classes which correspond to SOAP faults. Too bad. I think Adobe should look to improve in these areas in the next version.