SQL Server Woocommerce API connection gives NULL when getting products, works fine with ordersSQL Client for Mac OS X that works with MS SQL ServerGet list of databases from SQL ServerHow can I get column names from a table in SQL Server?OR is not supported with CASE Statement in SQL ServerSQL Server - inner join when updatingPosting to tumblr using API v2 on iOS returning errorUsing Magento REST APIAuthintication Error in Ionic WooCommerce using AngularWhen i try to authenticate oauth1 rest api returnse Invalide_signature errorwoocommerce get API for order products store name

GPLv3 forces us to make code available, but to who?

Sending mail to the Professor for PhD, after seeing his tweet

How dangerous is a very out-of-true disc brake wheel?

Why has Speaker Pelosi been so hesitant to impeach President Trump?

Confusion regarding control system of Mars Rover?

Caro-Kann c4-c5 push

SOQL injection vulnerability issue

Could Boris Johnson face criminal charges for illegally proroguing Parliament?

Is there a way to remove Smite from a weapon?

麦酒 (ばくしゅ) for "beer"

Why such a singular place for bird watching?

Citing CPLEX 12.9

How can Germany increase investments in Russia while EU economic sanctions against Russia are still in place?

Airport Security - advanced check, 4th amendment breach

Can I cast Death Ward on additional creatures without causing previous castings to end?

Is there an in-universe explanation of how Frodo's arrival in Valinor was recorded in the Red Book?

Can an untrusted VPN client monitor my network activity?

Did Joe Biden "stop a prosecution" into his son in Ukraine? And did he brag about stopping the prosecution?

Duck, duck, gone!

Would an object shot from earth fall into the sun?

Wondering why they used ultrafast diodes in a 50 or 60Hz bridge?

A word that refers to saying something in an attempt to anger or embarrass someone into doing something that they don’t want to do?

Could the Queen overturn the UK Supreme Court ruling regarding prorogation of Parliament?

Looking for circuit board material that can be dissolved



SQL Server Woocommerce API connection gives NULL when getting products, works fine with orders


SQL Client for Mac OS X that works with MS SQL ServerGet list of databases from SQL ServerHow can I get column names from a table in SQL Server?OR is not supported with CASE Statement in SQL ServerSQL Server - inner join when updatingPosting to tumblr using API v2 on iOS returning errorUsing Magento REST APIAuthintication Error in Ionic WooCommerce using AngularWhen i try to authenticate oauth1 rest api returnse Invalide_signature errorwoocommerce get API for order products store name






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









1















I am trying to set up a connection between a external SQL Server Database and the Woocommerce API.



The goal is to communicate between 2 websites, where they exchange data, the external website will send a POST request to Woocommerce to create a product, then GET the list of products to select the latest added one and then uses that product ID to create a add to cart link which will put the product into the Cart.



Now here is my code :



 DECLARE @contentType NVARCHAR(64);
DECLARE @ret INT;
DECLARE @responseText NVARCHAR(4000);
DECLARE @status NVARCHAR(32);
DECLARE @statusText NVARCHAR(32);
DECLARE @token INT;
DECLARE @url NVARCHAR(256);

SET @contentType = 'application/json';

set @url = 'https://mywebsite.com/wp-json/wc/v3/products/?consumer_key=mykey&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1458225139&oauth_nonce=nVq4rX&consumer_secret=mysecret&oauth_signature=kzoVx%20VYSWlLbRpi3f8222222%3D'


EXEC @ret = sp_OACreate 'WinHttp.WinHttpRequest.5.1', @token OUT;

EXEC @ret = sp_OAMethod @token, 'open', NULL, 'GET', @url, 'false';
EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Content-type', @contentType;
EXEC @ret = sp_OAMethod @token, 'send', NULL;

EXEC @ret = sp_OAGetProperty @token, 'status', @status OUT;
EXEC @ret = sp_OAGetProperty @token, 'statusText', @statusText OUT;
EXEC @ret = sp_OAGetProperty @token, 'responseText', @responseText OUT;

EXEC @ret = sp_OADestroy @token;

RETURN @responseText;


When i return the status i get 200, which to my knowledge is the desirable status.



But when i return responseText i get null.



The infuriating part is when i replace products with orders i get a result as expected, but when getting the products it keeps saying NULL.



Please help, because i am losing the last few hairs on my head.



Also my boss insists on doing it by SQL Server..










share|improve this question
































    1















    I am trying to set up a connection between a external SQL Server Database and the Woocommerce API.



    The goal is to communicate between 2 websites, where they exchange data, the external website will send a POST request to Woocommerce to create a product, then GET the list of products to select the latest added one and then uses that product ID to create a add to cart link which will put the product into the Cart.



    Now here is my code :



     DECLARE @contentType NVARCHAR(64);
    DECLARE @ret INT;
    DECLARE @responseText NVARCHAR(4000);
    DECLARE @status NVARCHAR(32);
    DECLARE @statusText NVARCHAR(32);
    DECLARE @token INT;
    DECLARE @url NVARCHAR(256);

    SET @contentType = 'application/json';

    set @url = 'https://mywebsite.com/wp-json/wc/v3/products/?consumer_key=mykey&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1458225139&oauth_nonce=nVq4rX&consumer_secret=mysecret&oauth_signature=kzoVx%20VYSWlLbRpi3f8222222%3D'


    EXEC @ret = sp_OACreate 'WinHttp.WinHttpRequest.5.1', @token OUT;

    EXEC @ret = sp_OAMethod @token, 'open', NULL, 'GET', @url, 'false';
    EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Content-type', @contentType;
    EXEC @ret = sp_OAMethod @token, 'send', NULL;

    EXEC @ret = sp_OAGetProperty @token, 'status', @status OUT;
    EXEC @ret = sp_OAGetProperty @token, 'statusText', @statusText OUT;
    EXEC @ret = sp_OAGetProperty @token, 'responseText', @responseText OUT;

    EXEC @ret = sp_OADestroy @token;

    RETURN @responseText;


    When i return the status i get 200, which to my knowledge is the desirable status.



    But when i return responseText i get null.



    The infuriating part is when i replace products with orders i get a result as expected, but when getting the products it keeps saying NULL.



    Please help, because i am losing the last few hairs on my head.



    Also my boss insists on doing it by SQL Server..










    share|improve this question




























      1












      1








      1








      I am trying to set up a connection between a external SQL Server Database and the Woocommerce API.



      The goal is to communicate between 2 websites, where they exchange data, the external website will send a POST request to Woocommerce to create a product, then GET the list of products to select the latest added one and then uses that product ID to create a add to cart link which will put the product into the Cart.



      Now here is my code :



       DECLARE @contentType NVARCHAR(64);
      DECLARE @ret INT;
      DECLARE @responseText NVARCHAR(4000);
      DECLARE @status NVARCHAR(32);
      DECLARE @statusText NVARCHAR(32);
      DECLARE @token INT;
      DECLARE @url NVARCHAR(256);

      SET @contentType = 'application/json';

      set @url = 'https://mywebsite.com/wp-json/wc/v3/products/?consumer_key=mykey&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1458225139&oauth_nonce=nVq4rX&consumer_secret=mysecret&oauth_signature=kzoVx%20VYSWlLbRpi3f8222222%3D'


      EXEC @ret = sp_OACreate 'WinHttp.WinHttpRequest.5.1', @token OUT;

      EXEC @ret = sp_OAMethod @token, 'open', NULL, 'GET', @url, 'false';
      EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Content-type', @contentType;
      EXEC @ret = sp_OAMethod @token, 'send', NULL;

      EXEC @ret = sp_OAGetProperty @token, 'status', @status OUT;
      EXEC @ret = sp_OAGetProperty @token, 'statusText', @statusText OUT;
      EXEC @ret = sp_OAGetProperty @token, 'responseText', @responseText OUT;

      EXEC @ret = sp_OADestroy @token;

      RETURN @responseText;


      When i return the status i get 200, which to my knowledge is the desirable status.



      But when i return responseText i get null.



      The infuriating part is when i replace products with orders i get a result as expected, but when getting the products it keeps saying NULL.



      Please help, because i am losing the last few hairs on my head.



      Also my boss insists on doing it by SQL Server..










      share|improve this question
















      I am trying to set up a connection between a external SQL Server Database and the Woocommerce API.



      The goal is to communicate between 2 websites, where they exchange data, the external website will send a POST request to Woocommerce to create a product, then GET the list of products to select the latest added one and then uses that product ID to create a add to cart link which will put the product into the Cart.



      Now here is my code :



       DECLARE @contentType NVARCHAR(64);
      DECLARE @ret INT;
      DECLARE @responseText NVARCHAR(4000);
      DECLARE @status NVARCHAR(32);
      DECLARE @statusText NVARCHAR(32);
      DECLARE @token INT;
      DECLARE @url NVARCHAR(256);

      SET @contentType = 'application/json';

      set @url = 'https://mywebsite.com/wp-json/wc/v3/products/?consumer_key=mykey&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1458225139&oauth_nonce=nVq4rX&consumer_secret=mysecret&oauth_signature=kzoVx%20VYSWlLbRpi3f8222222%3D'


      EXEC @ret = sp_OACreate 'WinHttp.WinHttpRequest.5.1', @token OUT;

      EXEC @ret = sp_OAMethod @token, 'open', NULL, 'GET', @url, 'false';
      EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Content-type', @contentType;
      EXEC @ret = sp_OAMethod @token, 'send', NULL;

      EXEC @ret = sp_OAGetProperty @token, 'status', @status OUT;
      EXEC @ret = sp_OAGetProperty @token, 'statusText', @statusText OUT;
      EXEC @ret = sp_OAGetProperty @token, 'responseText', @responseText OUT;

      EXEC @ret = sp_OADestroy @token;

      RETURN @responseText;


      When i return the status i get 200, which to my knowledge is the desirable status.



      But when i return responseText i get null.



      The infuriating part is when i replace products with orders i get a result as expected, but when getting the products it keeps saying NULL.



      Please help, because i am losing the last few hairs on my head.



      Also my boss insists on doing it by SQL Server..







      sql-server api woocommerce






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 30 at 7:51









      marc_s

      605k137 gold badges1159 silver badges1292 bronze badges




      605k137 gold badges1159 silver badges1292 bronze badges










      asked Mar 28 at 20:53









      Handler03Handler03

      61 bronze badge




      61 bronze badge

























          0






          active

          oldest

          votes













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );














          draft saved

          draft discarded
















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406687%2fsql-server-woocommerce-api-connection-gives-null-when-getting-products-works-fi%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid …


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406687%2fsql-server-woocommerce-api-connection-gives-null-when-getting-products-works-fi%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

          Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?