KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * AuthenticationServiceSoapBindingStub.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter.
6  */

7
8 package org.alfresco.example.webservice.authentication;
9
10 public class AuthenticationServiceSoapBindingStub extends org.apache.axis.client.Stub implements org.alfresco.example.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[1];
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("authenticate");
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.example.webservice.authentication.AuthenticationResult.class);
34         oper.setReturnQName(new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "authenticateReturn"));
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.example.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     }
46
47     public AuthenticationServiceSoapBindingStub() throws org.apache.axis.AxisFault {
48          this(null);
49     }
50
51     public AuthenticationServiceSoapBindingStub(java.net.URL JavaDoc endpointURL, javax.xml.rpc.Service JavaDoc service) throws org.apache.axis.AxisFault {
52          this(service);
53          super.cachedEndpoint = endpointURL;
54     }
55
56     public AuthenticationServiceSoapBindingStub(javax.xml.rpc.Service JavaDoc service) throws org.apache.axis.AxisFault {
57         if (service == null) {
58             super.service = new org.apache.axis.client.Service();
59         } else {
60             super.service = service;
61         }
62         ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
63             java.lang.Class JavaDoc cls;
64             javax.xml.namespace.QName JavaDoc qName;
65             javax.xml.namespace.QName JavaDoc qName2;
66             java.lang.Class JavaDoc beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
67             java.lang.Class JavaDoc beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
68             java.lang.Class JavaDoc enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
69             java.lang.Class JavaDoc enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
70             java.lang.Class JavaDoc arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
71             java.lang.Class JavaDoc arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
72             java.lang.Class JavaDoc simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
73             java.lang.Class JavaDoc simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
74             java.lang.Class JavaDoc simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
75             java.lang.Class JavaDoc simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
76             qName = new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationFault");
77             cachedSerQNames.add(qName);
78             cls = org.alfresco.example.webservice.authentication.AuthenticationFault.class;
79             cachedSerClasses.add(cls);
80             cachedSerFactories.add(beansf);
81             cachedDeserFactories.add(beandf);
82
83             qName = new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "AuthenticationResult");
84             cachedSerQNames.add(qName);
85             cls = org.alfresco.example.webservice.authentication.AuthenticationResult.class;
86             cachedSerClasses.add(cls);
87             cachedSerFactories.add(beansf);
88             cachedDeserFactories.add(beandf);
89
90     }
91
92     protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException JavaDoc {
93         try {
94             org.apache.axis.client.Call _call = super._createCall();
95             if (super.maintainSessionSet) {
96                 _call.setMaintainSession(super.maintainSession);
97             }
98             if (super.cachedUsername != null) {
99                 _call.setUsername(super.cachedUsername);
100             }
101             if (super.cachedPassword != null) {
102                 _call.setPassword(super.cachedPassword);
103             }
104             if (super.cachedEndpoint != null) {
105                 _call.setTargetEndpointAddress(super.cachedEndpoint);
106             }
107             if (super.cachedTimeout != null) {
108                 _call.setTimeout(super.cachedTimeout);
109             }
110             if (super.cachedPortName != null) {
111                 _call.setPortName(super.cachedPortName);
112             }
113             java.util.Enumeration JavaDoc keys = super.cachedProperties.keys();
114             while (keys.hasMoreElements()) {
115                 java.lang.String JavaDoc key = (java.lang.String JavaDoc) keys.nextElement();
116                 _call.setProperty(key, super.cachedProperties.get(key));
117             }
118             // All the type mapping information is registered
119
// when the first call is made.
120
// The type mapping information is actually registered in
121
// the TypeMappingRegistry of the service, which
122
// is the reason why registration is only needed for the first call.
123
synchronized (this) {
124                 if (firstCall()) {
125                     // must set encoding style before registering serializers
126
_call.setEncodingStyle(null);
127                     for (int i = 0; i < cachedSerFactories.size(); ++i) {
128                         java.lang.Class JavaDoc cls = (java.lang.Class JavaDoc) cachedSerClasses.get(i);
129                         javax.xml.namespace.QName JavaDoc qName =
130                                 (javax.xml.namespace.QName JavaDoc) cachedSerQNames.get(i);
131                         java.lang.Object JavaDoc x = cachedSerFactories.get(i);
132                         if (x instanceof Class JavaDoc) {
133                             java.lang.Class JavaDoc sf = (java.lang.Class JavaDoc)
134                                  cachedSerFactories.get(i);
135                             java.lang.Class JavaDoc df = (java.lang.Class JavaDoc)
136                                  cachedDeserFactories.get(i);
137                             _call.registerTypeMapping(cls, qName, sf, df, false);
138                         }
139                         else if (x instanceof javax.xml.rpc.encoding.SerializerFactory JavaDoc) {
140                             org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)
141                                  cachedSerFactories.get(i);
142                             org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory)
143                                  cachedDeserFactories.get(i);
144                             _call.registerTypeMapping(cls, qName, sf, df, false);
145                         }
146                     }
147                 }
148             }
149             return _call;
150         }
151         catch (java.lang.Throwable JavaDoc _t) {
152             throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
153         }
154     }
155
156     public org.alfresco.example.webservice.authentication.AuthenticationResult authenticate(java.lang.String JavaDoc username, java.lang.String JavaDoc password) throws java.rmi.RemoteException JavaDoc, org.alfresco.example.webservice.authentication.AuthenticationFault {
157         if (super.cachedEndpoint == null) {
158             throw new org.apache.axis.NoEndPointException();
159         }
160         org.apache.axis.client.Call _call = createCall();
161         _call.setOperation(_operations[0]);
162         _call.setUseSOAPAction(true);
163         _call.setSOAPActionURI("http://www.alfresco.org/ws/service/authentication/1.0/authenticate");
164         _call.setEncodingStyle(null);
165         _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
166         _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
167         _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
168         _call.setOperationName(new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/authentication/1.0", "authenticate"));
169
170         setRequestHeaders(_call);
171         setAttachments(_call);
172  try { java.lang.Object JavaDoc _resp = _call.invoke(new java.lang.Object JavaDoc[] {username, password});
173
174         if (_resp instanceof java.rmi.RemoteException JavaDoc) {
175             throw (java.rmi.RemoteException JavaDoc)_resp;
176         }
177         else {
178             extractAttachments(_call);
179             try {
180                 return (org.alfresco.example.webservice.authentication.AuthenticationResult) _resp;
181             } catch (java.lang.Exception JavaDoc _exception) {
182                 return (org.alfresco.example.webservice.authentication.AuthenticationResult) org.apache.axis.utils.JavaUtils.convert(_resp, org.alfresco.example.webservice.authentication.AuthenticationResult.class);
183             }
184         }
185   } catch (org.apache.axis.AxisFault axisFaultException) {
186     if (axisFaultException.detail != null) {
187         if (axisFaultException.detail instanceof java.rmi.RemoteException JavaDoc) {
188               throw (java.rmi.RemoteException JavaDoc) axisFaultException.detail;
189          }
190         if (axisFaultException.detail instanceof org.alfresco.example.webservice.authentication.AuthenticationFault) {
191               throw (org.alfresco.example.webservice.authentication.AuthenticationFault) axisFaultException.detail;
192          }
193    }
194   throw axisFaultException;
195 }
196     }
197
198 }
199
Popular Tags