Package net.sprd.sampleapps.common.http

Examples of net.sprd.sampleapps.common.http.HttpCallCommand.execute()


        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!");
View Full Code Here


    }

    public BasketDTO getBasket(String basketId) {
        HttpCallCommand command = factory.createJaxbHttpCallCommand(shop.getBaskets().getHref() + "/" + basketId, HttpMethod.GET, null);
        command.setApiKeyProtected(true);
        command.execute();
        if (command.getStatus() != 200)
            throw new IllegalArgumentException("Could not retrieve basket!");

        return (BasketDTO) ((JAXBElement) command.getOutput()).getValue();
    }
View Full Code Here

    public void updateBasket(BasketDTO basket) {
        HttpCallCommand command = factory.createJaxbHttpCallCommand(shop.getBaskets().getHref() + "/" + basket.getId(), HttpMethod.PUT, null);
        command.setApiKeyProtected(true);
        command.setInput(objectFactory.createBasket(basket));
        command.execute();
        if (command.getStatus() != 200)
            throw new IllegalArgumentException("Could not create Basket!");
    }

    public String getBasketCheckoutUrl(String id) {
View Full Code Here

    public String getBasketCheckoutUrl(String id) {
        HttpCallCommand command =
                factory.createJaxbHttpCallCommand(shop.getBaskets().getHref() + "/" + id + "/checkout", HttpMethod.GET, null);
        command.setApiKeyProtected(true);
        command.execute();
        if (command.getStatus() != 200)
            throw new IllegalArgumentException("Could not retrieve checkout reference!");

        Reference reference = (Reference) ((JAXBElement) command.getOutput()).getValue();
        return reference.getHref();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.