Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

WebServices and AS3

New Here ,
May 30, 2009 May 30, 2009

I am new to Flash and am looking for a RIA technology.  One of the key things I am looking for direct interaction with Web Services that are on the domain as the RIA code.  In other words, I don't want to have any server side code between the RIA and the Web Services.

I was looking on Flash Development Center and all the Web services examples where for Flash Professional 8 and earlier.  Can Flash CS4 interact with a Web Service that is hosted on the same domain as the Flash CS4 movie? 

If Flash CS4 cannot, what about Flex?  I would prefer Flash, because I own it and I would prefer not to have to justify yet another development environment to my boss.

Sam

TOPICS
ActionScript
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 30, 2009 May 30, 2009

Sure it can, there are some restrictions due to the security sandbox that

Flash Player has, but you can read about this and how to overcome those

restrictions in the Flash Security Center

http://www.adobe.com/products/flashplayer/security/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 30, 2009 May 30, 2009

Michael,

Actually, I think I have the security stuff figured out:

Lets say the flash movie is http://www.myDomain.com/TheMovie.swf, than all the Web Services also need to be on http://www.myDomain.com somewhere. Seems pretty straight forward.

What I cannot find is any instructions/tutorials/examples of how to make TheMovie.swf call into a web service on the same domain.  Might you know where I can find one?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 30, 2009 May 30, 2009

Cool, you could use an script to detect to local domain at runtime, read

this:

http://renaun.com/blog/2008/10/16/264/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 30, 2009 May 30, 2009

So this is to say that there is no functionality built into Flash CS4 that can read a WSDL and create some nicely wrapped functions to call in AS3, you have to do it all by hand, correct?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 30, 2009 May 30, 2009

Not sure what you mean, but this function will detect the domain at runtime

and then you will not to hard code the full url. Although you could use an

xml to act as a config file, there are several approaches to this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 31, 2009 May 31, 2009

What do I mean?  Well the concept of a Web service is a transport mechanism between two different "systems".  Web Services are all based on the Web Services Description Language or WSDL.  WSDL is a xml based language that provides a model for describing Web services.  In other words, WSDL describes the operations that a Web service implements.  Please see Wikipedia for details on WSDL.

One of the transport mechanism for Web services is XML, Simple Object Access Protocol or SOAP to be specific.  In the other languages I use (.Net and standard C) there are tools that will read the WSDL and create classes and/or functions to that wrap all the plumbing.  I know there are Java and C++ tools to create all this wrapper code from the WSDL file, too.

The question is:  Is there a way for Flash CS4 to consume a WSDL file and generate "classes" so that I don't have to deal with the raw SOAP XML.

Sam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 31, 2009 May 31, 2009

Flex has those capabilities.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 31, 2009 May 31, 2009

But does Flash CS4 have that ability or is it ONLY Flex 3.0?  Also, where might I find an example of Flex 3.0 that used WSDL?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
May 31, 2009 May 31, 2009

I don't know much about the Flash Authoring tool, the only thing I know for

sure is that kind of feature is outside the scope of the tool. You can

download the Flex Builder Trial and play with it or go to Flex 3 LiveDocs

there you can find all the info that you need.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 31, 2009 May 31, 2009
LATEST

Out of the box, Flash AS3 has no Webservice support.

There are "WebService components" for AS2, but they dropped them for AS3.

Flex does have a WebService API and there's a few tricks to use those in Flash.

// the hard way

http://labs.wichers.nu/2007/12/25/using-flex-compiled-code-within-flash/

// easy way

http://flashauthoring.blogspot.com/2008/10/using-flex-webservice-component-in.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines