Subversion Repositories SmartDukaan

Rev

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

Rev 13857 Rev 13858
Line 63... Line 63...
63
 
63
 
64
	}
64
	}
65
	int updatePricing(Float price,String supc,Item item,Long timestamp) throws ClientProtocolException, IOException{
65
	int updatePricing(Float price,String supc,Item item,Long timestamp) throws ClientProtocolException, IOException{
66
		logger.info("Calling Update Snapdeal Price Constructor --" + " Price :" +price + " Supc :"+supc +" Item ID:" +item.getId());
66
		logger.info("Calling Update Snapdeal Price Constructor --" + " Price :" +price + " Supc :"+supc +" Item ID:" +item.getId());
67
		long priceVal = (long)price.floatValue();
67
		long priceVal = (long)price.floatValue();
68
		HttpPost post = new HttpPost("http://seller.snapdeal.com/pricing/update?changedField=sellingPrice&changedValue="+priceVal+"&supc=SDL917449142");
68
		HttpPost post = new HttpPost("http://seller.snapdeal.com/pricing/update");
69
		/*List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
69
		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
70
		nameValuePairs.add(new BasicNameValuePair("changedField",
70
		nameValuePairs.add(new BasicNameValuePair("changedField",
71
                "sellingPrice"));
71
                "sellingPrice"));
72
		nameValuePairs.add(new BasicNameValuePair("changedValue",
72
		nameValuePairs.add(new BasicNameValuePair("changedValue",
73
				String.valueOf(price.intValue())));
73
				priceVal+""));
74
		nameValuePairs.add(new BasicNameValuePair("id",
74
		nameValuePairs.add(new BasicNameValuePair("supc",
75
				supc));
75
				supc));
76
		nameValuePairs.add(new BasicNameValuePair("oper","edit"));
-
 
77
		post.setEntity(new UrlEncodedFormEntity(nameValuePairs,"utf-8"));*/
76
		post.setEntity(new UrlEncodedFormEntity(nameValuePairs,"utf-8"));
78
		HttpResponse response = httpClient.execute(post);
77
		HttpResponse response = httpClient.execute(post);
79
		BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
78
		BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
80
		String line = "";
79
		String line = "";
81
		while ((line = rd.readLine()) != null) {
80
		while ((line = rd.readLine()) != null) {
82
			logger.info(line);
81
			logger.info(line);