Shaping XML......renaming return array value

A

av

This is my web method :

[WebMethod()]
[return:XmlArray("Employees")]
[return:XmlArrayItem("Employee")]
public CEmployee[] GetEmployees()
{
CEmployeeDA objEmployeeDA = new CEmployeeDA();
return objEmployeeDA.GetEmployees();
............
}

Please note, in the above code I have referenced the appropriate
namespace that has CEmployee.


This is the output I am getting :

<?xml version="1.0" encoding="utf-8" ?>
- <ArrayOfCEmployee xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://localhost/PAA1WS/Services">
- <CEmployee>
<FirstName>THOMAS</FirstName>
<LastName>KMICK</LastName>
<BirtDate>1/1/0001</BirtDate>
<EmployeeID>1434</EmployeeID>


What can I do to get the "Employees" instead of "ArrayOfCLASSNAME" and
"Employee" in place of "<CLASSNAME>" in the generated XML.

Hope to hear back from you.
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top