001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.shopping.service.http;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    
020    import com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil;
021    
022    import java.rmi.RemoteException;
023    
024    /**
025     * Provides the SOAP utility for the
026     * {@link com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil} service utility. The
027     * static methods of this class calls the same methods of the service utility.
028     * However, the signatures are different because it is difficult for SOAP to
029     * support certain types.
030     *
031     * <p>
032     * ServiceBuilder follows certain rules in translating the methods. For example,
033     * if the method in the service utility returns a {@link java.util.List}, that
034     * is translated to an array of {@link com.liferay.portlet.shopping.model.ShoppingCouponSoap}.
035     * If the method in the service utility returns a
036     * {@link com.liferay.portlet.shopping.model.ShoppingCoupon}, that is translated to a
037     * {@link com.liferay.portlet.shopping.model.ShoppingCouponSoap}. Methods that SOAP cannot
038     * safely wire are skipped.
039     * </p>
040     *
041     * <p>
042     * The benefits of using the SOAP utility is that it is cross platform
043     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
044     * even Perl, to call the generated services. One drawback of SOAP is that it is
045     * slow because it needs to serialize all calls into a text format (XML).
046     * </p>
047     *
048     * <p>
049     * You can see a list of services at http://localhost:8080/api/axis. Set the
050     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
051     * security.
052     * </p>
053     *
054     * <p>
055     * The SOAP utility is only generated for remote services.
056     * </p>
057     *
058     * @author Brian Wing Shun Chan
059     * @see ShoppingCouponServiceHttp
060     * @see com.liferay.portlet.shopping.model.ShoppingCouponSoap
061     * @see com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil
062     * @generated
063     */
064    public class ShoppingCouponServiceSoap {
065            public static com.liferay.portlet.shopping.model.ShoppingCouponSoap addCoupon(
066                    java.lang.String code, boolean autoCode, java.lang.String name,
067                    java.lang.String description, int startDateMonth, int startDateDay,
068                    int startDateYear, int startDateHour, int startDateMinute,
069                    int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
070                    int endDateMinute, boolean neverExpire, boolean active,
071                    java.lang.String limitCategories, java.lang.String limitSkus,
072                    double minOrder, double discount, java.lang.String discountType,
073                    com.liferay.portal.service.ServiceContext serviceContext)
074                    throws RemoteException {
075                    try {
076                            com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.addCoupon(code,
077                                            autoCode, name, description, startDateMonth, startDateDay,
078                                            startDateYear, startDateHour, startDateMinute,
079                                            endDateMonth, endDateDay, endDateYear, endDateHour,
080                                            endDateMinute, neverExpire, active, limitCategories,
081                                            limitSkus, minOrder, discount, discountType, serviceContext);
082    
083                            return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(returnValue);
084                    }
085                    catch (Exception e) {
086                            _log.error(e, e);
087    
088                            throw new RemoteException(e.getMessage());
089                    }
090            }
091    
092            public static void deleteCoupon(long groupId, long couponId)
093                    throws RemoteException {
094                    try {
095                            ShoppingCouponServiceUtil.deleteCoupon(groupId, couponId);
096                    }
097                    catch (Exception e) {
098                            _log.error(e, e);
099    
100                            throw new RemoteException(e.getMessage());
101                    }
102            }
103    
104            public static com.liferay.portlet.shopping.model.ShoppingCouponSoap getCoupon(
105                    long groupId, long couponId) throws RemoteException {
106                    try {
107                            com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.getCoupon(groupId,
108                                            couponId);
109    
110                            return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(returnValue);
111                    }
112                    catch (Exception e) {
113                            _log.error(e, e);
114    
115                            throw new RemoteException(e.getMessage());
116                    }
117            }
118    
119            public static com.liferay.portlet.shopping.model.ShoppingCouponSoap[] search(
120                    long groupId, long companyId, java.lang.String code, boolean active,
121                    java.lang.String discountType, boolean andOperator, int start, int end)
122                    throws RemoteException {
123                    try {
124                            java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> returnValue =
125                                    ShoppingCouponServiceUtil.search(groupId, companyId, code,
126                                            active, discountType, andOperator, start, end);
127    
128                            return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModels(returnValue);
129                    }
130                    catch (Exception e) {
131                            _log.error(e, e);
132    
133                            throw new RemoteException(e.getMessage());
134                    }
135            }
136    
137            public static com.liferay.portlet.shopping.model.ShoppingCouponSoap updateCoupon(
138                    long couponId, java.lang.String name, java.lang.String description,
139                    int startDateMonth, int startDateDay, int startDateYear,
140                    int startDateHour, int startDateMinute, int endDateMonth,
141                    int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
142                    boolean neverExpire, boolean active, java.lang.String limitCategories,
143                    java.lang.String limitSkus, double minOrder, double discount,
144                    java.lang.String discountType,
145                    com.liferay.portal.service.ServiceContext serviceContext)
146                    throws RemoteException {
147                    try {
148                            com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.updateCoupon(couponId,
149                                            name, description, startDateMonth, startDateDay,
150                                            startDateYear, startDateHour, startDateMinute,
151                                            endDateMonth, endDateDay, endDateYear, endDateHour,
152                                            endDateMinute, neverExpire, active, limitCategories,
153                                            limitSkus, minOrder, discount, discountType, serviceContext);
154    
155                            return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(returnValue);
156                    }
157                    catch (Exception e) {
158                            _log.error(e, e);
159    
160                            throw new RemoteException(e.getMessage());
161                    }
162            }
163    
164            private static Log _log = LogFactoryUtil.getLog(ShoppingCouponServiceSoap.class);
165    }