Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7640831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:46:07+00:00 2026-05-31T08:46:07+00:00

I have been trying to create an application to go through our database at

  • 0

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

    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);

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.

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.

Thank you in advance for any assistance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:46:09+00:00Added an answer on May 31, 2026 at 8:46 am

    I actually ended up figuring this out after playing around with it. Here is what I did to get the reference to work. This may have been easy for anyone who have used the references before but I have not and have decided to post this in case anyone else has this problem. The SQL can be SELECT, ADD, UPDATE and DELETE statements this was to see if the sku was listed before updating/adding.

                //Will be using these multiple times so a variable makes more sense
                // DO NOT include http:// in the url, also id is not shown in their
                //database layout pdf they will give but it is the sku/product number
                string sqlStatement = "SELECT id FROM products WHERE id = '" + Convert.ToString(reader.GetValue(0)) + "')))";
                string userKey = "YourKeyHere";
                string storeUrl = "YourStoresURLHere";
    
                // Setting up instances from the 3DCart API
                cartAPIAdvancedSoapClient bcsClient = new cartAPIAdvancedSoapClient();
                runQueryRequest bcsRequest = new runQueryRequest();
                runQueryResponse bcsResponse = new runQueryResponse();
                runQueryResponseBody bcsRespBod = new runQueryResponseBody();
                runQueryRequestBody bcsReqBod = new runQueryRequestBody();
    
                //assigning required variables to the requests body
                bcsReqBod.storeUrl = storeUrl;
                bcsReqBod.sqlStatement = sqlStatement;
                bcsReqBod.userKey = userKey;
    
                //assigning the body to the request
                bcsRequest.Body = bcsReqBod;
    
                //Setting the response body to be the result
                bcsRespBod.runQueryResult = bcsClient.runQuery(bcsReqBod.storeUrl, bcsReqBod.userKey, bcsReqBod.sqlStatement, bcsReqBod.callBackURL );
                bcsResponse.Body = bcsRespBod;
    
                //adding the result to a string
                string result = bcsResponse.Body.runQueryResult.Value;
    
                //displaying the string, this for me was more of a test
                listBox1.Items.Add(result);
    

    You will also need to activate the Advanced API on your shop as you may notice there is no actual option as the pdf’s say, you need to go to their store and purchase(its free) and wait for them to activate it. This took about 2 hrs for us.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to create a new google custom search engine, but when
I have been reading through Intuit's new IPP Federated App documentation. I am trying
I have been trying to create a Ruby program that will be running online
I have been trying to create a menu panel with jQuery that can be
I have been trying to create a simple program with Python which uses OpenCV
I have been trying to find a good guide to create a templated control.
I have been trying to work my way through Project Euler, and have noticed
I have been trying to create a web service out some python scripts, and
I have been going back through my app trying to handle all the memory
I have been trying to build a modular web application. My requirements are to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.