KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > webservice > authentication > AuthenticationServiceSoapBindingStub


1 /**
2  * AuthenticationServiceSoapBindingStub.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis 1.3 Oct 05, 2005 (05:23:37 EDT) WSDL2Java emitter.
6  */

7
8 package org.alfresco.webservice.authentication;
9
10 public class AuthenticationServiceSoapBindingStub extends org.apache.axis.client.Stub implements org.alfresco.webservice.authentication.AuthenticationServiceSoapPort {
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[2];
20         _initOperationDesc1();
21     }
22
23     private static void _initOperationDesc1(){
24         org.apache.axis.description.OperationDesc oper;
25         org.apache.axis.description.ParameterDesc param;
26         oper = new org.apache.axis.description.OperationDesc();
27         oper.setName("startSession");
28         param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "username"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, false, false);
29         oper.addParameter(param);
30         param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "password"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, false, false);
31         oper.addParameter(param);
32         oper.setReturnType(new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationResult"));
33         oper.setReturnClass(org.alfresco.webservice.authentication.AuthenticationResult.class);
34         oper.setReturnQName(new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "startSessionReturn"));
35         oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
36         oper.setUse(org.apache.axis.constants.Use.LITERAL);
37         oper.addFault(new org.apache.axis.description.FaultDesc(
38                       new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault"),
39                       "org.alfresco.webservice.authentication.AuthenticationFault",
40                       new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault"),
41                       true
42                      ));
43         _operations[0] = oper;
44
45         oper = new org.apache.axis.description.OperationDesc();
46         oper.setName("endSession");
47         param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "ticket"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName JavaDoc("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String JavaDoc.class, false, false);
48         oper.addParameter(param);
49         oper.setReturnType(org.apache.axis.encoding.XMLType.AXIS_VOID);
50         oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
51         oper.setUse(org.apache.axis.constants.Use.LITERAL);
52         oper.addFault(new org.apache.axis.description.FaultDesc(
53                       new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault"),
54                       "org.alfresco.webservice.authentication.AuthenticationFault",
55                       new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault"),
56                       true
57                      ));
58         _operations[1] = oper;
59
60     }
61
62     public AuthenticationServiceSoapBindingStub() throws org.apache.axis.AxisFault {
63          this(null);
64     }
65
66     public AuthenticationServiceSoapBindingStub(java.net.URL JavaDoc endpointURL, javax.xml.rpc.Service JavaDoc service) throws org.apache.axis.AxisFault {
67          this(service);
68          super.cachedEndpoint = endpointURL;
69     }
70
71     public AuthenticationServiceSoapBindingStub(javax.xml.rpc.Service JavaDoc service) throws org.apache.axis.AxisFault {
72         if (service == null) {
73             super.service = new org.apache.axis.client.Service();
74         } else {
75             super.service = service;
76         }
77         ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
78             java.lang.Class JavaDoc cls;
79             javax.xml.namespace.QName JavaDoc qName;
80             javax.xml.namespace.QName JavaDoc qName2;
81             java.lang.Class JavaDoc beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
82             java.lang.Class JavaDoc beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
83             java.lang.Class JavaDoc enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
84             java.lang.Class JavaDoc enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
85             java.lang.Class JavaDoc arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
86             java.lang.Class JavaDoc arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
87             java.lang.Class JavaDoc simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
88             java.lang.Class JavaDoc simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
89             java.lang.Class JavaDoc simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
90             java.lang.Class JavaDoc simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
91             qName = new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault");
92             cachedSerQNames.add(qName);
93             cls = org.alfresco.webservice.authentication.AuthenticationFault.class;
94             cachedSerClasses.add(cls);
95             cachedSerFactories.add(beansf);
96             cachedDeserFactories.add(beandf);
97
98             qName = new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationResult");
99             cachedSerQNames.add(qName);
100             cls = org.alfresco.webservice.authentication.AuthenticationResult.class;
101             cachedSerClasses.add(cls);
102             cachedSerFactories.add(beansf);
103             cachedDeserFactories.add(beandf);
104
105     }
106
107     protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException JavaDoc {
108         try {
109             org.apache.axis.client.Call _call = super._createCall();
110             if (super.maintainSessionSet) {
111                 _call.setMaintainSession(super.maintainSession);
112             }
113             if (super.cachedUsername != null) {
114                 _call.setUsername(super.cachedUsername);
115             }
116             if (super.cachedPassword != null) {
117                 _call.setPassword(super.cachedPassword);
118             }
119             if (super.cachedEndpoint != null) {
120                 _call.setTargetEndpointAddress(super.cachedEndpoint);
121             }
122             if (super.cachedTimeout != null) {
123                 _call.setTimeout(super.cachedTimeout);
124             }
125             if (super.cachedPortName != null) {
126                 _call.setPortName(super.cachedPortName);
127             }
128             java.util.Enumeration JavaDoc keys = super.cachedProperties.keys();
129             while (keys.hasMoreElements()) {
130                 java.lang.String JavaDoc key = (java.lang.String JavaDoc) keys.nextElement();
131                 _call.setProperty(key, super.cachedProperties.get(key));
132             }
133             // All the type mapping information is registered
134
// when the first call is made.
135
// The type mapping information is actually registered in
136
// the TypeMappingRegistry of the service, which
137
// is the reason why registration is only needed for the first call.
138
synchronized (this) {
139                 if (firstCall()) {
140                     // must set encoding style before registering serializers
141
_call.setEncodingStyle(null);
142                     for (int i = 0; i < cachedSerFactories.size(); ++i) {
143                         java.lang.Class JavaDoc cls = (java.lang.Class JavaDoc) cachedSerClasses.get(i);
144                         javax.xml.namespace.QName JavaDoc qName =
145                                 (javax.xml.namespace.QName JavaDoc) cachedSerQNames.get(i);
146                         java.lang.Object JavaDoc x = cachedSerFactories.get(i);
147                         if (x instanceof Class JavaDoc) {
148                             java.lang.Class JavaDoc sf = (java.lang.Class JavaDoc)
149                                  cachedSerFactories.get(i);
150                             java.lang.Class JavaDoc df = (java.lang.Class JavaDoc)
151                                  cachedDeserFactories.get(i);
152                             _call.registerTypeMapping(cls, qName, sf, df, false);
153                         }
154                         else if (x instanceof javax.xml.rpc.encoding.SerializerFactory JavaDoc) {
155                             org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)
156                                  cachedSerFactories.get(i);
157                             org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory)
158                                  cachedDeserFactories.get(i);
159                             _call.registerTypeMapping(cls, qName, sf, df, false);
160                         }
161                     }
162                 }
163             }
164             return _call;
165         }
166         catch (java.lang.Throwable JavaDoc _t) {
167             throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
168         }
169     }
170
171     public org.alfresco.webservice.authentication.AuthenticationResult startSession(java.lang.String JavaDoc username, java.lang.String JavaDoc password) throws java.rmi.RemoteException JavaDoc, org.alfresco.webservice.authentication.AuthenticationFault {
172         if (super.cachedEndpoint == null) {
173             throw new org.apache.axis.NoEndPointException();
174         }
175         org.apache.axis.client.Call _call = createCall();
176         _call.setOperation(_operations[0]);
177         _call.setUseSOAPAction(true);
178         _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authentication/1.0/startSession");
179         _call.setEncodingStyle(null);
180         _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
181         _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
182         _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
183         _call.setOperationName(new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "startSession"));
184
185         setRequestHeaders(_call);
186         setAttachments(_call);
187  try { java.lang.Object JavaDoc _resp = _call.invoke(new java.lang.Object JavaDoc[] {username, password});
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 (org.alfresco.webservice.authentication.AuthenticationResult) _resp;
196             } catch (java.lang.Exception JavaDoc _exception) {
197                 return (org.alfresco.webservice.authentication.AuthenticationResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.webservice.authentication.AuthenticationResult.class);
198             }
199         }
200   } catch (org.apache.axis.AxisFault axisFaultException) {
201     if (axisFaultException.detail != null) {
202         if (axisFaultException.detail instanceof java.rmi.RemoteException JavaDoc) {
203               throw (java.rmi.RemoteException JavaDoc) axisFaultException.detail;
204          }
205         if (axisFaultException.detail instanceof org.alfresco.webservice.authentication.AuthenticationFault) {
206               throw (org.alfresco.webservice.authentication.AuthenticationFault) axisFaultException.detail;
207          }
208    }
209   throw axisFaultException;
210 }
211     }
212
213     public void endSession(java.lang.String JavaDoc ticket) throws java.rmi.RemoteException JavaDoc, org.alfresco.webservice.authentication.AuthenticationFault {
214         if (super.cachedEndpoint == null) {
215             throw new org.apache.axis.NoEndPointException();
216         }
217         org.apache.axis.client.Call _call = createCall();
218         _call.setOperation(_operations[1]);
219         _call.setUseSOAPAction(true);
220         _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authentication/1.0/endSession");
221         _call.setEncodingStyle(null);
222         _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
223         _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
224         _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
225         _call.setOperationName(new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "endSession"));
226
227         setRequestHeaders(_call);
228         setAttachments(_call);
229  try { java.lang.Object JavaDoc _resp = _call.invoke(new java.lang.Object JavaDoc[] {ticket});
230
231         if (_resp instanceof java.rmi.RemoteException JavaDoc) {
232             throw (java.rmi.RemoteException JavaDoc)_resp;
233         }
234         extractAttachments(_call);
235   } catch (org.apache.axis.AxisFault axisFaultException) {
236     if (axisFaultException.detail != null) {
237         if (axisFaultException.detail instanceof java.rmi.RemoteException JavaDoc) {
238               throw (java.rmi.RemoteException JavaDoc) axisFaultException.detail;
239          }
240         if (axisFaultException.detail instanceof org.alfresco.webservice.authentication.AuthenticationFault) {
241               throw (org.alfresco.webservice.authentication.AuthenticationFault) axisFaultException.detail;
242          }
243    }
244   throw axisFaultException;
245 }
246     }
247
248 }
249
Popular Tags