On Fri, 22 Aug 2008 08:08:02 +1000, Josh McDonald wrote
> I assume you mean 3.1 where you put 2.1 :)
Yes, there was a bug in my mail client that changed the 3.1 to 2.1 when I
pressed "send". ;)
> What exactly is happening in 3.1 that's not happening in 3.0? Without posting
> "the real code" where the VOs aren't what you've shown here it's kinda hard
> to help, so I've gotta ask more questions :) Also how are you invoking the
> service, and what code are you using to map the xsd types to your classes?
What is actually happening is an array of strings is now being created as an
array that has one element of type ArrayCollection. That nested array is the
array of strings. The detailed description of what was happening is way at the
bottom of my original post. The service is invoked via mx.rpc.soap.WebService
by calling service.operation(Request) . The xsd types are being mapped via
this mechanism:
SchemaTypeRegistry.getInstance().registerClass(new
QName("http://www.harte-hanks.com/hhl-User/","UserType"),UserType);
> I'm pretty familiar with Flex's SOAP encoder/decoder by now, so I can
> probably help, and also if there's a bug in 3.1 I wanna know about it so I
> can fix it :)
Thanks for your help. I've been reading this forum for probably a year and
have seen your involvement here and in the bug tracking system. I will put
together a working sample, I should be able to reproduce the issue in a small
program where I can post the whole working thing.
>
> -Josh
>
> On Fri, Aug 22, 2008 at 1:18 AM, jeff <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am seeing an issue introduced with SDK 3.1 where the SDK is not properly
> mapping XML schemas to AS classes. We use the SchemaTypeRegistry magic to
> have our AS classes instantiated based on the types contained in our SOAP
> response. We are seeing improper object creation, beginning in SDK 3.1, as
> detailed below.
>
> =====
>
> AS Class:
>
> public dynamic class UserType {
>
> public var login:String="";
> public var Locale:LocaleType = new LocaleType();
> public var Flags:ArrayCollection = new ArrayCollection();
>
> public function UserType():void {
> }
> }
>
> Schema fragment:
>
> <xsd:simpleType name="AccessFlagType">
> <xsd:restriction base="xsd:string">
> <xsd:minLength value="1"></xsd:minLength>
> <xsd:maxLength value="20"></xsd:maxLength>
> </xsd:restriction>
> </xsd:simpleType>
>
> <xsd:complexType name="AccessFlagsType">
> <xsd:sequence>
> <xsd:element name="Flag" type="hhl-User:AccessFlagType" minOccurs="0"
> maxOccurs="unbounded"></xsd:element>
> </xsd:sequence>
> </xsd:complexType>
>
> <xsd:complexType name="UserType">
> <xsd:sequence minOccurs="1" maxOccurs="1">
>
> <xsd:element name="login" maxOccurs="1">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="10" />
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:element>
> <xsd:element name="Locale" type="hhl-common:LocaleType" minOccurs="1"
> maxOccurs="1"></xsd:element>
> <xsd:element name="Flags" type="hhl-User:AccessFlagsType"></xsd:element>
>
> </xsd:sequence>
> </xsd:complexType>
>
> XML:
>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:ns1="http://www.harte-hanks.com/hhl-User/">
> <SOAP-ENV:Body>
> <authenticateResponse>
> <authenticated>true</authenticated>
> <UserInfo>
> <login>trainallac</login>
> <Locale>
> <countrycode>USA</countrycode>
> <languagecode/>
> <currencycode>USD</currencycode>
> </Locale>
>
> <Flags>
> <Flag>OESIMPORTORDERS</Flag>
> <Flag>ONESITE-ENGAGE_EDIT</Flag>
> <Flag>OES-FLEX</Flag>
> <Flag>OES-CREATE-BILLTO</Flag>
> <Flag>REPORTS</Flag>
> </Flags>
> </UserInfo>
> </authenticateResponse>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> =====
>
> What happens with SDK 2.1 is the UserType.Flags gets created as type
> ArrayCollection, which has only one element. This element is another
> ArrayCollection instance which contains the flags.
>
> If the Flags property is commented out of the class definition, the SDK will
> "dynamically" create the Flags ArrayCollection and populate it with the
> expected values. Also, this issue does not exist with SDK 3.0 .
>
> In our real code, Flags is a subclass of ArrayCollection. So the fix is not
> as simple as just commenting out the formal definition for Flags and letting
> the SDK create the property itself, since the SDK will then create an instance
> of ArrayCollection instead of our subclass. In our real code, the bogus
> nested Flags are both of the type of our class, so there's definitely
> something sketchy going on here. I haven't been able to come up with a good
> workaround yet, so we're building against 3.0 SDK for the time being.
>
> Thanks,
> Jeff
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>
>
> --
> "Therefore, send not to know For whom the bell tolls. It tolls for thee."
>
> :: Josh 'G-Funk' McDonald
> :: 0437 221 380 :: [EMAIL PROTECTED]
> !DSPAM:48ade973311646491211187!