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

Problems with insertProduct

Started by David, October 22, 2007, 09:08:49 am

Previous topic - Next topic

David

Hi,
I have a problem when I try to insert a product on KonaKart. This is the error i've got:

Quotejava.rmi.RemoteException: The String parameter called description must be given a value. It cannot be set to null or be left empty.<br>Exception Stack Trace = <br>   at com.konakartadmin.bl.AdminBaseMgr.checkRequired(AdminBaseMgr.java:266)<br>   at com.konakartadmin.bl.AdminProductMgr.validateProduct(AdminProductMgr.java:661)<br>   at com.konakartadmin.bl.AdminProductMgr.insertProduct(AdminProductMgr.java:103)<br>   at com.konakartadmin.bl.KKAdmin.insertProduct(KKAdmin.java:2257)<br>   at com.konakartadmin.ws.KKWSAdminSoapBindingImpl.insertProduct(KKWSAdminSoapBindingImpl.java:1126)<br>   at .........


I think that I fill all descriptions of the product but I don't understand that error. This is a piece of my source code:

QuoteAdminProduct articulo = new AdminProduct();

      //Categorías
      AdminCategory[] categorias = new AdminCategory[numCategorias];
      
      AdminCategory cat = new AdminCategory();
      for(int i=0; i<numCategorias; ++i){
         cat = port.getCategory(((Number) idCategorias.get(i)).intValue(), false, 1);
         categorias=cat;
      }
      
      //categorias[0] = port.getCategory(5,false,1);
      articulo.setCategories(categorias);
      
      //Descripción
      AdminProductDescription[] desc = new AdminProductDescription[3];
      desc[0] = new AdminProductDescription();
      desc[0].setLanguageId(1);
      desc[0].setName((String) res.get(DESC_ARTICULO));
      desc[0].setDescription((String) res.get(OBSERVACIONES));
      desc[1] = new AdminProductDescription();
      desc[1].setLanguageId(2);
      desc[1].setName((String) res.get(DESC_ARTICULO));
      desc[1].setDescription((String) res.get(OBSERVACIONES));
      desc[2] = new AdminProductDescription();
      desc[2].setLanguageId(3);
      desc[2].setName((String) res.get(DESC_ARTICULO));
      desc[2].setDescription((String) res.get(OBSERVACIONES));
      articulo.setDescriptions(desc);
      articulo.setDescription((String) res.get(DESC_ARTICULO));


Regards

David

trevor

Hello David,

It does look like you have set description to null or an empty string. What I suggest is for you to run the example we provide in the zip package that you can download from http://www.konakart.com/apiexamplesfaq.php and see if that works for you.

Regards,

Trevor

David

ups, you are right. I forgot checking that.

Thanks for your response

ReLLiK75

I'm dynamically creating products and having this same error.  It's obviously something wrong with my code.  Because I'm dynamically creating products based on an integration with a 3rd party system, I'm finding that some of the required fields just simply don't apply/are not needed for the type of products I'm needing to insert into the KK database.  Is there anyway to disable the "required" fields and only set a few parameters  like name, description, and price? 

Thanks!
Wayne