I am trying to add element name to my web service out.
right now it looks like this.
I wanted to customize to look something like this
<Firstname>Firstname>
<Lastname>Lastname>
<Address>Address>
This is what I got some far.
[WebMethod]
public ArrayList RetrieveCustomerInfo(string email, string pass, int customerID)
{
ArrayList List = new ArrayList();
PURLDataContext purl = new PURLDataContext();
var customer = from c in purl.Sel_UserRecipients(email, pass, customerID)
select new
{
FName = c.FirstName.Trim(),
LName = c.LastName.Trim(),
Address = c.Address.Trim(),
City = c.City.Trim(),
StateCode = c.StateCode.Trim(),
Zip = c.Zip.Trim(),
Email = c.Email.Trim(),
Phone = c.Phone.Trim(),
CellPhone = c.CellPhone.Trim(),
Additional1 = c.Additional1.Trim(),
Additional2 = c.Additional2.Trim(),
CustomerStatus = c.RecipientStatus.Trim(),
SourceCode = c.SourceCode.Trim()
};
foreach (var c in customer)
{
FName = c.FName;
LName = c.LName;
Address = c.Address;
City = c.City;
Email = c.Email;
}
List.Add(Address);
List.Add(City);
List.Add(StateCode);
List.Add(Zip);
List.Add(Email);
List.Add(Phone);
return List;
}
I appreciate any help.
Pradeep ChandrakerPosted Jun 14, 2011, 11:09 AM
If you are expecting multiple customer information to be returned you should return list of class, something like this:
public List
Let me know if you have any question on this.