Subversion Repositories SmartDukaan

Rev

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

Rev 13854 Rev 13855
Line 62... Line 62...
62
		updatePriceOnSnapdeal.start();	
62
		updatePriceOnSnapdeal.start();	
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
		HttpPost post = new HttpPost("http://seller.snapdeal.com/pricing/update");
67
		HttpPost post = new HttpPost("http://seller.snapdeal.com/pricing/update?changedField=sellingPrice&changedValue="+price+"&supc="+supc);
68
		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
68
		/*List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
69
		nameValuePairs.add(new BasicNameValuePair("changedField",
69
		nameValuePairs.add(new BasicNameValuePair("changedField",
70
                "sellingPrice"));
70
                "sellingPrice"));
71
		nameValuePairs.add(new BasicNameValuePair("changedValue",
71
		nameValuePairs.add(new BasicNameValuePair("changedValue",
72
				String.valueOf(price.intValue())));
72
				String.valueOf(price.intValue())));
73
		nameValuePairs.add(new BasicNameValuePair("id",
73
		nameValuePairs.add(new BasicNameValuePair("id",
74
				supc));
74
				supc));
75
		nameValuePairs.add(new BasicNameValuePair("oper","edit"));
75
		nameValuePairs.add(new BasicNameValuePair("oper","edit"));
76
		post.setEntity(new UrlEncodedFormEntity(nameValuePairs,"utf-8"));
76
		post.setEntity(new UrlEncodedFormEntity(nameValuePairs,"utf-8"));*/
77
		HttpResponse response = httpClient.execute(post);
77
		HttpResponse response = httpClient.execute(post);
78
		BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
78
		BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
79
		String line = "";
79
		String line = "";
80
		while ((line = rd.readLine()) != null) {
80
		while ((line = rd.readLine()) != null) {
81
			System.out.println(line);
81
			System.out.println(line);