This content has been marked as final. Show 5 replies
I have been all through the live docs and the builder help system, most web service examples are not that descript and are mxml. I prefer to work in strongly typed code with custom classes.
Also most of the examples are one way, do not address security and lean toward FDS which is not an option. It would be nice to have a complete example of viewing and editing some simple data using a web service and custom classes with some simple business logic store the data.
I understand your frustration. Data access has always been one of the hardest things about getting started with Flex.
An additional complication with providing a webservice example is that such a web service must be implemented in a server environment, which Flex 2.0 does not require. 1.5 had the server, so it could provide an axis webservice example. With 2.0, you don't get any known web server to implement an example in.
When you start asking for updatable data store and security, it just gets impossible to provide an example. Except with FDS, hence the orientation.
It is going to be up to us, the development community, to build up an example store.
Originally posted by: mike2281
Is there a complete code example that shows how to call a specific method on a web service completely from actionscript.
Information on caching the ws and or operation in a static var would also be helpful as it looks like you can create the web service and the operation once and use multiple times.
also: Does the operation return a generic AS object?
I am also working with webservices (soap1.1, document/wrapped) and my opinion is that the webservice access from flex, whether using actionscript of mxml, is for the casual user, for making 1 single call o a webserice which returns a not too complex structure. For instance:
- there's no way to have the proxy classes for the request and response types generated before runtime (you can work out the request problem by manually coding your classes, but that's only usable if you'll call 1 or 2 webservices and they require very simple parameter sets), so you still work with the wsdl file but for manually creating classes for the types you need.
- haven't found a way to embed a certificate for calling a secure (message-level encryption) webservice. Maybe it's there but documentation is still quite hard to review.
I've been able to make my app call some webservices (returning lists of very complex structures), but had to code the request type class, and had to deal with manually copying the response from the "runtime proxy classes" to the actual classes describing the response type. Not that it can't be done, but it slows you down quite a bit as compared to java2/swing, for example.
FDS... not an option here. Sorry.
In any case, if you will have to deal with small, simple (soap) webservices, I think you can still use flex2, but if you application heavily depends on multiple calls to webservices... things may be different.
ntsiii & vrlink,
Thanks for you comments regarding web services.
When I say example, I don’t need a full round trip working example, just some basics of extracting data from the result without FDS which Im sure is doing the same magic I am about to build into the DOTNET compiler. Using good trial and error I solved this issue for the call coming in, easy to see when you look at the code without knowing hardly anything about the service, it's just frustrating that it all falls on FDS which is expensive and even if the expense was justifiable, I am DOTNET so java is not going to happen. The good news is getting the data is rather simple I posted the code in another post on this.
Now I have not sent the data back to the server nor authenticated the request, but it looks like it wont be that bad.
Another thing that helped was reading the CAIRNGORM articles many many times...
Now there are alot of things in that micro-framework that I cant justify at this time but in the first couple of articles it does offer some good insight into FLEX and best practices.
I come from C# DOTNET so I demand full type safety and compile time checking, I fully intent to code generate the classes / adapters and connectors into as class files, which once I have a working example will be a trivial task.
CAIRNGORM is a cool concept but it's a little over classed for my style, and I’m coming up with my own best practices which are getting there through pure trial and error as non FDS examples do not exist at this time. The biggest problem with the FLEX examples is they are a little to basic, what I mean is lets load up some people and contacts from a WS edit them and then save with a WS, authenticate, issue a ticket. Lets architect a large RIA and managing child apps and their interaction via interfaces or super classes.
Reading most of the questions in here, we get the concept of data binding, validation grids and the like as it's similar to what we have been accustomed to already. Lets get into building an advanced RIA even if it's an abstract discussion without exact code.