| Line 160... |
Line 160... |
| 160 |
}
|
160 |
}
|
| 161 |
|
161 |
|
| 162 |
public static void main(String[] args) throws ClientProtocolException, TException{
|
162 |
public static void main(String[] args) throws ClientProtocolException, TException{
|
| 163 |
calculateinventory();
|
163 |
calculateinventory();
|
| 164 |
DefaultHttpClient httpclient = new DefaultHttpClient();
|
164 |
DefaultHttpClient httpclient = new DefaultHttpClient();
|
| 165 |
httpclient = (DefaultHttpClient) WebClientWrapper.wrapClient(httpclient);
|
165 |
//httpclient = (DefaultHttpClient) WebClientWrapper.wrapClient(httpclient);
|
| 166 |
//httpclient.getCredentialsProvider().setCredentials(
|
166 |
//httpclient.getCredentialsProvider().setCredentials(
|
| 167 |
// new AuthScope("sandbox-api.flipkart.net", 443),
|
167 |
// new AuthScope("sandbox-api.flipkart.net", 443),
|
| 168 |
// new UsernamePasswordCredentials("og3yg5994bxbxxc1", "8a137068-417c-4e4f-ae95-9295ab938d88"));/// Test Server Access Keys
|
168 |
// new UsernamePasswordCredentials("og3yg5994bxbxxc1", "8a137068-417c-4e4f-ae95-9295ab938d88"));/// Test Server Access Keys
|
| 169 |
httpclient.getCredentialsProvider().setCredentials(
|
169 |
//httpclient.getCredentialsProvider().setCredentials(
|
| 170 |
new AuthScope("api.flipkart.net", 443),
|
170 |
// new AuthScope("api.flipkart.net", 443),
|
| 171 |
new UsernamePasswordCredentials("m2z93iskuj81qiid","0c7ab6a5-98c0-4cdc-8be3-72c591e0add4")); //Prod Server Access Keys
|
171 |
// new UsernamePasswordCredentials("m2z93iskuj81qiid","0c7ab6a5-98c0-4cdc-8be3-72c591e0add4")); //Prod Server Access Keys
|
| 172 |
HttpPost httppost = new HttpPost("https://api.flipkart.net/sellers/skus/listings/bulk"); // PROD
|
172 |
HttpPost httppost = new HttpPost("https://api.flipkart.net/sellers/skus/listings/bulk"); // PROD
|
| - |
|
173 |
httppost.addHeader("m2z93iskuj81qiid","0c7ab6a5-98c0-4cdc-8be3-72c591e0add4");
|
| 173 |
//HttpPost httppost = new HttpPost("https://sandbox-api.flipkart.net/sellers/skus/listings/bulk"); // TEST
|
174 |
//HttpPost httppost = new HttpPost("https://sandbox-api.flipkart.net/sellers/skus/listings/bulk"); // TEST
|
| 174 |
StringBuffer jsonRequest = new StringBuffer();
|
175 |
StringBuffer jsonRequest = new StringBuffer();
|
| 175 |
StringBuffer jsonStart = new StringBuffer();
|
176 |
StringBuffer jsonStart = new StringBuffer();
|
| 176 |
jsonStart = jsonStart.append("{\"listings\":[");
|
177 |
jsonStart = jsonStart.append("{\"listings\":[");
|
| 177 |
StringBuffer jsonEnd = new StringBuffer();
|
178 |
StringBuffer jsonEnd = new StringBuffer();
|