update author list in license for (JAL-826)
[jalview.git] / src / ext / vamsas / JpredSoapBindingStub.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 JpredSoapBindingStub extends org.apache.axis.client.Stub
21         implements ext.vamsas.Jpred
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[4];
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("predict");
44     oper.addParameter(new javax.xml.namespace.QName("", "seq"),
45             new javax.xml.namespace.QName("simple.objects.vamsas",
46                     "Sequence"), vamsas.objects.simple.Sequence.class,
47             org.apache.axis.description.ParameterDesc.IN, false, false);
48     oper.setReturnType(new javax.xml.namespace.QName(
49             "http://www.w3.org/2001/XMLSchema", "string"));
50     oper.setReturnClass(java.lang.String.class);
51     oper.setReturnQName(new javax.xml.namespace.QName("", "predictReturn"));
52     oper.setStyle(org.apache.axis.constants.Style.RPC);
53     oper.setUse(org.apache.axis.constants.Use.ENCODED);
54     _operations[0] = oper;
55
56     oper = new org.apache.axis.description.OperationDesc();
57     oper.setName("predictOnMsa");
58     oper.addParameter(new javax.xml.namespace.QName("", "msf"),
59             new javax.xml.namespace.QName("http://simple.objects.vamsas",
60                     "Msfalignment"),
61             vamsas.objects.simple.Msfalignment.class,
62             org.apache.axis.description.ParameterDesc.IN, false, false);
63     oper.setReturnType(new javax.xml.namespace.QName(
64             "http://www.w3.org/2001/XMLSchema", "string"));
65     oper.setReturnClass(java.lang.String.class);
66     oper.setReturnQName(new javax.xml.namespace.QName("",
67             "predictOnMsaReturn"));
68     oper.setStyle(org.apache.axis.constants.Style.RPC);
69     oper.setUse(org.apache.axis.constants.Use.ENCODED);
70     _operations[1] = oper;
71
72     oper = new org.apache.axis.description.OperationDesc();
73     oper.setName("getpredict");
74     oper.addParameter(new javax.xml.namespace.QName("", "job_id"),
75             new javax.xml.namespace.QName(
76                     "http://www.w3.org/2001/XMLSchema", "string"),
77             java.lang.String.class,
78             org.apache.axis.description.ParameterDesc.IN, false, false);
79     oper.setReturnType(new javax.xml.namespace.QName(
80             "http://simple.objects.vamsas", "Secstructpred"));
81     oper.setReturnClass(vamsas.objects.simple.Secstructpred.class);
82     oper.setReturnQName(new javax.xml.namespace.QName("",
83             "getpredictReturn"));
84     oper.setStyle(org.apache.axis.constants.Style.RPC);
85     oper.setUse(org.apache.axis.constants.Use.ENCODED);
86     _operations[2] = oper;
87
88     oper = new org.apache.axis.description.OperationDesc();
89     oper.setName("getresult");
90     oper.addParameter(new javax.xml.namespace.QName("", "job_id"),
91             new javax.xml.namespace.QName(
92                     "http://www.w3.org/2001/XMLSchema", "string"),
93             java.lang.String.class,
94             org.apache.axis.description.ParameterDesc.IN, false, false);
95     oper.setReturnType(new javax.xml.namespace.QName(
96             "http://simple.objects.vamsas", "JpredResult"));
97     oper.setReturnClass(vamsas.objects.simple.JpredResult.class);
98     oper.setReturnQName(new javax.xml.namespace.QName("", "getresultReturn"));
99     oper.setStyle(org.apache.axis.constants.Style.RPC);
100     oper.setUse(org.apache.axis.constants.Use.ENCODED);
101     _operations[3] = oper;
102
103   }
104
105   public JpredSoapBindingStub() throws org.apache.axis.AxisFault
106   {
107     this(null);
108   }
109
110   public JpredSoapBindingStub(java.net.URL endpointURL,
111           javax.xml.rpc.Service service) throws org.apache.axis.AxisFault
112   {
113     this(service);
114     super.cachedEndpoint = endpointURL;
115   }
116
117   public JpredSoapBindingStub(javax.xml.rpc.Service service)
118           throws org.apache.axis.AxisFault
119   {
120     if (service == null)
121     {
122       super.service = new org.apache.axis.client.Service();
123     }
124     else
125     {
126       super.service = service;
127     }
128     java.lang.Class cls;
129     javax.xml.namespace.QName qName;
130     java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
131     java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
132     /*
133      * java.lang.Class enumsf =
134      * org.apache.axis.encoding.ser.EnumSerializerFactory.class; java.lang.Class
135      * enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
136      * java.lang.Class arraysf =
137      * org.apache.axis.encoding.ser.ArraySerializerFactory.class;
138      * java.lang.Class arraydf =
139      * org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
140      * java.lang.Class simplesf =
141      * org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
142      * java.lang.Class simpledf =
143      * org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
144      * java.lang.Class simplelistsf =
145      * org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
146      * java.lang.Class simplelistdf =
147      * org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
148      */
149     qName = new javax.xml.namespace.QName("http://simple.objects.vamsas",
150             "JpredResult");
151     cachedSerQNames.add(qName);
152     cls = vamsas.objects.simple.JpredResult.class;
153     cachedSerClasses.add(cls);
154     cachedSerFactories.add(beansf);
155     cachedDeserFactories.add(beandf);
156
157     qName = new javax.xml.namespace.QName("simple.objects.vamsas", "Result");
158     cachedSerQNames.add(qName);
159     cls = vamsas.objects.simple.Result.class;
160     cachedSerClasses.add(cls);
161     cachedSerFactories.add(beansf);
162     cachedDeserFactories.add(beandf);
163
164     qName = new javax.xml.namespace.QName("http://simple.objects.vamsas",
165             "Secstructpred");
166     cachedSerQNames.add(qName);
167     cls = vamsas.objects.simple.Secstructpred.class;
168     cachedSerClasses.add(cls);
169     cachedSerFactories.add(beansf);
170     cachedDeserFactories.add(beandf);
171
172     qName = new javax.xml.namespace.QName("http://simple.objects.vamsas",
173             "Msfalignment");
174     cachedSerQNames.add(qName);
175     cls = vamsas.objects.simple.Msfalignment.class;
176     cachedSerClasses.add(cls);
177     cachedSerFactories.add(beansf);
178     cachedDeserFactories.add(beandf);
179
180     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
181             "Sequence");
182     cachedSerQNames.add(qName);
183     cls = vamsas.objects.simple.Sequence.class;
184     cachedSerClasses.add(cls);
185     cachedSerFactories.add(beansf);
186     cachedDeserFactories.add(beandf);
187
188   }
189
190   protected org.apache.axis.client.Call createCall()
191           throws java.rmi.RemoteException
192   {
193     try
194     {
195       org.apache.axis.client.Call _call = (org.apache.axis.client.Call) super.service
196               .createCall();
197       if (super.maintainSessionSet)
198       {
199         _call.setMaintainSession(super.maintainSession);
200       }
201       if (super.cachedUsername != null)
202       {
203         _call.setUsername(super.cachedUsername);
204       }
205       if (super.cachedPassword != null)
206       {
207         _call.setPassword(super.cachedPassword);
208       }
209       if (super.cachedEndpoint != null)
210       {
211         _call.setTargetEndpointAddress(super.cachedEndpoint);
212       }
213       if (super.cachedTimeout != null)
214       {
215         _call.setTimeout(super.cachedTimeout);
216       }
217       if (super.cachedPortName != null)
218       {
219         _call.setPortName(super.cachedPortName);
220       }
221       java.util.Enumeration keys = super.cachedProperties.keys();
222       while (keys.hasMoreElements())
223       {
224         java.lang.String key = (java.lang.String) keys.nextElement();
225         _call.setProperty(key, super.cachedProperties.get(key));
226       }
227       // All the type mapping information is registered
228       // when the first call is made.
229       // The type mapping information is actually registered in
230       // the TypeMappingRegistry of the service, which
231       // is the reason why registration is only needed for the first call.
232       synchronized (this)
233       {
234         if (firstCall())
235         {
236           // must set encoding style before registering serializers
237           _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
238           _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
239           for (int i = 0; i < cachedSerFactories.size(); ++i)
240           {
241             java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
242             javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames
243                     .get(i);
244             java.lang.Class sf = (java.lang.Class) cachedSerFactories
245                     .get(i);
246             java.lang.Class df = (java.lang.Class) cachedDeserFactories
247                     .get(i);
248             _call.registerTypeMapping(cls, qName, sf, df, false);
249           }
250         }
251       }
252       return _call;
253     } catch (java.lang.Throwable _t)
254     {
255       throw new org.apache.axis.AxisFault(
256               "Failure trying to get the Call object", _t);
257     }
258   }
259
260   public java.lang.String predict(vamsas.objects.simple.Sequence seq)
261           throws java.rmi.RemoteException
262   {
263     if (super.cachedEndpoint == null)
264     {
265       throw new org.apache.axis.NoEndPointException();
266     }
267     org.apache.axis.client.Call _call = createCall();
268     _call.setOperation(_operations[0]);
269     _call.setUseSOAPAction(true);
270     _call.setSOAPActionURI("");
271     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
272     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
273             "predict"));
274
275     setRequestHeaders(_call);
276     setAttachments(_call);
277     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
278     { seq });
279
280     if (_resp instanceof java.rmi.RemoteException)
281     {
282       throw (java.rmi.RemoteException) _resp;
283     }
284     else
285     {
286       extractAttachments(_call);
287       try
288       {
289         return (java.lang.String) _resp;
290       } catch (java.lang.Exception _exception)
291       {
292         return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(
293                 _resp, java.lang.String.class);
294       }
295     }
296   }
297
298   public java.lang.String predictOnMsa(
299           vamsas.objects.simple.Msfalignment msf)
300           throws java.rmi.RemoteException
301   {
302     if (super.cachedEndpoint == null)
303     {
304       throw new org.apache.axis.NoEndPointException();
305     }
306     org.apache.axis.client.Call _call = createCall();
307     _call.setOperation(_operations[1]);
308     _call.setUseSOAPAction(true);
309     _call.setSOAPActionURI("");
310     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
311     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
312             "predictOnMsa"));
313
314     setRequestHeaders(_call);
315     setAttachments(_call);
316     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
317     { msf });
318
319     if (_resp instanceof java.rmi.RemoteException)
320     {
321       throw (java.rmi.RemoteException) _resp;
322     }
323     else
324     {
325       extractAttachments(_call);
326       try
327       {
328         return (java.lang.String) _resp;
329       } catch (java.lang.Exception _exception)
330       {
331         return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(
332                 _resp, java.lang.String.class);
333       }
334     }
335   }
336
337   public vamsas.objects.simple.Secstructpred getpredict(
338           java.lang.String job_id) throws java.rmi.RemoteException
339   {
340     if (super.cachedEndpoint == null)
341     {
342       throw new org.apache.axis.NoEndPointException();
343     }
344     org.apache.axis.client.Call _call = createCall();
345     _call.setOperation(_operations[2]);
346     _call.setUseSOAPAction(true);
347     _call.setSOAPActionURI("");
348     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
349     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
350             "getpredict"));
351
352     setRequestHeaders(_call);
353     setAttachments(_call);
354     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
355     { job_id });
356
357     if (_resp instanceof java.rmi.RemoteException)
358     {
359       throw (java.rmi.RemoteException) _resp;
360     }
361     else
362     {
363       extractAttachments(_call);
364       try
365       {
366         return (vamsas.objects.simple.Secstructpred) _resp;
367       } catch (java.lang.Exception _exception)
368       {
369         return (vamsas.objects.simple.Secstructpred) org.apache.axis.utils.JavaUtils
370                 .convert(_resp, vamsas.objects.simple.Secstructpred.class);
371       }
372     }
373   }
374
375   public vamsas.objects.simple.JpredResult getresult(java.lang.String job_id)
376           throws java.rmi.RemoteException
377   {
378     if (super.cachedEndpoint == null)
379     {
380       throw new org.apache.axis.NoEndPointException();
381     }
382     org.apache.axis.client.Call _call = createCall();
383     _call.setOperation(_operations[3]);
384     _call.setUseSOAPAction(true);
385     _call.setSOAPActionURI("");
386     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
387     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
388             "getresult"));
389
390     setRequestHeaders(_call);
391     setAttachments(_call);
392     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
393     { job_id });
394
395     if (_resp instanceof java.rmi.RemoteException)
396     {
397       throw (java.rmi.RemoteException) _resp;
398     }
399     else
400     {
401       extractAttachments(_call);
402       try
403       {
404         return (vamsas.objects.simple.JpredResult) _resp;
405       } catch (java.lang.Exception _exception)
406       {
407         return (vamsas.objects.simple.JpredResult) org.apache.axis.utils.JavaUtils
408                 .convert(_resp, vamsas.objects.simple.JpredResult.class);
409       }
410     }
411   }
412
413 }