A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11261 Flash Movies | 2 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: David Brown
» Title: 3D Pyramid
» Description: 3D pyramid created for the SharedKnowledge.net web intro.
» More by David Brown


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 6325 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: Leeds Technical Design
» Comments: Leeds Technical Design - Design consultancy, CAD Draughting and Contract Staff.


Random Links | Add your own Flash Related Links
Flash Tutorials 1212 Tutorials 7 New Tutorials Added!
What's New | Top100

» How to Make 3D Wall Flash Photo Gallery
» How to Make Personalized Multimedia Flash eCard in PowerPoint
» How to Create Grown up Christmas List Photo Story
» How to convert Youtube video(online SWF file) to video for portable devices?
» How to Make Flash Christmas Quizzes with Sounds & Videos
» FLV to PSP - How to convert YouTube video to PSP for mac
» Creating widgets fast and easily with SPAS 3.0
» How to Let PowerPoint Memorize like Man
» How to insert YouTube video (Flash video) into PowerPoint
» Unknown Tag: Title10
Random Tutorial | Add Site

bbm.netBBM.net is designed to save you time and deliver the highest quality royalty-free music for your multimedia projects. Features include: over 450 Music Loop Packages from some of the best composers in the business, our music search engine to speed your selection process, alternate music versions & bonus sounds to use for rollovers or transitions, free technical support and free consulting.

Click here for details »

Web Designer (+ some Development)
Aquent
US-SC-Spartanburg

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Tips_And_Techniques

Categories Bringing SOAP to Flash 5
Author: Tom Van den Eynde | Website: http://www.carels.com |

 
Page 1
1

Bringing SOAP to Flash 5


The problem

Flash 5 has support for XML communications over HTTP. However, sadly enough, there is no support for setting HTTP headers.
The 'SOAPAction' HTTP header is however essential if you want to communicate with SOAP-compliant webservices.
And what is very popular these days ? Yes, SOAP-based webservices...
And why are they popular ? Because they allow you to access business logic functionalities (for example doing a query to retrieve flight availability or the wheather in your city or live stock quotes or ...) over the Internet in a structured form (in other words without having to do screen- or HTML- scraping).

Do you, as a Flash developer, want to have access to these functionalities (check out http://uddi.microsoft.com for an overview of some of the webservices available to you today) ?

I do ! In order to make it possible for our Carels.Visual Studio tool (which allows you to build rich, web-enabled, user interfaces for business applications) to communicate with SOAP-compliant webservices I had to come up with a solution.

A possible solution

The solution is based on an ASP script but could be implemented using a Java servlet as well.
The idea is to send the XML request to this script. The script then adds, using information passed through the URL, the necessary SOAP elements in order to make the request SOAP-compliant.

An example of what a SOAP request and response looks like can be found at :
http://www22.brinkster.com/prasads/LiveQuoteService.asmx

SOAPAction HTTP-header issue

The major issue is the SOAPAction HTTP-header. It is just not possible to set such headers through Flash 5. Specificying the URL and the SOAPAction as variables in the URL used to call the ASP script makes it possible for the ASP script to use this information in order to build the required SOAP-compliant request.

Use the following URL construction (this solution only works with the POST method, NOT with the GET method !) :

http://HostnameOfAspHost/SomeVirtualDirectory/adsoap.asp?URL=http://HostnameOfSoapHost/SomeWebserviceUrl&SOAPAction=TheSoapActionRequired

SOAP envelop and body issue

Another, but minor, issue is the SOAP envelope and body. Support has been foreseen in the script for automatically adding the SOAP envelope and body can be done by adding the variable 'Envelope' to the URL. This variables has 3 possible values :

1 : Add the envelope and body to the outgoing XML
2 : Add the envelope and body to the outgoing XML and remove the envelope and body from the incoming XML
3 : Remove the envelope and body from the incoming XML

http://HostnameOfAspHost/SomeVirtualDirectory/adsoap.asp?URL=http://HostnameOfSoapHost/SomeWebserviceUrl&SOAPAction=TheSoapActionRequired&Envelope=2

When automatically adding the SOAP envelope and body (by specifying 1 or 2 for the Envelope variable) you can optionally set the encoding attribute of the XML processing instruction. This can be achieved by specifying the 'Encoding' variable on the URL :

http://HostnameOfAspHost/SomeVirtualDirectory/adsoap.asp?URL=http://HostnameOfSoapHost/SomeWebserviceUrl&SOAPAction=TheSoapActionRequired&Envelope=2&Encoding=iso-8859-1">http://HostnameOfAspHost/SomeVirtualDirectory/adsoap.asp?URL=http://HostnameOfSoapHost/SomeWebserviceUrl&SOAPAction=TheSoapActionRequired&Envelope=2&Encoding=iso-8859-1

The application domain issue

If you have been playing around with the XML over HTTP communication support in Flash then you are probably aware that it doesn't allow you to communicate outside your application domain. In other words hostnames different from the hostname used to access your Flash movie don't work.

This script solves this issue as well as it routes your call via the ASP script living next to your Flash movie. The ASP script doesn't suffer from the application domain limitation.

1

» Level Intermediate

Added: : 2002-01-24
Rating: 6.45 Votes: 11
Hits: 4066
» Author
Tom Van den Eynde is Product Marketing Director at Carels Corporation. Tom promotes the usage of XML and web services, not only for use in B2B and B2C scenarios but also as a means to build better user interfaces for business applications, portals, ... In the past he has developed thin client solutions that are being used by major companies worldwide.
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers