update author list in license for (JAL-826)
[jalview.git] / src / ext / vamsas / RegistryServiceSoapBindingStub.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  * 
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 package ext.vamsas;
19
20 public class RegistryServiceSoapBindingStub extends
21         org.apache.axis.client.Stub implements ext.vamsas.IRegistry
22 {
23   private java.util.Vector cachedSerClasses = new java.util.Vector();
24
25   private java.util.Vector cachedSerQNames = new java.util.Vector();
26
27   private java.util.Vector cachedSerFactories = new java.util.Vector();
28
29   private java.util.Vector cachedDeserFactories = new java.util.Vector();
30
31   static org.apache.axis.description.OperationDesc[] _operations;
32
33   static
34   {
35     _operations = new org.apache.axis.description.OperationDesc[1];
36     _initOperationDesc1();
37   }
38
39   private static void _initOperationDesc1()
40   {
41     org.apache.axis.description.OperationDesc oper;
42     oper = new org.apache.axis.description.OperationDesc();
43     oper.setName("getServices");
44     oper.setReturnType(new javax.xml.namespace.QName(
45             "registry.objects.vamsas", "ServiceHandles"));
46     oper.setReturnClass(ext.vamsas.ServiceHandles.class);
47     oper.setReturnQName(new javax.xml.namespace.QName("",
48             "getServicesReturn"));
49     oper.setStyle(org.apache.axis.constants.Style.RPC);
50     oper.setUse(org.apache.axis.constants.Use.ENCODED);
51     _operations[0] = oper;
52
53   }
54
55   public RegistryServiceSoapBindingStub() throws org.apache.axis.AxisFault
56   {
57     this(null);
58   }
59
60   public RegistryServiceSoapBindingStub(java.net.URL endpointURL,
61           javax.xml.rpc.Service service) throws org.apache.axis.AxisFault
62   {
63     this(service);
64     super.cachedEndpoint = endpointURL;
65   }
66
67   public RegistryServiceSoapBindingStub(javax.xml.rpc.Service service)
68           throws org.apache.axis.AxisFault
69   {
70     if (service == null)
71     {
72       super.service = new org.apache.axis.client.Service();
73     }
74     else
75     {
76       super.service = service;
77     }
78     java.lang.Class cls;
79     javax.xml.namespace.QName qName;
80     java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
81     java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
82     // java.lang.Class enumsf =
83     // org.apache.axis.encoding.ser.EnumSerializerFactory.class;
84     // java.lang.Class enumdf =
85     // org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
86     java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
87     java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
88     // java.lang.Class simplesf =
89     // org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
90     // java.lang.Class simpledf =
91     // org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
92     // java.lang.Class simplelistsf =
93     // org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
94     // java.lang.Class simplelistdf =
95     // org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
96     qName = new javax.xml.namespace.QName("vamsas",
97             "ArrayOf_tns1_ServiceHandle");
98     cachedSerQNames.add(qName);
99     cls = ext.vamsas.ServiceHandle[].class;
100     cachedSerClasses.add(cls);
101     cachedSerFactories.add(arraysf);
102     cachedDeserFactories.add(arraydf);
103
104     qName = new javax.xml.namespace.QName("registry.objects.vamsas",
105             "ServiceHandles");
106     cachedSerQNames.add(qName);
107     cls = ext.vamsas.ServiceHandles.class;
108     cachedSerClasses.add(cls);
109     cachedSerFactories.add(beansf);
110     cachedDeserFactories.add(beandf);
111
112     qName = new javax.xml.namespace.QName("registry.objects.vamsas",
113             "ServiceHandle");
114     cachedSerQNames.add(qName);
115     cls = ext.vamsas.ServiceHandle.class;
116     cachedSerClasses.add(cls);
117     cachedSerFactories.add(beansf);
118     cachedDeserFactories.add(beandf);
119
120   }
121
122   protected org.apache.axis.client.Call createCall()
123           throws java.rmi.RemoteException
124   {
125     try
126     {
127       org.apache.axis.client.Call _call = (org.apache.axis.client.Call) super.service
128               .createCall();
129       if (super.maintainSessionSet)
130       {
131         _call.setMaintainSession(super.maintainSession);
132       }
133       if (super.cachedUsername != null)
134       {
135         _call.setUsername(super.cachedUsername);
136       }
137       if (super.cachedPassword != null)
138       {
139         _call.setPassword(super.cachedPassword);
140       }
141       if (super.cachedEndpoint != null)
142       {
143         _call.setTargetEndpointAddress(super.cachedEndpoint);
144       }
145       if (super.cachedTimeout != null)
146       {
147         _call.setTimeout(super.cachedTimeout);
148       }
149       if (super.cachedPortName != null)
150       {
151         _call.setPortName(super.cachedPortName);
152       }
153       java.util.Enumeration keys = super.cachedProperties.keys();
154       while (keys.hasMoreElements())
155       {
156         java.lang.String key = (java.lang.String) keys.nextElement();
157         _call.setProperty(key, super.cachedProperties.get(key));
158       }
159       // All the type mapping information is registered
160       // when the first call is made.
161       // The type mapping information is actually registered in
162       // the TypeMappingRegistry of the service, which
163       // is the reason why registration is only needed for the first call.
164       synchronized (this)
165       {
166         if (firstCall())
167         {
168           // must set encoding style before registering serializers
169           _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
170           _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
171           for (int i = 0; i < cachedSerFactories.size(); ++i)
172           {
173             java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
174             javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames
175                     .get(i);
176             java.lang.Class sf = (java.lang.Class) cachedSerFactories
177                     .get(i);
178             java.lang.Class df = (java.lang.Class) cachedDeserFactories
179                     .get(i);
180             _call.registerTypeMapping(cls, qName, sf, df, false);
181           }
182         }
183       }
184       return _call;
185     } catch (java.lang.Throwable _t)
186     {
187       throw new org.apache.axis.AxisFault(
188               "Failure trying to get the Call object", _t);
189     }
190   }
191
192   public ext.vamsas.ServiceHandles getServices()
193           throws java.rmi.RemoteException
194   {
195     if (super.cachedEndpoint == null)
196     {
197       throw new org.apache.axis.NoEndPointException();
198     }
199     org.apache.axis.client.Call _call = createCall();
200     _call.setOperation(_operations[0]);
201     _call.setUseSOAPAction(true);
202     _call.setSOAPActionURI("");
203     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
204     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
205             "getServices"));
206
207     setRequestHeaders(_call);
208     setAttachments(_call);
209     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
210     {});
211
212     if (_resp instanceof java.rmi.RemoteException)
213     {
214       throw (java.rmi.RemoteException) _resp;
215     }
216     else
217     {
218       extractAttachments(_call);
219       try
220       {
221         return (ext.vamsas.ServiceHandles) _resp;
222       } catch (java.lang.Exception _exception)
223       {
224         return (ext.vamsas.ServiceHandles) org.apache.axis.utils.JavaUtils
225                 .convert(_resp, ext.vamsas.ServiceHandles.class);
226       }
227     }
228   }
229
230 }