Datatype Conversions
Web services have specific simple types that are native to SOAP and other complex types that you can define. The SOAP datatypes and their ActionScript equivalencies are listed in Table 10-3.
|
ActionScript |
SOAP |
|
Null |
Null |
|
Undefined |
Null |
|
Boolean |
Boolean |
|
Number |
Decimal, Float, Double, Integer, Int |
|
String |
String |
|
Date |
DateTime |
|
Array (numeric index) |
Array |
|
Associative array |
Complex type |
|
RecordSet |
N/A |
|
Object |
Complex type |
ColdFusion also supports a QueryBean datatype, which allows you to transfer query objects as results from a web service. It is advisable, however, to create web services that will be more universally readable, such as an array. Not all consumers of web services will be able to access a QueryBean.
Passing Complex Datatypes to and from Web Services
Sending a complex datatype to a web service is sometimes as simple as defining it in the client-side ActionScript and passing it as an argument. An example of a web service that accepts a complex object as an argument and returns a complex object as a result is the Amazon.com web service. Unfortunately, this is not a service that is usable in different server environments. Example 10-6 works in ASP.NET and PHP environments only. The Flash Remoting gateway for Java and ColdFusion (essentially the same gateway) seems to have problems with this web service.
To make use of the Amazon.com web service, you must go to http://www.amazon.com/webservices ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access