KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > phoneList > business > axis > PhoneBookSoapBindingStub


1 /**
2  * PhoneBookSoapBindingStub.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis 1.2beta Mar 31, 2004 (12:47:03 EST) WSDL2Java emitter.
6  */

7
8 package phoneList.business.axis;
9
10 public class PhoneBookSoapBindingStub extends org.apache.axis.client.Stub implements phoneList.business.axis.PhoneList {
11     private java.util.Vector JavaDoc cachedSerClasses = new java.util.Vector JavaDoc();
12     private java.util.Vector JavaDoc cachedSerQNames = new java.util.Vector JavaDoc();
13     private java.util.Vector JavaDoc cachedSerFactories = new java.util.Vector JavaDoc();
14     private java.util.Vector JavaDoc cachedDeserFactories = new java.util.Vector JavaDoc();
15
16     static org.apache.axis.description.OperationDesc [] _operations;
17
18     static {
19         _operations = new org.apache.axis.description.OperationDesc[5];
20         _initOperationDesc1();
21     }
22
23     private static void _initOperationDesc1(){
24         org.apache.axis.description.OperationDesc oper;
25         oper = new org.apache.axis.description.OperationDesc();
26         oper.setName("getLists");
27         oper.setReturnType(new javax.xml.namespace.QName JavaDoc("urn:phoneBook", "ArrayOf_apachesoap_Vector"));
28         oper.setReturnClass(java.lang.Object JavaDoc[][].class);
29         oper.setReturnQName(new javax.xml.namespace.QName JavaDoc("", "getListsReturn"));
30         oper.setStyle(org.apache.axis.constants.Style.RPC);
31         oper.setUse(org.apache.axis.constants.Use.ENCODED);
32         _operations[0] = oper;
33
34         oper = new org.apache.axis.description.OperationDesc();
35         oper.setName("addPerson");
36         oper.addParameter(new javax.xml.namespace.QName JavaDoc("", "firstName"), new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, org.apache.axis.description.ParameterDesc.IN, false, false);
37         oper.addParameter(new javax.xml.namespace.QName JavaDoc("", "lastName"), new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, org.apache.axis.description.ParameterDesc.IN, false, false);
38         oper.addParameter(new javax.xml.namespace.QName JavaDoc("", "phoneNumber"), new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, org.apache.axis.description.ParameterDesc.IN, false, false);
39         oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);
40         oper.setStyle(org.apache.axis.constants.Style.RPC);
41         oper.setUse(org.apache.axis.constants.Use.ENCODED);
42         _operations[1] = oper;
43
44         oper = new org.apache.axis.description.OperationDesc();
45         oper.setName("deletePerson");
46         oper.addParameter(new javax.xml.namespace.QName JavaDoc("", "id"), new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, org.apache.axis.description.ParameterDesc.IN, false, false);
47         oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);
48         oper.setStyle(org.apache.axis.constants.Style.RPC);
49         oper.setUse(org.apache.axis.constants.Use.ENCODED);
50         _operations[2] = oper;
51
52         oper = new org.apache.axis.description.OperationDesc();
53         oper.setName("modifyPerson");
54         oper.addParameter(new javax.xml.namespace.QName JavaDoc("", "id"), new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, org.apache.axis.description.ParameterDesc.IN, false, false);
55         oper.addParameter(new javax.xml.namespace.QName JavaDoc("", "newFirstName"), new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, org.apache.axis.description.ParameterDesc.IN, false, false);
56         oper.addParameter(new javax.xml.namespace.QName JavaDoc("", "newLastName"), new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, org.apache.axis.description.ParameterDesc.IN, false, false);
57         oper.addParameter(new javax.xml.namespace.QName JavaDoc("", "newPhoneNumber"), new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, org.apache.axis.description.ParameterDesc.IN, false, false);
58         oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);
59         oper.setStyle(org.apache.axis.constants.Style.RPC);
60         oper.setUse(org.apache.axis.constants.Use.ENCODED);
61         _operations[3] = oper;
62
63         oper = new org.apache.axis.description.OperationDesc();
64         oper.setName("getPersonData");
65         oper.addParameter(new javax.xml.namespace.QName JavaDoc("", "id"), new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, org.apache.axis.description.ParameterDesc.IN, false, false);
66         oper.setReturnType(new javax.xml.namespace.QName JavaDoc("urn:phoneBook", "ArrayOf_xsd_string"));
67         oper.setReturnClass(java.lang.String JavaDoc[].class);
68         oper.setReturnQName(new javax.xml.namespace.QName JavaDoc("", "getPersonDataReturn"));
69         oper.setStyle(org.apache.axis.constants.Style.RPC);
70         oper.setUse(org.apache.axis.constants.Use.ENCODED);
71         _operations[4] = oper;
72
73     }
74
75     public PhoneBookSoapBindingStub() throws org.apache.axis.AxisFault {
76          this(null);
77     }
78
79     public PhoneBookSoapBindingStub(java.net.URL JavaDoc endpointURL, javax.xml.rpc.Service JavaDoc service) throws org.apache.axis.AxisFault {
80          this(service);
81          super.cachedEndpoint = endpointURL;
82     }
83
84     public PhoneBookSoapBindingStub(javax.xml.rpc.Service JavaDoc service) throws org.apache.axis.AxisFault {
85         if (service == null) {
86             super.service = new org.apache.axis.client.Service();
87         } else {
88             super.service = service;
89         }
90             java.lang.Class JavaDoc cls;
91             javax.xml.namespace.QName JavaDoc qName;
92             java.lang.Class JavaDoc beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
93             java.lang.Class JavaDoc beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
94             java.lang.Class JavaDoc enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
95             java.lang.Class JavaDoc enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
96             java.lang.Class JavaDoc arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
97             java.lang.Class JavaDoc arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
98             java.lang.Class JavaDoc simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
99             java.lang.Class JavaDoc simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
100             java.lang.Class JavaDoc simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
101             java.lang.Class JavaDoc simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
102             qName = new javax.xml.namespace.QName JavaDoc("urn:phoneBook", "ArrayOf_xsd_string");
103             cachedSerQNames.add(qName);
104             cls = java.lang.String JavaDoc[].class;
105             cachedSerClasses.add(cls);
106             cachedSerFactories.add(arraysf);
107             cachedDeserFactories.add(arraydf);
108
109             qName = new javax.xml.namespace.QName JavaDoc("urn:phoneBook", "ArrayOf_apachesoap_Vector");
110             cachedSerQNames.add(qName);
111             cls = java.lang.Object JavaDoc[][].class;
112             cachedSerClasses.add(cls);
113             cachedSerFactories.add(arraysf);
114             cachedDeserFactories.add(arraydf);
115
116     }
117
118     private org.apache.axis.client.Call createCall() throws java.rmi.RemoteException JavaDoc {
119         try {
120             org.apache.axis.client.Call _call =
121                     (org.apache.axis.client.Call) super.service.createCall();
122             if (super.maintainSessionSet) {
123                 _call.setMaintainSession(super.maintainSession);
124             }
125             if (super.cachedUsername != null) {
126                 _call.setUsername(super.cachedUsername);
127             }
128             if (super.cachedPassword != null) {
129                 _call.setPassword(super.cachedPassword);
130             }
131             if (super.cachedEndpoint != null) {
132                 _call.setTargetEndpointAddress(super.cachedEndpoint);
133             }
134             if (super.cachedTimeout != null) {
135                 _call.setTimeout(super.cachedTimeout);
136             }
137             if (super.cachedPortName != null) {
138                 _call.setPortName(super.cachedPortName);
139             }
140             java.util.Enumeration JavaDoc keys = super.cachedProperties.keys();
141             while (keys.hasMoreElements()) {
142                 java.lang.String JavaDoc key = (java.lang.String JavaDoc) keys.nextElement();
143                 _call.setProperty(key, super.cachedProperties.get(key));
144             }
145             // All the type mapping information is registered
146
// when the first call is made.
147
// The type mapping information is actually registered in
148
// the TypeMappingRegistry of the service, which
149
// is the reason why registration is only needed for the first call.
150
synchronized (this) {
151                 if (firstCall()) {
152                     // must set encoding style before registering serializers
153
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
154                     _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
155                     for (int i = 0; i < cachedSerFactories.size(); ++i) {
156                         java.lang.Class JavaDoc cls = (java.lang.Class JavaDoc) cachedSerClasses.get(i);
157                         javax.xml.namespace.QName JavaDoc qName =
158                                 (javax.xml.namespace.QName JavaDoc) cachedSerQNames.get(i);
159                         java.lang.Class JavaDoc sf = (java.lang.Class JavaDoc)
160                                  cachedSerFactories.get(i);
161                         java.lang.Class JavaDoc df = (java.lang.Class JavaDoc)
162                                  cachedDeserFactories.get(i);
163                         _call.registerTypeMapping(cls, qName, sf, df, false);
164                     }
165                 }
166             }
167             return _call;
168         }
169         catch (java.lang.Throwable JavaDoc _t) {
170             throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
171         }
172     }
173
174     public java.lang.Object JavaDoc[][] getLists() throws java.rmi.RemoteException JavaDoc {
175         if (super.cachedEndpoint == null) {
176             throw new org.apache.axis.NoEndPointException();
177         }
178         org.apache.axis.client.Call _call = createCall();
179         _call.setOperation(_operations[0]);
180         _call.setUseSOAPAction(true);
181         _call.setSOAPActionURI("");
182         _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
183         _call.setOperationName(new javax.xml.namespace.QName JavaDoc("urn:phoneBook", "getLists"));
184
185         setRequestHeaders(_call);
186         setAttachments(_call);
187         java.lang.Object JavaDoc _resp = _call.invoke(new java.lang.Object JavaDoc[] {});
188
189         if (_resp instanceof java.rmi.RemoteException JavaDoc) {
190             throw (java.rmi.RemoteException JavaDoc)_resp;
191         }
192         else {
193             extractAttachments(_call);
194             try {
195                 return (java.lang.Object JavaDoc[][]) _resp;
196             } catch (java.lang.Exception JavaDoc _exception) {
197                 return (java.lang.Object JavaDoc[][]) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.Object JavaDoc[][].class);
198             }
199         }
200     }
201
202     public void addPerson(java.lang.String JavaDoc firstName, java.lang.String JavaDoc lastName, java.lang.String JavaDoc phoneNumber) throws java.rmi.RemoteException JavaDoc {
203         if (super.cachedEndpoint == null) {
204             throw new org.apache.axis.NoEndPointException();
205         }
206         org.apache.axis.client.Call _call = createCall();
207         _call.setOperation(_operations[1]);
208         _call.setUseSOAPAction(true);
209         _call.setSOAPActionURI("");
210         _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
211         _call.setOperationName(new javax.xml.namespace.QName JavaDoc("urn:phoneBook", "addPerson"));
212
213         setRequestHeaders(_call);
214         setAttachments(_call);
215         java.lang.Object JavaDoc _resp = _call.invoke(new java.lang.Object JavaDoc[] {firstName, lastName, phoneNumber});
216
217         if (_resp instanceof java.rmi.RemoteException JavaDoc) {
218             throw (java.rmi.RemoteException JavaDoc)_resp;
219         }
220         extractAttachments(_call);
221     }
222
223     public void deletePerson(java.lang.String JavaDoc id) throws java.rmi.RemoteException JavaDoc {
224         if (super.cachedEndpoint == null) {
225             throw new org.apache.axis.NoEndPointException();
226         }
227         org.apache.axis.client.Call _call = createCall();
228         _call.setOperation(_operations[2]);
229         _call.setUseSOAPAction(true);
230         _call.setSOAPActionURI("");
231         _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
232         _call.setOperationName(new javax.xml.namespace.QName JavaDoc("urn:phoneBook", "deletePerson"));
233
234         setRequestHeaders(_call);
235         setAttachments(_call);
236         java.lang.Object JavaDoc _resp = _call.invoke(new java.lang.Object JavaDoc[] {id});
237
238         if (_resp instanceof java.rmi.RemoteException JavaDoc) {
239             throw (java.rmi.RemoteException JavaDoc)_resp;
240         }
241         extractAttachments(_call);
242     }
243
244     public void modifyPerson(java.lang.String JavaDoc id, java.lang.String JavaDoc newFirstName, java.lang.String JavaDoc newLastName, java.lang.String JavaDoc newPhoneNumber) throws java.rmi.RemoteException JavaDoc {
245         if (super.cachedEndpoint == null) {
246             throw new org.apache.axis.NoEndPointException();
247         }
248         org.apache.axis.client.Call _call = createCall();
249         _call.setOperation(_operations[3]);
250         _call.setUseSOAPAction(true);
251         _call.setSOAPActionURI("");
252         _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
253         _call.setOperationName(new javax.xml.namespace.QName JavaDoc("urn:phoneBook", "modifyPerson"));
254
255         setRequestHeaders(_call);
256         setAttachments(_call);
257         java.lang.Object JavaDoc _resp = _call.invoke(new java.lang.Object JavaDoc[] {id, newFirstName, newLastName, newPhoneNumber});
258
259         if (_resp instanceof java.rmi.RemoteException JavaDoc) {
260             throw (java.rmi.RemoteException JavaDoc)_resp;
261         }
262         extractAttachments(_call);
263     }
264
265     public java.lang.String JavaDoc[] getPersonData(java.lang.String JavaDoc id) throws java.rmi.RemoteException JavaDoc {
266         if (super.cachedEndpoint == null) {
267             throw new org.apache.axis.NoEndPointException();
268         }
269         org.apache.axis.client.Call _call = createCall();
270         _call.setOperation(_operations[4]);
271         _call.setUseSOAPAction(true);
272         _call.setSOAPActionURI("");
273         _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
274         _call.setOperationName(new javax.xml.namespace.QName JavaDoc("urn:phoneBook", "getPersonData"));
275
276         setRequestHeaders(_call);
277         setAttachments(_call);
278         java.lang.Object JavaDoc _resp = _call.invoke(new java.lang.Object JavaDoc[] {id});
279
280         if (_resp instanceof java.rmi.RemoteException JavaDoc) {
281             throw (java.rmi.RemoteException JavaDoc)_resp;
282         }
283         else {
284             extractAttachments(_call);
285             try {
286                 return (java.lang.String JavaDoc[]) _resp;
287             } catch (java.lang.Exception JavaDoc _exception) {
288                 return (java.lang.String JavaDoc[]) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String JavaDoc[].class);
289             }
290         }
291     }
292
293 }
294
Popular Tags