I did some more digging and found that my issue is separate from the
HttpService issue.  I'm running into problems during the serialization
and deserialization of the SOAP request and response.

Errors occur whenever the web service uses enum types in the
request/response.  I have a different example outlined below for each
case.  Again, this all worked using Flex 2.

Example 1:  getUsers(startIndex : uint, maxResults : uint)

Request takes two native arguments, and the request is serialized
correctly, makes it to the server, and the server sends the correct
response.  The response consists of an array of UserDTO objects, which
look like:

public var id: String
public var name : String
public var userStatus : String  // type is a Java Enum on the server
side, should be deserialized to a String
etc.

When the response is deserialized, I debugged through and everything
works correctly until the XMLDecoder gets to the userStatus variable,
where I get the following FaultEvent:

Cannot find definition for type
'http://enums.usergroup.docfinity.com::UserStatus''


Example 2: getUsersByCriteria(startIndex : uint, maxResults : uint,
criteria : UserCriteria)

The UserCriteria object defines search parameters for the result set. 
The UserCriteria object looks like:

public var groupIds : Array // array of group Id strings to search in
public var name : String
public var userStatuses : Array // array of UserStatus values, which are
really strings since AS doesn't support Enums
etc.

When the request is serialized, I debugged through and everything works
correctly until the XMLEncoder gets to the userStatuses variable, where
I get the following error:

Cannot find definition for type
'http://enums.usergroup.docfinity.com::ArrayOfUserStatus'


Conclusion: Both of those error messages are related to constructs that
use Java Enums which were previously serialized into Strings.  In the
WSDL, those Enum definitions look like this:

<xsd:simpleType name="UserStatus">
     <xsd:restriction base="xsd:string">
         <xsd:enumeration value="ACTIVE"/>
         <xsd:enumeration value="INACTIVE"/>
         <xsd:enumeration value="DELETED"/>
     </xsd:restriction>
</xsd:simpleType>

<xsd:complexType name="ArrayOfUserStatus">
     <xsd:sequence>
         <xsd:element maxOccurs="unbounded" minOccurs="0"
name="UserStatus" nillable="true" type="ns1:UserStatus"/>
     </xsd:sequence>
</xsd:complexType>

Once I saw that, I remembered reading a note in the documentation about
XSD types that Flex doesn't support:

The following XML Schema structures or structure attributes are ignored
and are not supported in Flex 3:
<simpleType>
     <restriction>
         <enumeration>
     </restriction>
</simpleType>

So if they're ignored and not supported, I would at least imagine that
it would go back to the base type of the simpleType (string in this
case), and serialize using that, instead of breaking.  Am I on the right
track here?  Is this a bug or a known issue with a work-around?  Anybody
from Adobe familiar with this?

Reply via email to