bigcommerce/bigcommerce-api-java — Issue #1: The example in README not working
Author: akhillexity
Created: 2012-01-10 10:23:42+00:00
State: open

Hi,

I was trying to get the example working to work in groovy. I build a jar using the build.xml.
The snippet I used

import com.bigcommerce.api.*;

String storeUrl = "https://akhiltest.mybigcommerce.com"
String user = "xxx"
String apiKey = "xxx"

Store store = new Store(storeUrl, user, apiKey);

Collection products = store.getProducts();

for(product in products) {
System.out.println(product.getName());
System.out.println(product.getPrice());
}

The output i get is:

java.net.ConnectException: Connection refusedjava.lang.IllegalArgumentException: InputStream cannot be null
Exception thrown

java.lang.NullPointerException
at com.bigcommerce.api.Store.getProducts(Unknown Source)
at com.bigcommerce.api.Store$getProducts.call(Unknown Source)
at ConsoleScript4.run(ConsoleScript4:10)

// Line 10 corresponds to Collection products = store.getProducts();