I'm trying to consume a .Net web service of mine in a Flex Builder 3 project. The function's signature in the service is:
bool MyFunction(Enums.Channels var1, Enums.Payments.PayMethods var2)
I tried importing the WSDL with the wizard but when I tried to call the web service it results in an error stating
"Cannot marshall type "http://www.w3.org/2001/XMLSchema::EnumsChannel" to simple type"
What kind of object do I need to create in Flex Builder 3 to pass into the webservice so that it will recognize it as the appropriate type? The wizard is not correctly creating the appropriate type. Here is the xsd for the enums.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/My.Shared" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/My.Shared">
<xs:simpleType name="Enums.Channels">
<xs:restriction base="xs:string">
<xs:enumeration value="Web"/>
<xs:enumeration value="ContactCenter"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="Enums.Channels" nillable="true" type="tns:Enums.Channels"/>
<xs:simpleType name="Enums.Payments.PayMethods">
<xs:restriction base="xs:string">
<xs:enumeration value="CreditCard"/>
<xs:enumeration value="PayPal"/>
<xs:enumeration value="eBillme"/>
<xs:enumeration value="BillMeLater"/>
<xs:enumeration value="TeleCheck"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="Enums.Payments.PayMethods" nillable="true" type="tns:Enums.Payments.PayMethods"/>
</xs:schema>
I'd like to try to build my own objects to call the service myself (without the wizard).... created the mx:WebService
and mx:Operation
but not sure how to handle the enum parameters.
I suppose this is a bit similar to this question Flex, .NET Web Service and Numeric Enums but a bit reversed.