001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.service.http;
022:
023: import com.liferay.portal.kernel.log.Log;
024: import com.liferay.portal.kernel.log.LogFactoryUtil;
025: import com.liferay.portal.service.AddressServiceUtil;
026:
027: import java.rmi.RemoteException;
028:
029: /**
030: * <a href="AddressServiceSoap.java.html"><b><i>View Source</i></b></a>
031: *
032: * <p>
033: * ServiceBuilder generated this class. Modifications in this class will be
034: * overwritten the next time is generated.
035: * </p>
036: *
037: * <p>
038: * This class provides a SOAP utility for the
039: * <code>com.liferay.portal.service.AddressServiceUtil</code> service
040: * utility. The static methods of this class calls the same methods of the
041: * service utility. However, the signatures are different because it is
042: * difficult for SOAP to support certain types.
043: * </p>
044: *
045: * <p>
046: * ServiceBuilder follows certain rules in translating the methods. For example,
047: * if the method in the service utility returns a <code>java.util.List</code>,
048: * that is translated to an array of
049: * <code>com.liferay.portal.model.AddressSoap</code>. If the method in the
050: * service utility returns a <code>com.liferay.portal.model.Address</code>,
051: * that is translated to a <code>com.liferay.portal.model.AddressSoap</code>.
052: * Methods that SOAP cannot safely wire are skipped.
053: * </p>
054: *
055: * <p>
056: * The benefits of using the SOAP utility is that it is cross platform
057: * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
058: * even Perl, to call the generated services. One drawback of SOAP is that it is
059: * slow because it needs to serialize all calls into a text format (XML).
060: * </p>
061: *
062: * <p>
063: * You can see a list of services at
064: * http://localhost:8080/tunnel-web/secure/axis. Set the property
065: * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
066: * security.
067: * </p>
068: *
069: * <p>
070: * The SOAP utility is only generated for remote services.
071: * </p>
072: *
073: * @author Brian Wing Shun Chan
074: *
075: * @see com.liferay.portal.service.AddressServiceUtil
076: * @see com.liferay.portal.service.http.AddressServiceHttp
077: * @see com.liferay.portal.service.model.AddressSoap
078: *
079: */
080: public class AddressServiceSoap {
081: public static com.liferay.portal.model.AddressSoap addAddress(
082: java.lang.String className, long classPK,
083: java.lang.String street1, java.lang.String street2,
084: java.lang.String street3, java.lang.String city,
085: java.lang.String zip, long regionId, long countryId,
086: int typeId, boolean mailing, boolean primary)
087: throws RemoteException {
088: try {
089: com.liferay.portal.model.Address returnValue = AddressServiceUtil
090: .addAddress(className, classPK, street1, street2,
091: street3, city, zip, regionId, countryId,
092: typeId, mailing, primary);
093:
094: return com.liferay.portal.model.AddressSoap
095: .toSoapModel(returnValue);
096: } catch (Exception e) {
097: _log.error(e, e);
098:
099: throw new RemoteException(e.getMessage());
100: }
101: }
102:
103: public static void deleteAddress(long addressId)
104: throws RemoteException {
105: try {
106: AddressServiceUtil.deleteAddress(addressId);
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.AddressSoap getAddress(
115: long addressId) throws RemoteException {
116: try {
117: com.liferay.portal.model.Address returnValue = AddressServiceUtil
118: .getAddress(addressId);
119:
120: return com.liferay.portal.model.AddressSoap
121: .toSoapModel(returnValue);
122: } catch (Exception e) {
123: _log.error(e, e);
124:
125: throw new RemoteException(e.getMessage());
126: }
127: }
128:
129: public static com.liferay.portal.model.AddressSoap[] getAddresses(
130: java.lang.String className, long classPK)
131: throws RemoteException {
132: try {
133: java.util.List returnValue = AddressServiceUtil
134: .getAddresses(className, classPK);
135:
136: return com.liferay.portal.model.AddressSoap
137: .toSoapModels(returnValue);
138: } catch (Exception e) {
139: _log.error(e, e);
140:
141: throw new RemoteException(e.getMessage());
142: }
143: }
144:
145: public static com.liferay.portal.model.AddressSoap updateAddress(
146: long addressId, java.lang.String street1,
147: java.lang.String street2, java.lang.String street3,
148: java.lang.String city, java.lang.String zip, long regionId,
149: long countryId, int typeId, boolean mailing, boolean primary)
150: throws RemoteException {
151: try {
152: com.liferay.portal.model.Address returnValue = AddressServiceUtil
153: .updateAddress(addressId, street1, street2,
154: street3, city, zip, regionId, countryId,
155: typeId, mailing, primary);
156:
157: return com.liferay.portal.model.AddressSoap
158: .toSoapModel(returnValue);
159: } catch (Exception e) {
160: _log.error(e, e);
161:
162: throw new RemoteException(e.getMessage());
163: }
164: }
165:
166: private static Log _log = LogFactoryUtil
167: .getLog(AddressServiceSoap.class);
168: }
|