ajayz15 / magja

Automatically exported from code.google.com/p/magja
1 stars 0 forks source link

org.apache.axis2.AxisFault: One item of products do not have identifier or sku #58

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Code in Main: 
CartRemoteService service = RemoteServiceFactory.getCartRemoteService();

        CustomerRemoteService  customerService = RemoteServiceFactory.getCustomerRemoteService();

        CustomerAddressRemoteService customerAddressService = RemoteServiceFactory.getCustomerAddressRemoteService();

        try {
            System.out.println("Creating customer");
            Customer customer = generateCustomer();
            customerService.save(customer);

            CustomerAddress shipAddr = generateAddress();
            CustomerAddress billAddr = generateAddress();
            shipAddr.setCustomer(customer);
            shipAddr.setDefaultBilling(false);
            shipAddr.setDefaultShipping(true);
            billAddr.setCustomer(customer);
            billAddr.setDefaultBilling(true);
            billAddr.setDefaultShipping(false);

            System.out.println("Creating default ship addr");
            customerAddressService.save(shipAddr);
            System.out.println("Creating default bill addr");
            customerAddressService.save(billAddr);

            System.out.println("Creating cart");
            Cart cart = service.create(0);
            System.out.println("Created cart " + cart);

            System.out.println("Setting customer");
            cart.setCustomer(customer);
            service.setCustomer(cart);

            System.out.println("Adding product");
            Product p =RemoteServiceFactory.getProductRemoteService().getBySku("A383100");

            //p.setSku("A383100");      //FIXME
            //p.setId(469);            //FIXME
            System.out.println(p.getId() +" ************** "+p.getSku());
            service.addProduct(cart, p, 1);

            System.out.println("Setting cart addresses");
            System.err.println(shipAddr.getAllProperties());
            CartAddress cartShipAddr = CartAddress.fromAttributes(shipAddr.getAllProperties());
            CartAddress cartBillAddr = CartAddress.fromAttributes(billAddr.getAllProperties());
            cart.setBillingaddress(cartBillAddr);
            cart.setShippingAddress(cartShipAddr);
            service.setAddresses(cart);

            System.out.println("Creating order");
            service.order(cart);
        } catch (ServiceException e) {
            e.printStackTrace();
        }

What is the expected output? What do you see instead?
IT should create an order 

What version of the product are you using? On what operating system?
latest Version

Please provide any additional information below.

Original issue reported on code.google.com by nazakatq...@gmail.com on 1 Oct 2012 at 2:18

Attachments:

GoogleCodeExporter commented 9 years ago
you can see the SKU and product ID in the out put 

Original comment by nazakatq...@gmail.com on 1 Oct 2012 at 2:18

GoogleCodeExporter commented 9 years ago
I will be really thankful if some one come up with nice suggestion

Original comment by nazakatq...@gmail.com on 1 Oct 2012 at 2:19

GoogleCodeExporter commented 9 years ago
is there is any one :(

Original comment by nazakatq...@gmail.com on 3 Oct 2012 at 8:27