001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.service.AddressServiceUtil;
022    
023    import java.rmi.RemoteException;
024    
025    /**
026     * Provides the SOAP utility for the
027     * {@link com.liferay.portal.service.AddressServiceUtil} service utility. The
028     * static methods of this class calls the same methods of the service utility.
029     * However, the signatures are different because it is difficult for SOAP to
030     * support certain types.
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.AddressSoap}.
036     * If the method in the service utility returns a
037     * {@link com.liferay.portal.model.Address}, that is translated to a
038     * {@link com.liferay.portal.model.AddressSoap}. 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 AddressServiceHttp
061     * @see com.liferay.portal.model.AddressSoap
062     * @see com.liferay.portal.service.AddressServiceUtil
063     * @generated
064     */
065    @ProviderType
066    public class AddressServiceSoap {
067            /**
068            * @deprecated As of 6.2.0, replaced by {@link #addAddress(String, long,
069            String, String, String, String, String, long, long, int,
070            boolean, boolean, ServiceContext)}
071            */
072            @Deprecated
073            public static com.liferay.portal.model.AddressSoap addAddress(
074                    java.lang.String className, long classPK, java.lang.String street1,
075                    java.lang.String street2, java.lang.String street3,
076                    java.lang.String city, java.lang.String zip, long regionId,
077                    long countryId, int typeId, boolean mailing, boolean primary)
078                    throws RemoteException {
079                    try {
080                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.addAddress(className,
081                                            classPK, street1, street2, street3, city, zip, regionId,
082                                            countryId, typeId, mailing, primary);
083    
084                            return com.liferay.portal.model.AddressSoap.toSoapModel(returnValue);
085                    }
086                    catch (Exception e) {
087                            _log.error(e, e);
088    
089                            throw new RemoteException(e.getMessage());
090                    }
091            }
092    
093            public static com.liferay.portal.model.AddressSoap addAddress(
094                    java.lang.String className, long classPK, java.lang.String street1,
095                    java.lang.String street2, java.lang.String street3,
096                    java.lang.String city, java.lang.String zip, long regionId,
097                    long countryId, int typeId, boolean mailing, boolean primary,
098                    com.liferay.portal.service.ServiceContext serviceContext)
099                    throws RemoteException {
100                    try {
101                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.addAddress(className,
102                                            classPK, street1, street2, street3, city, zip, regionId,
103                                            countryId, typeId, mailing, primary, serviceContext);
104    
105                            return com.liferay.portal.model.AddressSoap.toSoapModel(returnValue);
106                    }
107                    catch (Exception e) {
108                            _log.error(e, e);
109    
110                            throw new RemoteException(e.getMessage());
111                    }
112            }
113    
114            public static void deleteAddress(long addressId) throws RemoteException {
115                    try {
116                            AddressServiceUtil.deleteAddress(addressId);
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.AddressSoap getAddress(
126                    long addressId) throws RemoteException {
127                    try {
128                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.getAddress(addressId);
129    
130                            return com.liferay.portal.model.AddressSoap.toSoapModel(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.AddressSoap[] getAddresses(
140                    java.lang.String className, long classPK) throws RemoteException {
141                    try {
142                            java.util.List<com.liferay.portal.model.Address> returnValue = AddressServiceUtil.getAddresses(className,
143                                            classPK);
144    
145                            return com.liferay.portal.model.AddressSoap.toSoapModels(returnValue);
146                    }
147                    catch (Exception e) {
148                            _log.error(e, e);
149    
150                            throw new RemoteException(e.getMessage());
151                    }
152            }
153    
154            public static com.liferay.portal.model.AddressSoap updateAddress(
155                    long addressId, java.lang.String street1, java.lang.String street2,
156                    java.lang.String street3, java.lang.String city, java.lang.String zip,
157                    long regionId, long countryId, int typeId, boolean mailing,
158                    boolean primary) throws RemoteException {
159                    try {
160                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.updateAddress(addressId,
161                                            street1, street2, street3, city, zip, regionId, countryId,
162                                            typeId, mailing, primary);
163    
164                            return com.liferay.portal.model.AddressSoap.toSoapModel(returnValue);
165                    }
166                    catch (Exception e) {
167                            _log.error(e, e);
168    
169                            throw new RemoteException(e.getMessage());
170                    }
171            }
172    
173            private static Log _log = LogFactoryUtil.getLog(AddressServiceSoap.class);
174    }