I have a Web Service which returns an ArrayList. According to http://forums.msdn.microsoft.com/en-US/asmxandxml/thread/9b6c1f9d-7021-437e-8bc0-b3e9bcfe834e/ Deserialize won't work on an ArrayList. Any suggestions how to get around this?
"sh" wrote in message news:Qd6dnaeCZcwbAfbVnZ2dnUVZ_vudnZ2d@earthlink.com... > I have a Web Service which returns an ArrayList. According to > http://forums.msdn.microsoft.com/en-US/asmxandxml/thread/9b6c1f9d-7021-437e-8bc0-b3e9bcfe834e/ > Deserialize won't work on an ArrayList. > > Any suggestions how to get around this? It can serialise/deserialise an ArrayList. It cannot cope with an Array of ArrayLists. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name
It can't cope with the following. Is this an Array of ArrayLists? <?xml version="1.0" encoding="utf-8" ?> <ArrayOfOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://aaa.com/"> <Order> <OrderNo>505913</OrderNo> <Carrier>WC</Carrier> <Rush>false</Rush> <Pack>true</Pack> </Order> <Order> <OrderNo>505983</OrderNo> <Carrier>PIT</Carrier> <Rush>false</Rush> <Pack>true</Pack> </Order> <Order> <OrderNo>506017</OrderNo> <Carrier>NEP</Carrier> <Rush>false</Rush> <Pack>true</Pack> </Order> </ArrayOfOrder> If it is, is there a way around it? Joe Fawcett wrote: > > > "sh" wrote in message > news:Qd6dnaeCZcwbAfbVnZ2dnUVZ_vudnZ2d@earthlink.com... >> I have a Web Service which returns an ArrayList. According to >> http://forums.msdn.microsoft.com/en-US/asmxandxml/thread/9b6c1f9d-7021-437e-8bc0-b3e9bcfe834e/ >> >> Deserialize won't work on an ArrayList. >> >> Any suggestions how to get around this? > It can serialise/deserialise an ArrayList. It cannot cope with an Array > of ArrayLists. >
No, and I have certainly coded similar serialisations. For example I have a user class that contains an ArrayList of Address objects. You just need to use the correct attributes on the members. I will go and dig out the code. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name "sh" wrote in message news:XsGdndJXqdz-b_HVnZ2dnUVZ_uWdnZ2d@earthlink.com... > It can't cope with the following. Is this an Array of ArrayLists? > > <?xml version="1.0" encoding="utf-8" ?> > <ArrayOfOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://aaa.com/"> > <Order> > <OrderNo>505913</OrderNo> > <Carrier>WC</Carrier> > <Rush>false</Rush> > <Pack>true</Pack> > </Order> > <Order> > <OrderNo>505983</OrderNo> > <Carrier>PIT</Carrier> > <Rush>false</Rush> > <Pack>true</Pack> > </Order> > <Order> > <OrderNo>506017</OrderNo> > <Carrier>NEP</Carrier> > <Rush>false</Rush> > <Pack>true</Pack> > </Order> > </ArrayOfOrder> > > If it is, is there a way around it? > > Joe Fawcett wrote: >> >> >> "sh" wrote in message >> news:Qd6dnaeCZcwbAfbVnZ2dnUVZ_vudnZ2d@earthlink.com... >>> I have a Web Service which returns an ArrayList. According to >>> http://forums.msdn.microsoft.com/en-US/asmxandxml/thread/9b6c1f9d-7021-437e-8bc0-b3e9bcfe834e/ >>> Deserialize won't work on an ArrayList. >>> >>> Any suggestions how to get around this? >> It can serialise/deserialise an ArrayList. It cannot cope with an Array >> of ArrayLists. >> I