Matt,

Thanks for your reply.

Could you explain me a bit of how this 'literal request format' would
work?

Thanks in advance,
Pablo Apanasionek

-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En
nombre de Matt Chotin
Enviado el: Viernes, 10 de Febrero de 2006 04:36
Para: [email protected]
Asunto: RE: [flexcoders] Array serialization for Webservice

Unfortunately I think this may be a known bug.  I believe you're going
to need to do a literal request format and pass the information in XML
yourself to make it work.  I don't remember if we may have fixed this in
a hotfix, if you have a support contract you may want to ask your rep.

Matt

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Pablo Apanasionek
Sent: Thursday, February 09, 2006 11:03 AM
To: [email protected]
Subject: [flexcoders] Array serialization for Webservice

I tried many things without results, so I decided to ask for help.

I'm using Flex 1.5 and some Java Webservices. I have an object that is
passed as a parameter to a webservice. The Object goes something like
this:

SomeObject(code:String, ranges:Array)

The "ranges" array contains 1 or more instances of some other object,
which has a String and two Numbers.

So far, so good. And here comes the problem:

When I complete my paramObject with a code and ONE range in the ranges
array (which I decided to declare as Object = code:AAA,
ranges:(D,200,300)), it serializes like this:

<code>AAA</code>
<ranges>
  <scope>X</scope>
  <from>200</from>
  <to>300</to>
<ranges>

Its values are passed like this:

someService.addType.request.code = 'AAA';
someService.addType.request.ranges.scope = 'X';
someService.addType.request.ranges.from = 200;
someService.addType.request.ranges.to = 300;

This format posts well to the webservice, and it results OK.

But, if I add a range (in the array), so it holds two ranges, I step
into two problems:

1) If I stick to declaring "ranges" as an Object, I can't add another
instance of it.

2) If I convert "ranges" into an Array, and add the two complete
objects, although the Flex Network Monitor and Trace Panel show it
right, it gets serialized like this:

<code>AAA</code>
<ranges/>
<item>
  <scope>X</scope>
  <from>200</from>
  <to>300</to>
<item>
<item>
  <scope>Z</scope>
  <from>400</from>
  <to>500</to>
<item>

Resulting in a fault event of the webservice, because of the
unrecognized property "item".

Is there a way to change the serialization of array (as I would need to
name each item as "ranges" and not as "item") or some other way to fix
this?

Thanks in advance,
Pablo Apanasionek





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links



 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to