VanillaSoft sends contact information as web leads using XML, a structured format that organizes the data. This guide will help you understand how to receive and process these leads effectively.
Understanding the XML Structure
The XML data for outgoing web leads has a main node called Contact
. Within this node, there are sub-nodes for each piece of information, such as the contact's name, email, and phone number. These sub-nodes are named based on the “Outgoing Field Name” you set up in the VanillaSoft UI.
Receiving and Processing the XML Data
To handle the XML data, you need to set up an endpoint to receive it. The data is sent in the HTTP request body with a MIME type of text/xml
. Once you receive the data, you need to process it and respond appropriately.
Steps to Handle Outgoing Web Leads
-
Set Up the URL: Ensure VanillaSoft is configured to send the XML data to your specified URL. For detailed instructions on setting this up, refer to our Setting Up Outgoing Web Leads article.
-
Receive the XML Data: Your server needs to read the XML data from the HTTP request body.
-
Process the XML Data: Parse the XML data and store it in your database or system.
-
Send a Response: Return a “success” message to indicate that you received the data. If there is an error, send the error message in the response.
Example: ASP.NET Webpage to Receive and Process XML Data
Here is an example of how you can set up an ASP.NET webpage to handle the XML data from VanillaSoft:
using System; using System.Xml; namespace PMRExample { public class WebForm1 : System.Web.UI.Page { override protected void OnInit(EventArgs e) { try { // Load the XML into an XmlDocument XmlDocument xmlDoc = new XmlDocument(); // Read the XML from the HTTP POST request body xmlDoc.Load(new System.IO.StreamReader(Request.InputStream)); // Process the XML data and save it to your database // ... // Send the success response Response.Write("success"); } catch (Exception ex) { // Send the error response Response.Write(ex.ToString()); } } } }
Important Considerations
-
MIME Type: Ensure the XML is sent with the MIME type
text/xml
. -
Response Handling: Always respond with “success” to confirm receipt. If there is an error, include the error message in the response.
Handling outgoing web leads in VanillaSoft involves setting up an endpoint to receive and process XML data, and then responding appropriately. By following these steps and using the provided example, you can ensure efficient processing of your web leads.