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

Listing and searching customers using admin web services API

Started by impiastro, December 09, 2009, 10:01:54 am

Previous topic - Next topic

impiastro

I'm using getCustomersCount and getCustomers of the admin api using web services.

I did some tries but the only I can retrieve customers is using the customer id in the AdminCustomerSearch object.
I tried:


  • only type id

  • only first name

  • only non registered customers



But everytime the total count returned by getCustomersCount is 0.
I can find a customer only using the direct id the of customer.

Maybe the AdminCustomerSearch needs special values set or it's a strange behaviour of these calls?

I can post my complete code and my customer's table data if needed.


heidi

Are you using the KKWSAdmin engine implementation or are you using stubs that you've generated yourself?

If you're using generated stubs you'll probably have to set some initial values in the search objects that you may not have set already.

Look at the javadoc for the search objects... you'll find out what you need to set in there.

impiastro

I'm using the generated stubs from the java ant target inside the custom directory, using the WSDL2Java Axis emitter.

I created an AdminCustomerSearch populating it only with setType(0), asking for all simple customers.

I read the documentation at: http://www.konakart.com/javadoc/admin/com/konakartadmin/app/AdminCustomerSearch.html
but I cannot found any initialization code needed... something I'm missing?

heidi

In the documentation whose link you posted you will find a number of ID fields that may need to be set to KonakartAdminConstants.NOT_SET..  Maybe this is the problem?

By the way, if you can use the KKWSAdmin engine you should probably should do as it's far easier.   This way you can write your code against the KKAdminIf interface and then switch engines (between the direct POJO engine (KKAdmin) and the web services engine (KKWSAdmin) at any time (runtime).   You also don't need to bother with generating all those stubs.   The same is true for the application engine...

impiastro

You were right heidi, I was searching inside the setters and getters javadoc but not inside the fields javadoc.

I set all "KonakartAdminConstants.NOT_SET" with NOT_SET except for type, because I need only simple customers, and I can list all the customers.

Thank you for your suggest!