Subversion Repositories SmartDukaan

Rev

Rev 9951 | Rev 9959 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9951 Rev 9958
Line 96... Line 96...
96
		calculateinventory();
96
		calculateinventory();
97
		DefaultHttpClient httpclient = new DefaultHttpClient();
97
		DefaultHttpClient httpclient = new DefaultHttpClient();
98
		httpclient = (DefaultHttpClient) WebClientWrapper.wrapClient(httpclient);
98
		httpclient = (DefaultHttpClient) WebClientWrapper.wrapClient(httpclient);
99
		httpclient.getCredentialsProvider().setCredentials(
99
		httpclient.getCredentialsProvider().setCredentials(
100
				new AuthScope("sandbox-api.flipkart.net", 443),
100
				new AuthScope("sandbox-api.flipkart.net", 443),
101
				new UsernamePasswordCredentials("og3yg5994bxbxxc1", "8a137068-417c-4e4f-ae95-9295ab938d88"));
101
				new UsernamePasswordCredentials("og3yg5994bxbxxc1", "8a137068-417c-4e4f-ae95-9295ab938d88"));/// Test Server Access Keys
102
		//httpclient.getCredentialsProvider().setCredentials(
102
		//httpclient.getCredentialsProvider().setCredentials(
103
		//		new AuthScope("sandbox-api.flipkart.net", 443),
103
		//		new AuthScope("sandbox-api.flipkart.net", 443),
104
		//		new UsernamePasswordCredentials("m2z93iskuj81qiid","0c7ab6a5-98c0-4cdc-8be3-72c591e0add4"));
104
		//		new UsernamePasswordCredentials("m2z93iskuj81qiid","0c7ab6a5-98c0-4cdc-8be3-72c591e0add4")); //Prod Server Access Keys
105
		HttpPost httppost = new HttpPost("https://sandbox-api.flipkart.net/sellers/skus/listings/bulk");
105
		HttpPost httppost = new HttpPost("https://sandbox-api.flipkart.net/sellers/skus/listings/bulk");
106
		StringBuffer jsonRequest = new StringBuffer();
106
		StringBuffer jsonRequest = new StringBuffer();
107
		jsonRequest.append("{\"listings\":[");
107
		jsonRequest.append("{\"listings\":[");
108
		//System.out.println("JSON request  " + jsonRequest);
108
		//System.out.println("JSON request  " + jsonRequest);
109
		LogisticsClient logisticsServiceClient;
109
		LogisticsClient logisticsServiceClient;
Line 187... Line 187...
187
				httppost.setEntity(input);
187
				httppost.setEntity(input);
188
				HttpResponse response = httpclient.execute(httppost);
188
				HttpResponse response = httpclient.execute(httppost);
189
				BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
189
				BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
190
				String line;
190
				String line;
191
				while ((line = rd.readLine()) != null) {
191
				while ((line = rd.readLine()) != null) {
192
					System.out.println(line);
192
					System.out.println("Response " + line);
193
				}
193
				}
194
			}
194
			}
195
		}
195
		}
196
	}
196
	}
197
	private static void calculateinventory(){
197
	private static void calculateinventory(){