How to access and work with XML from API in C #

My goal is to pull the XML data from the API and load it into the sql server database. The first step I'm trying to do is access and display the data. As soon as I get this to work, I go through each row and paste the values ​​into the sql server database. When I try to run the code below nothing happens and when I paste the url directly into the browser I get this error

"2010-03-08 04:24:17 Wallet exhausted: retry after 2010-03-08 05:23:58. 2010-03-08 05:23:58"

It seems to me that each iteration of the foreach loop causes a call to the site, and I get a lock for an hour. Am I incorrectly retrieving data from an API? Is there a way to load data into memory or an array and then skip this?

Here's a bit of code that I hacked.

using System;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using System.Data;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string userID = "123";
            string apiKey = "abc456";
            string characterID = "789";
            string url = "http://api.eve-online.com/char/WalletTransactions.xml.aspx?userID=" + userID + "&apiKey=" + apiKey + "&characterID=" + characterID;
            XmlDocument xmldoc = new XmlDocument();
            xmldoc.Load(url);
            XmlNamespaceManager xnm1 = new XmlNamespaceManager(xmldoc.NameTable);
            XmlNodeList nList1 = xmldoc.SelectNodes("result/rowset/row", xnm1);
            foreach (XmlNode xNode in nList1)
            {
                Response.Write(xNode.InnerXml + "<br />");
            }
        }

        catch (SqlException em)
        {
            Response.Write(em.Message);
        }
    }
}

Here is the xml sample

<eveapi version="2"> 
  <currentTime>2010-03-06 17:38:35</currentTime> 
  <result> 
    <rowset name="transactions" key="transactionID" columns="transactionDateTime,transactionID,quantity,typeName,typeID,price,clientID,clientName,stationID,stationName,transactionType,transactionFor"> 
      <row transactionDateTime="2010-03-06 17:16:00" transactionID="1343566007" quantity="1" typeName="Co-Processor II" typeID="3888" price="1122999.00" clientID="1404318579" clientName="unseenstrike" stationID="60011572" stationName="Osmeden IX - Moon 6 - University of Caille School" transactionType="sell" transactionFor="personal" /> 
      <row transactionDateTime="2010-03-06 17:15:00" transactionID="1343565894" quantity="1" typeName="Co-Processor II" typeID="3888" price="1150000.00" clientID="1404318579" clientName="unseenstrike" stationID="60011572" stationName="Osmeden IX - Moon 6 - University of Caille School" transactionType="sell" transactionFor="personal" /> 
    </rowset> 
  </result> 
  <cachedUntil>2010-03-06 17:53:35</cachedUntil> 
</eveapi>
+5
2

(google) , EVE API, . IP, , . , - . 1 ...

+4

@Jarek   xml -, ... /Users/thisusersid/mycustomfile _02102011.xml, , , , , . eveapi , / .

+1

All Articles