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.AddressServiceUtil;
020    
021    import java.rmi.RemoteException;
022    
023    /**
024     * Provides the SOAP utility for the
025     * {@link com.liferay.portal.service.AddressServiceUtil} 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.AddressSoap}.
034     * If the method in the service utility returns a
035     * {@link com.liferay.portal.model.Address}, that is translated to a
036     * {@link com.liferay.portal.model.AddressSoap}. 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 AddressServiceHttp
059     * @see com.liferay.portal.model.AddressSoap
060     * @see com.liferay.portal.service.AddressServiceUtil
061     * @generated
062     */
063    public class AddressServiceSoap {
064            /**
065            * @deprecated As of 6.2.0, replaced by {@link #addAddress( String, long,
066            String, String, String, String, String, long, long, int,
067            boolean, boolean, ServiceContext)}
068            */
069            public static com.liferay.portal.model.AddressSoap addAddress(
070                    java.lang.String className, long classPK, java.lang.String street1,
071                    java.lang.String street2, java.lang.String street3,
072                    java.lang.String city, java.lang.String zip, long regionId,
073                    long countryId, int typeId, boolean mailing, boolean primary)
074                    throws RemoteException {
075                    try {
076                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.addAddress(className,
077                                            classPK, street1, street2, street3, city, zip, regionId,
078                                            countryId, typeId, mailing, primary);
079    
080                            return com.liferay.portal.model.AddressSoap.toSoapModel(returnValue);
081                    }
082                    catch (Exception e) {
083                            _log.error(e, e);
084    
085                            throw new RemoteException(e.getMessage());
086                    }
087            }
088    
089            public static com.liferay.portal.model.AddressSoap addAddress(
090                    java.lang.String className, long classPK, java.lang.String street1,
091                    java.lang.String street2, java.lang.String street3,
092                    java.lang.String city, java.lang.String zip, long regionId,
093                    long countryId, int typeId, boolean mailing, boolean primary,
094                    com.liferay.portal.service.ServiceContext serviceContext)
095                    throws RemoteException {
096                    try {
097                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.addAddress(className,
098                                            classPK, street1, street2, street3, city, zip, regionId,
099                                            countryId, typeId, mailing, primary, serviceContext);
100    
101                            return com.liferay.portal.model.AddressSoap.toSoapModel(returnValue);
102                    }
103                    catch (Exception e) {
104                            _log.error(e, e);
105    
106                            throw new RemoteException(e.getMessage());
107                    }
108            }
109    
110            public static void deleteAddress(long addressId) throws RemoteException {
111                    try {
112                            AddressServiceUtil.deleteAddress(addressId);
113                    }
114                    catch (Exception e) {
115                            _log.error(e, e);
116    
117                            throw new RemoteException(e.getMessage());
118                    }
119            }
120    
121            public static com.liferay.portal.model.AddressSoap getAddress(
122                    long addressId) throws RemoteException {
123                    try {
124                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.getAddress(addressId);
125    
126                            return com.liferay.portal.model.AddressSoap.toSoapModel(returnValue);
127                    }
128                    catch (Exception e) {
129                            _log.error(e, e);
130    
131                            throw new RemoteException(e.getMessage());
132                    }
133            }
134    
135            public static com.liferay.portal.model.AddressSoap[] getAddresses(
136                    java.lang.String className, long classPK) throws RemoteException {
137                    try {
138                            java.util.List<com.liferay.portal.model.Address> returnValue = AddressServiceUtil.getAddresses(className,
139                                            classPK);
140    
141                            return com.liferay.portal.model.AddressSoap.toSoapModels(returnValue);
142                    }
143                    catch (Exception e) {
144                            _log.error(e, e);
145    
146                            throw new RemoteException(e.getMessage());
147                    }
148            }
149    
150            public static com.liferay.portal.model.AddressSoap updateAddress(
151                    long addressId, java.lang.String street1, java.lang.String street2,
152                    java.lang.String street3, java.lang.String city, java.lang.String zip,
153                    long regionId, long countryId, int typeId, boolean mailing,
154                    boolean primary) throws RemoteException {
155                    try {
156                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.updateAddress(addressId,
157                                            street1, street2, street3, city, zip, regionId, countryId,
158                                            typeId, mailing, primary);
159    
160                            return com.liferay.portal.model.AddressSoap.toSoapModel(returnValue);
161                    }
162                    catch (Exception e) {
163                            _log.error(e, e);
164    
165                            throw new RemoteException(e.getMessage());
166                    }
167            }
168    
169            private static Log _log = LogFactoryUtil.getLog(AddressServiceSoap.class);
170    }