BasketDTO basket = objectFactory.createBasketDTO();
basket.setToken(UUID.randomUUID().toString());
/*Reference shopRef = objectFactory.createReference();
shopRef.setId(shop.getId());
basket.setShop(shopRef);*/
HttpCallCommand command = factory.createJaxbHttpCallCommand(shop.getBaskets().getHref(), HttpMethod.POST, null);
command.setApiKeyProtected(true);
command.setInput(objectFactory.createBasket(basket));
command.execute();
log.info(command.getLocation());
log.info("" + command.getStatus());
log.info(command.getErrorMessage());
if (command.getStatus() != 201)
throw new IllegalArgumentException("Could not create Basket!");
log.info("Basket location is: " + command.getLocation());
return getBasket(command.getLocation().substring(command.getLocation().lastIndexOf("/") + 1));
}