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.portal.service.http;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.service.CountryServiceUtil;
020    
021    import java.rmi.RemoteException;
022    
023    /**
024     * <p>
025     * This class provides a SOAP utility for the
026     * {@link com.liferay.portal.service.CountryServiceUtil} 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     * </p>
031     *
032     * <p>
033     * ServiceBuilder follows certain rules in translating the methods. For example,
034     * if the method in the service utility returns a {@link java.util.List}, that
035     * is translated to an array of {@link com.liferay.portal.model.CountrySoap}.
036     * If the method in the service utility returns a
037     * {@link com.liferay.portal.model.Country}, that is translated to a
038     * {@link com.liferay.portal.model.CountrySoap}. Methods that SOAP cannot
039     * safely wire are skipped.
040     * </p>
041     *
042     * <p>
043     * The benefits of using the SOAP utility is that it is cross platform
044     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
045     * even Perl, to call the generated services. One drawback of SOAP is that it is
046     * slow because it needs to serialize all calls into a text format (XML).
047     * </p>
048     *
049     * <p>
050     * You can see a list of services at http://localhost:8080/api/axis. Set the
051     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
052     * security.
053     * </p>
054     *
055     * <p>
056     * The SOAP utility is only generated for remote services.
057     * </p>
058     *
059     * @author    Brian Wing Shun Chan
060     * @see       CountryServiceHttp
061     * @see       com.liferay.portal.model.CountrySoap
062     * @see       com.liferay.portal.service.CountryServiceUtil
063     * @generated
064     */
065    public class CountryServiceSoap {
066            public static com.liferay.portal.model.CountrySoap addCountry(
067                    java.lang.String name, java.lang.String a2, java.lang.String a3,
068                    java.lang.String number, java.lang.String idd, boolean active)
069                    throws RemoteException {
070                    try {
071                            com.liferay.portal.model.Country returnValue = CountryServiceUtil.addCountry(name,
072                                            a2, a3, number, idd, active);
073    
074                            return com.liferay.portal.model.CountrySoap.toSoapModel(returnValue);
075                    }
076                    catch (Exception e) {
077                            _log.error(e, e);
078    
079                            throw new RemoteException(e.getMessage());
080                    }
081            }
082    
083            public static com.liferay.portal.model.CountrySoap fetchCountry(
084                    long countryId) throws RemoteException {
085                    try {
086                            com.liferay.portal.model.Country returnValue = CountryServiceUtil.fetchCountry(countryId);
087    
088                            return com.liferay.portal.model.CountrySoap.toSoapModel(returnValue);
089                    }
090                    catch (Exception e) {
091                            _log.error(e, e);
092    
093                            throw new RemoteException(e.getMessage());
094                    }
095            }
096    
097            public static com.liferay.portal.model.CountrySoap fetchCountryByA2(
098                    java.lang.String a2) throws RemoteException {
099                    try {
100                            com.liferay.portal.model.Country returnValue = CountryServiceUtil.fetchCountryByA2(a2);
101    
102                            return com.liferay.portal.model.CountrySoap.toSoapModel(returnValue);
103                    }
104                    catch (Exception e) {
105                            _log.error(e, e);
106    
107                            throw new RemoteException(e.getMessage());
108                    }
109            }
110    
111            public static com.liferay.portal.model.CountrySoap fetchCountryByA3(
112                    java.lang.String a3) throws RemoteException {
113                    try {
114                            com.liferay.portal.model.Country returnValue = CountryServiceUtil.fetchCountryByA3(a3);
115    
116                            return com.liferay.portal.model.CountrySoap.toSoapModel(returnValue);
117                    }
118                    catch (Exception e) {
119                            _log.error(e, e);
120    
121                            throw new RemoteException(e.getMessage());
122                    }
123            }
124    
125            public static com.liferay.portal.model.CountrySoap[] getCountries()
126                    throws RemoteException {
127                    try {
128                            java.util.List<com.liferay.portal.model.Country> returnValue = CountryServiceUtil.getCountries();
129    
130                            return com.liferay.portal.model.CountrySoap.toSoapModels(returnValue);
131                    }
132                    catch (Exception e) {
133                            _log.error(e, e);
134    
135                            throw new RemoteException(e.getMessage());
136                    }
137            }
138    
139            public static com.liferay.portal.model.CountrySoap[] getCountries(
140                    boolean active) throws RemoteException {
141                    try {
142                            java.util.List<com.liferay.portal.model.Country> returnValue = CountryServiceUtil.getCountries(active);
143    
144                            return com.liferay.portal.model.CountrySoap.toSoapModels(returnValue);
145                    }
146                    catch (Exception e) {
147                            _log.error(e, e);
148    
149                            throw new RemoteException(e.getMessage());
150                    }
151            }
152    
153            public static com.liferay.portal.model.CountrySoap getCountry(
154                    long countryId) throws RemoteException {
155                    try {
156                            com.liferay.portal.model.Country returnValue = CountryServiceUtil.getCountry(countryId);
157    
158                            return com.liferay.portal.model.CountrySoap.toSoapModel(returnValue);
159                    }
160                    catch (Exception e) {
161                            _log.error(e, e);
162    
163                            throw new RemoteException(e.getMessage());
164                    }
165            }
166    
167            public static com.liferay.portal.model.CountrySoap getCountryByA2(
168                    java.lang.String a2) throws RemoteException {
169                    try {
170                            com.liferay.portal.model.Country returnValue = CountryServiceUtil.getCountryByA2(a2);
171    
172                            return com.liferay.portal.model.CountrySoap.toSoapModel(returnValue);
173                    }
174                    catch (Exception e) {
175                            _log.error(e, e);
176    
177                            throw new RemoteException(e.getMessage());
178                    }
179            }
180    
181            public static com.liferay.portal.model.CountrySoap getCountryByA3(
182                    java.lang.String a3) throws RemoteException {
183                    try {
184                            com.liferay.portal.model.Country returnValue = CountryServiceUtil.getCountryByA3(a3);
185    
186                            return com.liferay.portal.model.CountrySoap.toSoapModel(returnValue);
187                    }
188                    catch (Exception e) {
189                            _log.error(e, e);
190    
191                            throw new RemoteException(e.getMessage());
192                    }
193            }
194    
195            public static com.liferay.portal.model.CountrySoap getCountryByName(
196                    java.lang.String name) throws RemoteException {
197                    try {
198                            com.liferay.portal.model.Country returnValue = CountryServiceUtil.getCountryByName(name);
199    
200                            return com.liferay.portal.model.CountrySoap.toSoapModel(returnValue);
201                    }
202                    catch (Exception e) {
203                            _log.error(e, e);
204    
205                            throw new RemoteException(e.getMessage());
206                    }
207            }
208    
209            private static Log _log = LogFactoryUtil.getLog(CountryServiceSoap.class);
210    }