Flex 3 & Webservices
Cristian Ivascu :: Adobe
360 Flex, Milan
08 – APR - 2008

Copyright 2008 Adobe Systems Incorporated. ...
Agenda


Introduction to Flex and web services



Building a SOAP-based app



REST services



Building a del.icio.us...
One server, multiple, disparate clients

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

3
What are webservices?
W3C says:
“a software system designed to support interoperable Machine to Machine
interaction over a...
Web services – which one?


SOAP & WSDL



Verbose





Machine usable

Enterprise

REST


Light-weight



No encod...
Flex and Webservices



Flex creates rich clients;



Web services bring data to the client



Flex works with web serv...
WSDL sample - VideoSearch

•

Only one operation

•

Simple request parameters

•

Slightly complex response

•

Link: htt...
How to access the service?



At runtime



At development time (via tool support)

Copyright 2008 Adobe Systems Incorpo...
Runtime Demo


Let’s see it in the Builder!

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

9
When to use it
•

Dynamic scenarios

•

Discovery of services at run-time

•

Services that may change more often

Charact...
What about this?

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

11
Dev-time way
Why?
•

For the more static scenarios – build and forget

•

For increased productivity

•

To make it easier...
Video Search Demo redone


The same Video Searching app re-done to take
advantage of the new features.,



Let’s see how...
Generated code – is this spaghetti?

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

14
How to find and fix problems


Check if the schema is there



Breakpoints in call() and processResult()



Check type ...
Known issues with the generated code


We don’t support everything – only WS-I 1.0 profile;
wsdl 1.0 & soap 1.1



Known...
REST


Can use multiple output formats – XML, JSON, etc



Is very light-weight





Pro: performance
Con: there is n...
Flex & Rest services


They haven’t change much



AS allows manipulation of XML and binding to objects



But there’s ...
DEMO – del.icio.us API usage


xmlDecode to convert raw xml into an array of “Post.as” instances



There is also a more...
Flex | Final words of wisdom


Web services are a way of getting data into your Flex app;



When building rich clients ...
Q&A

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

21
This is (almost) the last slide
•

Flex can cope with both dynamic and strong-typed web service usage.

•

The wizard only...
Go play!

http://adobe.com/go/flex
…and off to lunch! Buon
appetito!
Copyright 2008 Adobe Systems Incorporated. All rights...
Upcoming SlideShare
Loading in...5
×

Flex360 Milan 2008 - Flex & Webservices

88

Published on

The presentation on Flex Builder's integration with SOAP webservices. Presented in 2008 at Flex360 Milan

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
88
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Flex360 Milan 2008 - Flex & Webservices

  1. 1. Flex 3 & Webservices Cristian Ivascu :: Adobe 360 Flex, Milan 08 – APR - 2008 Copyright 2008 Adobe Systems Incorporated. All rights reserved. 1
  2. 2. Agenda  Introduction to Flex and web services  Building a SOAP-based app  REST services  Building a del.icio.us based app  Q&A Copyright 2008 Adobe Systems Incorporated. All rights reserved. 2
  3. 3. One server, multiple, disparate clients Copyright 2008 Adobe Systems Incorporated. All rights reserved. 3
  4. 4. What are webservices? W3C says: “a software system designed to support interoperable Machine to Machine interaction over a network” (W3C) In practice: web apis that are accessed remotely Practice matters! Copyright 2008 Adobe Systems Incorporated. All rights reserved. 4
  5. 5. Web services – which one?  SOAP & WSDL   Verbose   Machine usable Enterprise REST  Light-weight  No encoding  popular! Copyright 2008 Adobe Systems Incorporated. All rights reserved. 5
  6. 6. Flex and Webservices  Flex creates rich clients;  Web services bring data to the client  Flex works with web services in an easy manner Copyright 2008 Adobe Systems Incorporated. All rights reserved. 6
  7. 7. WSDL sample - VideoSearch • Only one operation • Simple request parameters • Slightly complex response • Link: http://localhost/video.wsdl Copyright 2008 Adobe Systems Incorporated. All rights reserved. 7
  8. 8. How to access the service?  At runtime  At development time (via tool support) Copyright 2008 Adobe Systems Incorporated. All rights reserved. 8
  9. 9. Runtime Demo  Let’s see it in the Builder! Copyright 2008 Adobe Systems Incorporated. All rights reserved. 9
  10. 10. When to use it • Dynamic scenarios • Discovery of services at run-time • Services that may change more often Characteristics • Not tied to a particular implementation • Very flexible • Adapts easily to changes, without messing with the code Copyright 2008 Adobe Systems Incorporated. All rights reserved. 10
  11. 11. What about this? Copyright 2008 Adobe Systems Incorporated. All rights reserved. 11
  12. 12. Dev-time way Why? • For the more static scenarios – build and forget • For increased productivity • To make it easier How? • Added classes to model the wsdl contents • Added a way to link types in wsdl to AS classes • Tool support & code generation Copyright 2008 Adobe Systems Incorporated. All rights reserved. 12
  13. 13. Video Search Demo redone  The same Video Searching app re-done to take advantage of the new features.,  Let’s see how it’s made. Copyright 2008 Adobe Systems Incorporated. All rights reserved. 13
  14. 14. Generated code – is this spaghetti? Copyright 2008 Adobe Systems Incorporated. All rights reserved. 14
  15. 15. How to find and fix problems  Check if the schema is there  Breakpoints in call() and processResult()  Check type mappings & wsdl type Copyright 2008 Adobe Systems Incorporated. All rights reserved. 15
  16. 16. Known issues with the generated code  We don’t support everything – only WS-I 1.0 profile; wsdl 1.0 & soap 1.1  Known issues – there are a few  Have one? Report it @ bugs.adobe.com/flex Copyright 2008 Adobe Systems Incorporated. All rights reserved. 16
  17. 17. REST  Can use multiple output formats – XML, JSON, etc  Is very light-weight    Pro: performance Con: there is no typing info! Is very popular Copyright 2008 Adobe Systems Incorporated. All rights reserved. 17
  18. 18. Flex & Rest services  They haven’t change much  AS allows manipulation of XML and binding to objects  But there’s a catch – httpservice.xmlDecode() + a custom model Copyright 2008 Adobe Systems Incorporated. All rights reserved. 18
  19. 19. DEMO – del.icio.us API usage  xmlDecode to convert raw xml into an array of “Post.as” instances  There is also a more generic approach – using SimpleXMLDecoder & ObjectTranslator http://booleanbetrayal.com/2007/05/18/httpservice-xmldecode-objecttranslator-an Copyright 2008 Adobe Systems Incorporated. All rights reserved. 19
  20. 20. Flex | Final words of wisdom  Web services are a way of getting data into your Flex app;  When building rich clients you need to use them  Web services in Flex can be better; for suggestions or bugs visit: bugs.adobe.com/flex Copyright 2008 Adobe Systems Incorporated. All rights reserved. 20
  21. 21. Q&A Copyright 2008 Adobe Systems Incorporated. All rights reserved. 21
  22. 22. This is (almost) the last slide • Flex can cope with both dynamic and strong-typed web service usage. • The wizard only generates some code for you. Tweak it! • Strong types are not for WSDL only. Use XMLDecode() . Copyright 2008 Adobe Systems Incorporated. All rights reserved. 22
  23. 23. Go play! http://adobe.com/go/flex …and off to lunch! Buon appetito! Copyright 2008 Adobe Systems Incorporated. All rights reserved. 23
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×