.ben
01-10-2007, 08:47 PM
I'm exporting a service as a webservice using the spring framework and consuming it on the client again using spring.
The items I'm returning are of the class below:
public class SovPeriod
{
private List<int> m_advertIdsMaxPrice;
private List<int> m_advertIdsMinPrice;
private decimal m_minPrice;
private decimal m_maxPrice;
private Period m_period;
private decimal m_sov;
private decimal m_count;
private decimal m_avgPrice;
public SovPeriod()
{
//m_advertIdsMaxPrice = new List<int>();
//m_advertIdsMinPrice = new List<int>();
}
public decimal Sov
{
get
{
return m_sov;
}
set
{
m_sov = value;
}
}
public decimal Count
{
get
{
return m_count;
}
set
{
m_count = value;
}
}
public decimal AvgPrice
{
get
{
return m_avgPrice;
}
set
{
m_avgPrice = value;
}
}
public Period Period
{
get
{
return m_period;
}
set
{
m_period = value;
}
}
public decimal MaxPrice
{
get
{
return m_maxPrice;
}
set
{
m_maxPrice = value;
}
}
public decimal MinPrice
{
get
{
return m_minPrice;
}
set
{
m_minPrice = value;
}
}
public List<int> AdvertIdsMaxPrice
{
get
{
return m_advertIdsMaxPrice;
}
set
{
m_advertIdsMaxPrice = value;
}
}
public List<int> AdvertIdsMinPrice
{
get
{
return m_advertIdsMinPrice;
}
set
{
m_advertIdsMinPrice = value;
}
}
}
public class SovItem
{
private string m_name;
public List<SovPeriod> m_sovCalculations;
public List<SovItem> m_childSovItems;
public SovItem()
{
//m_name = string.Empty;
//m_sovCalculations = new List<SovPeriod>();
//m_childSovItems = new List<SovItem>();
}
public string Name
{
get
{
return m_name;
}
set
{
m_name = value;
}
}
public List<SovPeriod> SovCalculations
{
get
{
return m_sovCalculations;
}
set
{
m_sovCalculations = value;
}
}
public List<SovItem> ChildSovItems
{
get
{
return m_childSovItems;
}
set
{
m_childSovItems = value;
}
}
}
The webservice returns an array of SovItems.
Now comes the fun part.
On the server the array looks like this:
aParentSovItem1
---aChild1OfParent1
---aChild2OfParent1
aParentSovItem2
---aChild3ofParent2
---aChild4ofParent2
when this array arrives on the client, it looks like this:
aParentSovItem1
---aChild1OfParent1
---aChild2OfParent1
---aChild1OfParent1
---aChild2OfParent1
aParentSovItem2
---aChild3ofParent2
---aChild4ofParent2
---aChild3ofParent2
---aChild4ofParent2
No clue how to solve this.
The items I'm returning are of the class below:
public class SovPeriod
{
private List<int> m_advertIdsMaxPrice;
private List<int> m_advertIdsMinPrice;
private decimal m_minPrice;
private decimal m_maxPrice;
private Period m_period;
private decimal m_sov;
private decimal m_count;
private decimal m_avgPrice;
public SovPeriod()
{
//m_advertIdsMaxPrice = new List<int>();
//m_advertIdsMinPrice = new List<int>();
}
public decimal Sov
{
get
{
return m_sov;
}
set
{
m_sov = value;
}
}
public decimal Count
{
get
{
return m_count;
}
set
{
m_count = value;
}
}
public decimal AvgPrice
{
get
{
return m_avgPrice;
}
set
{
m_avgPrice = value;
}
}
public Period Period
{
get
{
return m_period;
}
set
{
m_period = value;
}
}
public decimal MaxPrice
{
get
{
return m_maxPrice;
}
set
{
m_maxPrice = value;
}
}
public decimal MinPrice
{
get
{
return m_minPrice;
}
set
{
m_minPrice = value;
}
}
public List<int> AdvertIdsMaxPrice
{
get
{
return m_advertIdsMaxPrice;
}
set
{
m_advertIdsMaxPrice = value;
}
}
public List<int> AdvertIdsMinPrice
{
get
{
return m_advertIdsMinPrice;
}
set
{
m_advertIdsMinPrice = value;
}
}
}
public class SovItem
{
private string m_name;
public List<SovPeriod> m_sovCalculations;
public List<SovItem> m_childSovItems;
public SovItem()
{
//m_name = string.Empty;
//m_sovCalculations = new List<SovPeriod>();
//m_childSovItems = new List<SovItem>();
}
public string Name
{
get
{
return m_name;
}
set
{
m_name = value;
}
}
public List<SovPeriod> SovCalculations
{
get
{
return m_sovCalculations;
}
set
{
m_sovCalculations = value;
}
}
public List<SovItem> ChildSovItems
{
get
{
return m_childSovItems;
}
set
{
m_childSovItems = value;
}
}
}
The webservice returns an array of SovItems.
Now comes the fun part.
On the server the array looks like this:
aParentSovItem1
---aChild1OfParent1
---aChild2OfParent1
aParentSovItem2
---aChild3ofParent2
---aChild4ofParent2
when this array arrives on the client, it looks like this:
aParentSovItem1
---aChild1OfParent1
---aChild2OfParent1
---aChild1OfParent1
---aChild2OfParent1
aParentSovItem2
---aChild3ofParent2
---aChild4ofParent2
---aChild3ofParent2
---aChild4ofParent2
No clue how to solve this.