I am using XMLTextWriter to create XML. Can someone tell me how to send this to a webservice being hosted by someone else?
Lets say my Webservice was with an exposed method of importLead
THANKS!
Lets say my Webservice was with an exposed method of importLead
THANKS!
Code:
XmlTextWriter writer = new XmlTextWriter(/*Response.OutputStream*/ Server.MapPath("myleads.xml"), Encoding.UTF8);
writer.WriteStartDocument();
writer.WriteStartElement("Lead_list");
while (mdr.Read())
{
//mdr.GetString(0); UniqueID
//mdr.GetString(1); Vendor
//mdr.GetString(2); FirstName
//mdr.GetString(3); LastName
//mdr.GetString(4); Address1
//mdr.GetString(5); Address2
//mdr.GetString(6); City
//mdr.GetString(7); State
//mdr.GetString(8); ZipCode
//mdr.GetString(9); PrimaryPhone
//mdr.GetString(10); SecondaryPhone
//mdr.GetString(11); Email
//mdr.GetString(11); Notes
writer.WriteStartElement("Lead");
writer.WriteElementString("Vendor", mdr.GetString(1));
writer.WriteElementString("UniqueID", mdr.GetString(0));
writer.WriteElementString("FirstName", mdr.GetString(2));
writer.WriteElementString("LastName", mdr.GetString(3));
writer.WriteElementString("Address1", mdr.GetString(4));
writer.WriteElementString("Address2", mdr.GetString(5));
writer.WriteElementString("City", mdr.GetString(6));
writer.WriteElementString("State", mdr.GetString(7));
writer.WriteElementString("ZipCode", mdr.GetString(8));
writer.WriteElementString("PrimaryPhone", mdr.GetString(9));
writer.WriteElementString("SecondaryPhone", mdr.GetString(10));
writer.WriteElementString("Email", mdr.GetString(11));
writer.WriteElementString("Notes", mdr.GetString(12));
writer.WriteEndElement();
}
writer.WriteEndElement();
writer.WriteEndDocument();
writer.Close();