Well I figured it out.
You need to create custom classes for all the data objects you want to send
back to your SOAP service.
------ snip 8< ------
//Relevant actionscript for sending the SOAP call.
var testobj0:ContentMetaItem = new
ContentMetaItem("testcid0","testtitle0","description0");
var testobj1:ContentMetaItem = new
ContentMetaItem("testcid1","testtitle1","description1");
var testarray:Array = new Array(testobj0,testobj1);
var resultobj = soapservice.getContentMeta (testarray);
//ContentMetaItem.as class file
class ContentMetaItem
{
// variable declarations
var cid:String;
var mid:String;
var title:String;
var description:String;
// constructor
public function ContentMetaItem (cid:String, mid:String title:String,
description:String){
this.cid = cid;
this.mid = mid;
this.title = title;
this.description = description;
}
}
//Actual SOAP request from flash to the webserver
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body xmlns:ns1="urn:LearnTools">
<ns1:getContentMeta
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<ContentList xsi:type="soapenc:Array"
soapenc:arrayType="ns1:ContentMetaItem[2]"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<item xsi:type="ns1:ContentMetaItem">
<mid xsi:type="xsd:string">testtitle0</mid>
<cid xsi:type="xsd:string">testcid0</cid>
<name />
<description />
</item>
<item xsi:type="ns1:ContentMetaItem">
<mid xsi:type="xsd:string">testtitle1</mid>
<cid xsi:type="xsd:string">testcid1</cid>
<name />
<description />
</item>
</ContentList>
</ns1:getContentMeta>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------ snip 8< ------
You also need a correctly formtted WSDL file so flash knows how to serialize
the data correctly.
This all seems sort of obvious now...I suppose it would in hindsight.
As per my other post on Flash and SOAP Ill eventually put this stuff on teh web
for any one else struggling with flash and SOAP.
Cheers,
Tom
Cheers,
Tom
On Fri, 18 Aug 2006 13:08:55 +0100, you wrote:
>Is there some magical method to get flash to serialise my objects
>correctly when Im sending data to the webserver?
>
>Im trying to send an array of objects up but all flash sends is an
>array with the right number of elements inside with no data.
>
>as:
>var testobj1:Object;
>testobj1.cid = "testcid1";
>testobj1.mid = "testmid1";
>testobj1.name = "testname1";
>testobj1.description = "testdesc1";
>
>var testobj2:Object;
>testobj1.cid = "testcid2";
>testobj1.mid = "testmid2";
>testobj1.name = "testname2";
>testobj1.description = "testdesc2";
>
>var testaray:Array = new Array(testobj1,testobj2);
>var resultobj = soapservice.getContentMeta (testarray);
>
>
>SOAP request:
><?xml version="1.0" encoding="utf-8"?>
><SOAP-ENV:Envelope
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
> <SOAP-ENV:Body xmlns:ns1="urn:LearnTools">
> <ns1:getContentMeta
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <ContentList xsi:type="soapenc:Array"
> soapenc:arrayType="ns1:ContentMetaItem[2]"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
> <item xsi:type="ns1:ContentMetaItem">
> <mid />
> <cid />
> <name />
> <description />
> </item>
> <item xsi:type="ns1:ContentMetaItem">
> <mid />
> <cid />
> <name />
> <description />
> </item>
> </ContentList>
> </ns1:getContentMeta>
> </SOAP-ENV:Body>
></SOAP-ENV:Envelope>
>
>you can see that the SOAP request is correctly formed..so flash
>obviously understands what is needed but why isnt it putting the
>object data from testobj1 and testobj2 into the SOAP request?
>
>Cheers
>Tom
>
>On Thu, 17 Aug 2006 10:31:35 +0700, you wrote:
>
>>One of my prospective clients want to have flash app with US map. My
>>partner found this nice tools, www.flashmaps.com and I'm wondering if
>>you guys have some experience with it.
>>
>>note:
>>this message is cross-posted to Flashnewbie list, hope you wouldn't mind.
>_______________________________________________
>[email protected]
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
>Brought to you by Fig Leaf Software
>Premier Authorized Adobe Consulting and Training
>http://www.figleaf.com
>http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com