title: Setting up 3DCart API with a C# App
body: <p>I have been trying to create an application to go through our database at a set interval and update/add any new items to 3DCarts database. Their code example uses soap in an xml file to send 1 request per call. So I need to to be able to generate the xml I need with the items information on the fly before sending it. I have done hardly anything with XML files like this and cannot figure out how to create the chunk of code I need and send it. One method that has been suggested is create a file but still executing has been a problem and would be very inefficient for a large number of items. Here is what I have so far</p>
  
  <pre><code>    sqlStatement = "SELECT * FROM products WHERE name = '" + Convert.ToString(reader.GetValue(0)) + "'";
              ServiceReferenceCart.cartAPIAdvancedSoapClient bcsClient = new ServiceReferenceCart.cartAPIAdvancedSoapClient();
              ServiceReferenceCart.runQueryResponse bcsResponse = new ServiceReferenceCart.runQueryResponse();
  
              bcsClient.runQuery(storeUrl, userKey, sqlStatement, callBackURL);
              string result = Convert.ToString(bcsResponse);
  
              listBox1.Items.Add(result);
  </code></pre>
  
  <p>EDIT: Changed from sample code block to current code block as I got a service reference setup finally. They provide no details though for using the functions in the reference. With this bcsResponse is just a blank, when I try adding .Body I have the same result but when I add .runQuery to the .Body I get a "Object reference not set to an instance of an object." error. As I have said I have not messed with service references before.</p>
  
  <p>I hope I have explained well enough I just really have not worked with this kind of stuff before and it has become extremely frustrating.</p>
  
  <p>Thank you in advance for any assistance.</p>