J
James Q
Hello,
I have tried to define my Web Service's method so, that client could use
ArrayList insted of ordinary Arrays ( [ ] ). I haven't resolved how to do
it.
In serverside it's easy yo use ArrayList, but not in client side.
How should I define those XML tags into my classes
that code like below would work using ArrayList in Client side?
Environment is VS.NET 2003
C# Code
{
[XmlElement(ElementName="Elements", Type=typeof(Element))]
public ArrayList XElements
{
get
{
return Elements;
}
set
{
Elements = value;
}
}
}
/**
* Element information.
**/
public class Element
{
......
// XML
<Header>
...
</Header>
<Elements>
<Element>
<Field1> 1 </Field1>
<Field2> 2 </Field2>
<Field3> 3 </Field3>
<Field4> 4 </Field4>
</Element>
<Element>
<Field1> 1 </Field1>
<Field2> 2 </Field2>
<Field3> 3 </Field3>
<Field4> 4 </Field4>
</Element>
<Element>
<Field1> 1 </Field1>
<Field2> 2 </Field2>
<Field3> 3 </Field3>
<Field4> 4 </Field4>
</Element>
<Element>
<Field1> 1 </Field1>
<Field2> 2 </Field2>
<Field3> 3 </Field3>
<Field4> 4 </Field4>
</Element>
</Elements>
<Footer>
...
</Footer>
<Cheers/>
I have tried to define my Web Service's method so, that client could use
ArrayList insted of ordinary Arrays ( [ ] ). I haven't resolved how to do
it.
In serverside it's easy yo use ArrayList, but not in client side.
How should I define those XML tags into my classes
that code like below would work using ArrayList in Client side?
Environment is VS.NET 2003
C# Code
{
[XmlElement(ElementName="Elements", Type=typeof(Element))]
public ArrayList XElements
{
get
{
return Elements;
}
set
{
Elements = value;
}
}
}
/**
* Element information.
**/
public class Element
{
......
// XML
<Header>
...
</Header>
<Elements>
<Element>
<Field1> 1 </Field1>
<Field2> 2 </Field2>
<Field3> 3 </Field3>
<Field4> 4 </Field4>
</Element>
<Element>
<Field1> 1 </Field1>
<Field2> 2 </Field2>
<Field3> 3 </Field3>
<Field4> 4 </Field4>
</Element>
<Element>
<Field1> 1 </Field1>
<Field2> 2 </Field2>
<Field3> 3 </Field3>
<Field4> 4 </Field4>
</Element>
<Element>
<Field1> 1 </Field1>
<Field2> 2 </Field2>
<Field3> 3 </Field3>
<Field4> 4 </Field4>
</Element>
</Elements>
<Footer>
...
</Footer>
<Cheers/>