• Welcome to KonaKart Community Forum. Please login or sign up.
 

getPromotions() not returning any promotions

Started by anstuff, July 12, 2010, 05:14:24 pm

Previous topic - Next topic

anstuff

I am using admin web service to retrieve promotions which matches my specified criteria.  Here under is my unit test;
        String sessionId = long(DEFAULT_USERNAME,DEFAULT_PASSWORD);
        AdminPromotionSearch adminPromoSearch = new AdminPromotionSearch();               
        adminPromoSearch.setActive(Boolean.TRUE);
        adminPromoSearch.setCumulative(Boolean.FALSE);
        adminPromoSearch.setRequiresCoupon(Boolean.TRUE);
        Calendar startDate = new GregorianCalendar(2010, 06, 01);
        adminPromoSearch.setStartDate(startDate);
        Calendar endDate = new GregorianCalendar(2011, 06, 27);       
        adminPromoSearch.setEndDate(endDate); 
        adminPromoSearch.setOrderTotalCode("ot_product_discount");

        AdminPromotionSearchResult adminPromoSearchResult = kkClient.getPromotions(sessionId, adminPromoSearch, 0, 10);
        Assert.assertNotNull(adminPromoSearchResult);

I have promotions matching the above mentioned criteria in my app, yet adminPromoSearchResult is returned with empty promotions array and zero totalSetSize.

What am i missing?

anstuff

I get the result only when I specify the promotion Id.  But that is not the intended behavior, the call getPromotions should be giving me the result irrespective of setting the id value.  I am looking to get all active promotions available and search for a particular promotion to get its name and description for marketing purpose.

Seems like its a bug.  Could someone confirm/verify?

ming

A good way to investigate is to enable the db logging so that you can see the query that's being executed.  That could well provide your answer.

One thing to watch is to ensure you initialise all the attributes in your search object otherwise they may get values that you don't expect in your SOAP message.

anstuff

Thanks for the reply ming, it works for me now.  To get what i was looking for, all i had to do was to pass null as my search criteria.

maverick

Quotegood way to investigate is to enable the db logging so that you can see the query that's being executed.  That could well provide your answer.


Hey can you please tell me how to enable this db logging to see the queries that are being executed in the database.

Thanks
Maverick

anstuff

You should be able to set the log levels using konakart-logging.properties file.  Set the debug levels to trace or debug for com.konakart and torque.