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