all groups > flash data integration > april 2005 >
You're in the

flash data integration

group:

Associative Arrays from SOAP?


Associative Arrays from SOAP? suaveant
4/25/2005 12:00:00 AM
flash data integration:
Using Flash MX 2004 Pro. I am setting up a web service to pass data to Flash
from Perl. I am trying to figure out how (if it is possible) to define the WSDL
type definition to make Flash understand these.

Can anyone help me with this?
Re: Associative Arrays from SOAP? Anton_FA2
4/26/2005 12:00:00 AM
Hi,

sorry, dont have an anwser - but I'm in a similiar situation, so I'm hoping
someone can anwser this for me too.

I have a Java webservice which has this .wsdl which needs a Map/Struct object
returned to the webService (an associative array?)

Can someone tell me if this is possible?
Thanks

<wsdl:definitions targetNamespace="urn:mpappliance">
-
<wsdl:types>
-
<schema targetNamespace="http://xml.apache.org/xml-soap">
<import namespace="http://lang.java"/>
<import namespace="http://soap.apache.org"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
-
<complexType name="mapItem">
-
<sequence>
<element name="key" nillable="true" type="xsd:anyType"/>
<element name="value" nillable="true" type="xsd:anyType"/>
</sequence>
</complexType>
-
<complexType name="Map">
-
<sequence>
<element name="item" minOccurs="0" maxOccurs="unbounded"
type="apachesoap:mapItem"/>
</sequence>
</complexType>
</schema>
-
<schema targetNamespace="http://soap.apache.org">
<import namespace="http://xml.apache.org/xml-soap"/>
<import namespace="http://lang.java"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
-
<complexType name="SOAPException">
-
<sequence>
<element name="faultCode" nillable="true" type="soapenc:string"/>
<element name="message" nillable="true" type="soapenc:string"/>
<element name="rootException" nillable="true" type="xsd:anyType"/>
<element name="targetException" nillable="true" type="tns3:Throwable"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
-
<wsdl:message name="getPriceRequest">
<wsdl:part name="params" type="apachesoap:Map"/>
</wsdl:message>
-
<wsdl:message name="SOAPException">
<wsdl:part name="fault" type="tns2:SOAPException"/>
</wsdl:message>
-
<wsdl:message name="getPriceResponse">
<wsdl:part name="getPriceReturn" type="apachesoap:Map"/>
</wsdl:message>
-
<wsdl:portType name="MyPriceSOAP">
-
<wsdl:operation name="getPrice" parameterOrder="params">
<wsdl:input name="getPriceRequest" message="impl:getPriceRequest"/>
<wsdl:output name="getPriceResponse" message="impl:getPriceResponse"/>
<wsdl:fault name="SOAPException" message="impl:SOAPException"/>
</wsdl:operation>
</wsdl:portType>
-
<wsdl:binding name="rpcrouterSoapBinding" type="impl:MyPriceSOAP">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
-
<wsdl:operation name="getPrice">
<wsdlsoap:operation soapAction=""/>
-
<wsdl:input name="getPriceRequest">
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:mpappliance"/>
</wsdl:input>
-
<wsdl:output name="getPriceResponse">
<wsdlsoap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:mpappliance"/>
</wsdl:output>
-
<wsdl:fault name="SOAPException">
<wsdlsoap:fault name="SOAPException" use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:mpappliance"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
-
<wsdl:service name="MyPriceSOAPService">
-
<wsdl:port name="rpcrouter" binding="impl:rpcrouterSoapBinding">
<wsdlsoap:address location="http://server:8080/mpappliance-v2/rpcrouter"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Re: Associative Arrays from SOAP? suaveant
4/27/2005 12:00:00 AM
I actually figured this out, but now I am having trouble figuring out how to
send an array of hashes...

here is the type that turned my perl hashes into flash associative arrays...

<xsd:complexType name="testHash">
<xsd:all>
<xsd:element maxOccurs="1" minOccurs="1" name="foo" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="1" name="bar" type="xsd:string"/>
</xsd:all>
</xsd:complexType>

unfortunately, this means that each key must be specified in the wsdl, but
that is workable for me.
for instance this gives an associative array with keys 'foo' and 'bar'.
AddThis Social Bookmark Button