1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.portlet.shopping.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  
20  import com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil;
21  
22  import java.rmi.RemoteException;
23  
24  /**
25   * <a href="ShoppingCouponServiceSoap.java.html"><b><i>View Source</i></b></a>
26   *
27   * <p>
28   * ServiceBuilder generated this class. Modifications in this class will be
29   * overwritten the next time is generated.
30   * </p>
31   *
32   * <p>
33   * This class provides a SOAP utility for the
34   * {@link com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil} service utility. The
35   * static methods of this class calls the same methods of the service utility.
36   * However, the signatures are different because it is difficult for SOAP to
37   * support certain types.
38   * </p>
39   *
40   * <p>
41   * ServiceBuilder follows certain rules in translating the methods. For example,
42   * if the method in the service utility returns a {@link java.util.List}, that
43   * is translated to an array of {@link com.liferay.portlet.shopping.model.ShoppingCouponSoap}.
44   * If the method in the service utility returns a
45   * {@link com.liferay.portlet.shopping.model.ShoppingCoupon}, that is translated to a
46   * {@link com.liferay.portlet.shopping.model.ShoppingCouponSoap}. Methods that SOAP cannot
47   * safely wire are skipped.
48   * </p>
49   *
50   * <p>
51   * The benefits of using the SOAP utility is that it is cross platform
52   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
53   * even Perl, to call the generated services. One drawback of SOAP is that it is
54   * slow because it needs to serialize all calls into a text format (XML).
55   * </p>
56   *
57   * <p>
58   * You can see a list of services at
59   * http://localhost:8080/tunnel-web/secure/axis. Set the property
60   * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
61   * security.
62   * </p>
63   *
64   * <p>
65   * The SOAP utility is only generated for remote services.
66   * </p>
67   *
68   * @author    Brian Wing Shun Chan
69   * @see       ShoppingCouponServiceHttp
70   * @see       com.liferay.portlet.shopping.model.ShoppingCouponSoap
71   * @see       com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil
72   * @generated
73   */
74  public class ShoppingCouponServiceSoap {
75      public static com.liferay.portlet.shopping.model.ShoppingCouponSoap addCoupon(
76          long plid, java.lang.String code, boolean autoCode,
77          java.lang.String name, java.lang.String description,
78          int startDateMonth, int startDateDay, int startDateYear,
79          int startDateHour, int startDateMinute, int endDateMonth,
80          int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
81          boolean neverExpire, boolean active, java.lang.String limitCategories,
82          java.lang.String limitSkus, double minOrder, double discount,
83          java.lang.String discountType) throws RemoteException {
84          try {
85              com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.addCoupon(plid,
86                      code, autoCode, name, description, startDateMonth,
87                      startDateDay, startDateYear, startDateHour,
88                      startDateMinute, endDateMonth, endDateDay, endDateYear,
89                      endDateHour, endDateMinute, neverExpire, active,
90                      limitCategories, limitSkus, minOrder, discount, discountType);
91  
92              return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(returnValue);
93          }
94          catch (Exception e) {
95              _log.error(e, e);
96  
97              throw new RemoteException(e.getMessage());
98          }
99      }
100 
101     public static void deleteCoupon(long plid, long couponId)
102         throws RemoteException {
103         try {
104             ShoppingCouponServiceUtil.deleteCoupon(plid, couponId);
105         }
106         catch (Exception e) {
107             _log.error(e, e);
108 
109             throw new RemoteException(e.getMessage());
110         }
111     }
112 
113     public static com.liferay.portlet.shopping.model.ShoppingCouponSoap getCoupon(
114         long plid, long couponId) throws RemoteException {
115         try {
116             com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.getCoupon(plid,
117                     couponId);
118 
119             return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(returnValue);
120         }
121         catch (Exception e) {
122             _log.error(e, e);
123 
124             throw new RemoteException(e.getMessage());
125         }
126     }
127 
128     public static com.liferay.portlet.shopping.model.ShoppingCouponSoap[] search(
129         long plid, long companyId, java.lang.String code, boolean active,
130         java.lang.String discountType, boolean andOperator, int start, int end)
131         throws RemoteException {
132         try {
133             java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> returnValue =
134                 ShoppingCouponServiceUtil.search(plid, companyId, code, active,
135                     discountType, andOperator, start, end);
136 
137             return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModels(returnValue);
138         }
139         catch (Exception e) {
140             _log.error(e, e);
141 
142             throw new RemoteException(e.getMessage());
143         }
144     }
145 
146     public static com.liferay.portlet.shopping.model.ShoppingCouponSoap updateCoupon(
147         long plid, long couponId, java.lang.String name,
148         java.lang.String description, int startDateMonth, int startDateDay,
149         int startDateYear, int startDateHour, int startDateMinute,
150         int endDateMonth, int endDateDay, int endDateYear, int endDateHour,
151         int endDateMinute, boolean neverExpire, boolean active,
152         java.lang.String limitCategories, java.lang.String limitSkus,
153         double minOrder, double discount, java.lang.String discountType)
154         throws RemoteException {
155         try {
156             com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.updateCoupon(plid,
157                     couponId, name, description, startDateMonth, startDateDay,
158                     startDateYear, startDateHour, startDateMinute,
159                     endDateMonth, endDateDay, endDateYear, endDateHour,
160                     endDateMinute, neverExpire, active, limitCategories,
161                     limitSkus, minOrder, discount, discountType);
162 
163             return com.liferay.portlet.shopping.model.ShoppingCouponSoap.toSoapModel(returnValue);
164         }
165         catch (Exception e) {
166             _log.error(e, e);
167 
168             throw new RemoteException(e.getMessage());
169         }
170     }
171 
172     private static Log _log = LogFactoryUtil.getLog(ShoppingCouponServiceSoap.class);
173 }