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 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            public static com.liferay.portal.model.AddressSoap addAddress(
073                    java.lang.String className, long classPK, java.lang.String street1,
074                    java.lang.String street2, java.lang.String street3,
075                    java.lang.String city, java.lang.String zip, long regionId,
076                    long countryId, int typeId, boolean mailing, boolean primary)
077                    throws RemoteException {
078                    try {
079                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.addAddress(className,
080                                            classPK, street1, street2, street3, city, zip, regionId,
081                                            countryId, typeId, mailing, primary);
082    
083                            return com.liferay.portal.model.AddressSoap.toSoapModel(returnValue);
084                    }
085                    catch (Exception e) {
086                            _log.error(e, e);
087    
088                            throw new RemoteException(e.getMessage());
089                    }
090            }
091    
092            public static com.liferay.portal.model.AddressSoap addAddress(
093                    java.lang.String className, long classPK, java.lang.String street1,
094                    java.lang.String street2, java.lang.String street3,
095                    java.lang.String city, java.lang.String zip, long regionId,
096                    long countryId, int typeId, boolean mailing, boolean primary,
097                    com.liferay.portal.service.ServiceContext serviceContext)
098                    throws RemoteException {
099                    try {
100                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.addAddress(className,
101                                            classPK, street1, street2, street3, city, zip, regionId,
102                                            countryId, typeId, mailing, primary, serviceContext);
103    
104                            return com.liferay.portal.model.AddressSoap.toSoapModel(returnValue);
105                    }
106                    catch (Exception e) {
107                            _log.error(e, e);
108    
109                            throw new RemoteException(e.getMessage());
110                    }
111            }
112    
113            public static void deleteAddress(long addressId) throws RemoteException {
114                    try {
115                            AddressServiceUtil.deleteAddress(addressId);
116                    }
117                    catch (Exception e) {
118                            _log.error(e, e);
119    
120                            throw new RemoteException(e.getMessage());
121                    }
122            }
123    
124            public static com.liferay.portal.model.AddressSoap getAddress(
125                    long addressId) throws RemoteException {
126                    try {
127                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.getAddress(addressId);
128    
129                            return com.liferay.portal.model.AddressSoap.toSoapModel(returnValue);
130                    }
131                    catch (Exception e) {
132                            _log.error(e, e);
133    
134                            throw new RemoteException(e.getMessage());
135                    }
136            }
137    
138            public static com.liferay.portal.model.AddressSoap[] getAddresses(
139                    java.lang.String className, long classPK) throws RemoteException {
140                    try {
141                            java.util.List<com.liferay.portal.model.Address> returnValue = AddressServiceUtil.getAddresses(className,
142                                            classPK);
143    
144                            return com.liferay.portal.model.AddressSoap.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.AddressSoap updateAddress(
154                    long addressId, java.lang.String street1, java.lang.String street2,
155                    java.lang.String street3, java.lang.String city, java.lang.String zip,
156                    long regionId, long countryId, int typeId, boolean mailing,
157                    boolean primary) throws RemoteException {
158                    try {
159                            com.liferay.portal.model.Address returnValue = AddressServiceUtil.updateAddress(addressId,
160                                            street1, street2, street3, city, zip, regionId, countryId,
161                                            typeId, mailing, primary);
162    
163                            return com.liferay.portal.model.AddressSoap.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(AddressServiceSoap.class);
173    }