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.EmailAddressServiceUtil;
020    
021    import java.rmi.RemoteException;
022    
023    /**
024     * Provides the SOAP utility for the
025     * {@link com.liferay.portal.service.EmailAddressServiceUtil} service utility. The
026     * static methods of this class calls the same methods of the service utility.
027     * However, the signatures are different because it is difficult for SOAP to
028     * support certain types.
029     *
030     * <p>
031     * ServiceBuilder follows certain rules in translating the methods. For example,
032     * if the method in the service utility returns a {@link java.util.List}, that
033     * is translated to an array of {@link com.liferay.portal.model.EmailAddressSoap}.
034     * If the method in the service utility returns a
035     * {@link com.liferay.portal.model.EmailAddress}, that is translated to a
036     * {@link com.liferay.portal.model.EmailAddressSoap}. Methods that SOAP cannot
037     * safely wire are skipped.
038     * </p>
039     *
040     * <p>
041     * The benefits of using the SOAP utility is that it is cross platform
042     * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
043     * even Perl, to call the generated services. One drawback of SOAP is that it is
044     * slow because it needs to serialize all calls into a text format (XML).
045     * </p>
046     *
047     * <p>
048     * You can see a list of services at http://localhost:8080/api/axis. Set the
049     * property <b>axis.servlet.hosts.allowed</b> in portal.properties to configure
050     * security.
051     * </p>
052     *
053     * <p>
054     * The SOAP utility is only generated for remote services.
055     * </p>
056     *
057     * @author Brian Wing Shun Chan
058     * @see EmailAddressServiceHttp
059     * @see com.liferay.portal.model.EmailAddressSoap
060     * @see com.liferay.portal.service.EmailAddressServiceUtil
061     * @generated
062     */
063    public class EmailAddressServiceSoap {
064            /**
065            * @deprecated As of 6.2.0, replaced by {@link #addEmailAddress( String,
066            long, String, int, boolean, ServiceContext)}
067            */
068            public static com.liferay.portal.model.EmailAddressSoap addEmailAddress(
069                    java.lang.String className, long classPK, java.lang.String address,
070                    int typeId, boolean primary) throws RemoteException {
071                    try {
072                            com.liferay.portal.model.EmailAddress returnValue = EmailAddressServiceUtil.addEmailAddress(className,
073                                            classPK, address, typeId, primary);
074    
075                            return com.liferay.portal.model.EmailAddressSoap.toSoapModel(returnValue);
076                    }
077                    catch (Exception e) {
078                            _log.error(e, e);
079    
080                            throw new RemoteException(e.getMessage());
081                    }
082            }
083    
084            public static com.liferay.portal.model.EmailAddressSoap addEmailAddress(
085                    java.lang.String className, long classPK, java.lang.String address,
086                    int typeId, boolean primary,
087                    com.liferay.portal.service.ServiceContext serviceContext)
088                    throws RemoteException {
089                    try {
090                            com.liferay.portal.model.EmailAddress returnValue = EmailAddressServiceUtil.addEmailAddress(className,
091                                            classPK, address, typeId, primary, serviceContext);
092    
093                            return com.liferay.portal.model.EmailAddressSoap.toSoapModel(returnValue);
094                    }
095                    catch (Exception e) {
096                            _log.error(e, e);
097    
098                            throw new RemoteException(e.getMessage());
099                    }
100            }
101    
102            public static void deleteEmailAddress(long emailAddressId)
103                    throws RemoteException {
104                    try {
105                            EmailAddressServiceUtil.deleteEmailAddress(emailAddressId);
106                    }
107                    catch (Exception e) {
108                            _log.error(e, e);
109    
110                            throw new RemoteException(e.getMessage());
111                    }
112            }
113    
114            public static com.liferay.portal.model.EmailAddressSoap getEmailAddress(
115                    long emailAddressId) throws RemoteException {
116                    try {
117                            com.liferay.portal.model.EmailAddress returnValue = EmailAddressServiceUtil.getEmailAddress(emailAddressId);
118    
119                            return com.liferay.portal.model.EmailAddressSoap.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.portal.model.EmailAddressSoap[] getEmailAddresses(
129                    java.lang.String className, long classPK) throws RemoteException {
130                    try {
131                            java.util.List<com.liferay.portal.model.EmailAddress> returnValue = EmailAddressServiceUtil.getEmailAddresses(className,
132                                            classPK);
133    
134                            return com.liferay.portal.model.EmailAddressSoap.toSoapModels(returnValue);
135                    }
136                    catch (Exception e) {
137                            _log.error(e, e);
138    
139                            throw new RemoteException(e.getMessage());
140                    }
141            }
142    
143            public static com.liferay.portal.model.EmailAddressSoap updateEmailAddress(
144                    long emailAddressId, java.lang.String address, int typeId,
145                    boolean primary) throws RemoteException {
146                    try {
147                            com.liferay.portal.model.EmailAddress returnValue = EmailAddressServiceUtil.updateEmailAddress(emailAddressId,
148                                            address, typeId, primary);
149    
150                            return com.liferay.portal.model.EmailAddressSoap.toSoapModel(returnValue);
151                    }
152                    catch (Exception e) {
153                            _log.error(e, e);
154    
155                            throw new RemoteException(e.getMessage());
156                    }
157            }
158    
159            private static Log _log = LogFactoryUtil.getLog(EmailAddressServiceSoap.class);
160    }