Jalview 2.6 source licence
[jalview.git] / src / ext / vamsas / MuscleWSSoapBindingStub.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 /*
19  * Jalview - A Sequence Alignment Editor and Viewer
20  * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
21  *
22  * This program is free software; you can redistribute it and/or
23  * modify it under the terms of the GNU General Public License
24  * as published by the Free Software Foundation; either version 2
25  * of the License, or (at your option) any later version.
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30  * GNU General Public License for more details.
31  *
32  * You should have received a copy of the GNU General Public License
33  * along with this program; if not, write to the Free Software
34  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
35  */
36 package ext.vamsas;
37
38 public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub
39         implements ext.vamsas.MuscleWS
40 {
41   static org.apache.axis.description.OperationDesc[] _operations;
42
43   static
44   {
45     _operations = new org.apache.axis.description.OperationDesc[4];
46     _initOperationDesc1();
47   }
48
49   private java.util.Vector cachedSerClasses = new java.util.Vector();
50
51   private java.util.Vector cachedSerQNames = new java.util.Vector();
52
53   private java.util.Vector cachedSerFactories = new java.util.Vector();
54
55   private java.util.Vector cachedDeserFactories = new java.util.Vector();
56
57   public MuscleWSSoapBindingStub() throws org.apache.axis.AxisFault
58   {
59     this(null);
60   }
61
62   public MuscleWSSoapBindingStub(java.net.URL endpointURL,
63           javax.xml.rpc.Service service) throws org.apache.axis.AxisFault
64   {
65     this(service);
66     super.cachedEndpoint = endpointURL;
67   }
68
69   public MuscleWSSoapBindingStub(javax.xml.rpc.Service service)
70           throws org.apache.axis.AxisFault
71   {
72     if (service == null)
73     {
74       super.service = new org.apache.axis.client.Service();
75     }
76     else
77     {
78       super.service = service;
79     }
80
81     java.lang.Class cls;
82     javax.xml.namespace.QName qName;
83     java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
84     java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
85     // java.lang.Class enumsf =
86     // org.apache.axis.encoding.ser.EnumSerializerFactory.class;
87     // java.lang.Class enumdf =
88     // org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
89     java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
90     java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
91     // java.lang.Class simplesf =
92     // org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
93     // java.lang.Class simpledf =
94     // org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
95     // java.lang.Class simplelistsf =
96     // org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
97     // java.lang.Class simplelistdf =
98     // org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
99     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
100             "Sequence");
101     cachedSerQNames.add(qName);
102     cls = vamsas.objects.simple.Sequence.class;
103     cachedSerClasses.add(cls);
104     cachedSerFactories.add(beansf);
105     cachedDeserFactories.add(beandf);
106
107     qName = new javax.xml.namespace.QName("vamsas", "ArrayOf_tns1_Sequence");
108     cachedSerQNames.add(qName);
109     cls = vamsas.objects.simple.Sequence[].class;
110     cachedSerClasses.add(cls);
111     cachedSerFactories.add(arraysf);
112     cachedDeserFactories.add(arraydf);
113
114     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
115             "MsaResult");
116     cachedSerQNames.add(qName);
117     cls = vamsas.objects.simple.MsaResult.class;
118     cachedSerClasses.add(cls);
119     cachedSerFactories.add(beansf);
120     cachedDeserFactories.add(beandf);
121
122     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
123             "SequenceSet");
124     cachedSerQNames.add(qName);
125     cls = vamsas.objects.simple.SequenceSet.class;
126     cachedSerClasses.add(cls);
127     cachedSerFactories.add(beansf);
128     cachedDeserFactories.add(beandf);
129
130     qName = new javax.xml.namespace.QName("http://simple.objects.vamsas",
131             "Object");
132     cachedSerQNames.add(qName);
133     cls = vamsas.objects.simple.Object.class;
134     cachedSerClasses.add(cls);
135     cachedSerFactories.add(beansf);
136     cachedDeserFactories.add(beandf);
137
138     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
139             "Alignment");
140     cachedSerQNames.add(qName);
141     cls = vamsas.objects.simple.Alignment.class;
142     cachedSerClasses.add(cls);
143     cachedSerFactories.add(beansf);
144     cachedDeserFactories.add(beandf);
145
146     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
147             "WsJobId");
148     cachedSerQNames.add(qName);
149     cls = vamsas.objects.simple.WsJobId.class;
150     cachedSerClasses.add(cls);
151     cachedSerFactories.add(beansf);
152     cachedDeserFactories.add(beandf);
153
154     qName = new javax.xml.namespace.QName("vamsas", "ArrayOf_xsd_string");
155     cachedSerQNames.add(qName);
156     cls = java.lang.String[].class;
157     cachedSerClasses.add(cls);
158     cachedSerFactories.add(arraysf);
159     cachedDeserFactories.add(arraydf);
160
161     qName = new javax.xml.namespace.QName("simple.objects.vamsas", "Result");
162     cachedSerQNames.add(qName);
163     cls = vamsas.objects.simple.Result.class;
164     cachedSerClasses.add(cls);
165     cachedSerFactories.add(beansf);
166     cachedDeserFactories.add(beandf);
167   }
168
169   private static void _initOperationDesc1()
170   {
171     org.apache.axis.description.OperationDesc oper;
172     oper = new org.apache.axis.description.OperationDesc();
173     oper.setName("align");
174     oper.addParameter(new javax.xml.namespace.QName("", "seqSet"),
175             new javax.xml.namespace.QName("simple.objects.vamsas",
176                     "SequenceSet"),
177             vamsas.objects.simple.SequenceSet.class,
178             org.apache.axis.description.ParameterDesc.IN, false, false);
179     oper.setReturnType(new javax.xml.namespace.QName(
180             "simple.objects.vamsas", "WsJobId"));
181     oper.setReturnClass(vamsas.objects.simple.WsJobId.class);
182     oper.setReturnQName(new javax.xml.namespace.QName("", "alignReturn"));
183     oper.setStyle(org.apache.axis.constants.Style.RPC);
184     oper.setUse(org.apache.axis.constants.Use.ENCODED);
185     _operations[0] = oper;
186
187     oper = new org.apache.axis.description.OperationDesc();
188     oper.setName("getalign");
189     oper.addParameter(new javax.xml.namespace.QName("", "job_id"),
190             new javax.xml.namespace.QName(
191                     "http://www.w3.org/2001/XMLSchema", "string"),
192             java.lang.String.class,
193             org.apache.axis.description.ParameterDesc.IN, false, false);
194     oper.setReturnType(new javax.xml.namespace.QName(
195             "simple.objects.vamsas", "Alignment"));
196     oper.setReturnClass(vamsas.objects.simple.Alignment.class);
197     oper
198             .setReturnQName(new javax.xml.namespace.QName("",
199                     "getalignReturn"));
200     oper.setStyle(org.apache.axis.constants.Style.RPC);
201     oper.setUse(org.apache.axis.constants.Use.ENCODED);
202     _operations[1] = oper;
203
204     oper = new org.apache.axis.description.OperationDesc();
205     oper.setName("getResult");
206     oper.addParameter(new javax.xml.namespace.QName("", "job_id"),
207             new javax.xml.namespace.QName(
208                     "http://www.w3.org/2001/XMLSchema", "string"),
209             java.lang.String.class,
210             org.apache.axis.description.ParameterDesc.IN, false, false);
211     oper.setReturnType(new javax.xml.namespace.QName(
212             "simple.objects.vamsas", "MsaResult"));
213     oper.setReturnClass(vamsas.objects.simple.MsaResult.class);
214     oper
215             .setReturnQName(new javax.xml.namespace.QName("",
216                     "getResultReturn"));
217     oper.setStyle(org.apache.axis.constants.Style.RPC);
218     oper.setUse(org.apache.axis.constants.Use.ENCODED);
219     _operations[2] = oper;
220
221     oper = new org.apache.axis.description.OperationDesc();
222     oper.setName("cancel");
223     oper.addParameter(new javax.xml.namespace.QName("", "jobId"),
224             new javax.xml.namespace.QName(
225                     "http://www.w3.org/2001/XMLSchema", "string"),
226             java.lang.String.class,
227             org.apache.axis.description.ParameterDesc.IN, false, false);
228     oper.setReturnType(new javax.xml.namespace.QName(
229             "simple.objects.vamsas", "WsJobId"));
230     oper.setReturnClass(vamsas.objects.simple.WsJobId.class);
231     oper.setReturnQName(new javax.xml.namespace.QName("", "cancelReturn"));
232     oper.setStyle(org.apache.axis.constants.Style.RPC);
233     oper.setUse(org.apache.axis.constants.Use.ENCODED);
234     _operations[3] = oper;
235   }
236
237   protected org.apache.axis.client.Call createCall()
238           throws java.rmi.RemoteException
239   {
240     try
241     {
242       org.apache.axis.client.Call _call = (org.apache.axis.client.Call) super.service
243               .createCall();
244
245       if (super.maintainSessionSet)
246       {
247         _call.setMaintainSession(super.maintainSession);
248       }
249
250       if (super.cachedUsername != null)
251       {
252         _call.setUsername(super.cachedUsername);
253       }
254
255       if (super.cachedPassword != null)
256       {
257         _call.setPassword(super.cachedPassword);
258       }
259
260       if (super.cachedEndpoint != null)
261       {
262         _call.setTargetEndpointAddress(super.cachedEndpoint);
263       }
264
265       if (super.cachedTimeout != null)
266       {
267         _call.setTimeout(super.cachedTimeout);
268       }
269
270       if (super.cachedPortName != null)
271       {
272         _call.setPortName(super.cachedPortName);
273       }
274
275       java.util.Enumeration keys = super.cachedProperties.keys();
276
277       while (keys.hasMoreElements())
278       {
279         java.lang.String key = (java.lang.String) keys.nextElement();
280         _call.setProperty(key, super.cachedProperties.get(key));
281       }
282
283       // All the type mapping information is registered
284       // when the first call is made.
285       // The type mapping information is actually registered in
286       // the TypeMappingRegistry of the service, which
287       // is the reason why registration is only needed for the first call.
288       synchronized (this)
289       {
290         if (firstCall())
291         {
292           // must set encoding style before registering serializers
293           _call
294                   .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
295           _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
296
297           for (int i = 0; i < cachedSerFactories.size(); ++i)
298           {
299             java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
300             javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames
301                     .get(i);
302             java.lang.Class sf = (java.lang.Class) cachedSerFactories
303                     .get(i);
304             java.lang.Class df = (java.lang.Class) cachedDeserFactories
305                     .get(i);
306             _call.registerTypeMapping(cls, qName, sf, df, false);
307           }
308         }
309       }
310
311       return _call;
312     } catch (java.lang.Throwable _t)
313     {
314       throw new org.apache.axis.AxisFault(
315               "Failure trying to get the Call object", _t);
316     }
317   }
318
319   public vamsas.objects.simple.WsJobId align(
320           vamsas.objects.simple.SequenceSet seqSet)
321           throws java.rmi.RemoteException
322   {
323     if (super.cachedEndpoint == null)
324     {
325       throw new org.apache.axis.NoEndPointException();
326     }
327
328     org.apache.axis.client.Call _call = createCall();
329     _call.setOperation(_operations[0]);
330     _call.setUseSOAPAction(true);
331     _call.setSOAPActionURI("");
332     _call
333             .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
334     _call
335             .setOperationName(new javax.xml.namespace.QName("vamsas",
336                     "align"));
337
338     setRequestHeaders(_call);
339     setAttachments(_call);
340
341     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
342     { seqSet });
343
344     if (_resp instanceof java.rmi.RemoteException)
345     {
346       throw (java.rmi.RemoteException) _resp;
347     }
348     else
349     {
350       extractAttachments(_call);
351
352       try
353       {
354         return (vamsas.objects.simple.WsJobId) _resp;
355       } catch (java.lang.Exception _exception)
356       {
357         return (vamsas.objects.simple.WsJobId) org.apache.axis.utils.JavaUtils
358                 .convert(_resp, vamsas.objects.simple.WsJobId.class);
359       }
360     }
361   }
362
363   public vamsas.objects.simple.Alignment getalign(java.lang.String job_id)
364           throws java.rmi.RemoteException
365   {
366     if (super.cachedEndpoint == null)
367     {
368       throw new org.apache.axis.NoEndPointException();
369     }
370
371     org.apache.axis.client.Call _call = createCall();
372     _call.setOperation(_operations[1]);
373     _call.setUseSOAPAction(true);
374     _call.setSOAPActionURI("");
375     _call
376             .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
377     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
378             "getalign"));
379
380     setRequestHeaders(_call);
381     setAttachments(_call);
382
383     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
384     { job_id });
385
386     if (_resp instanceof java.rmi.RemoteException)
387     {
388       throw (java.rmi.RemoteException) _resp;
389     }
390     else
391     {
392       extractAttachments(_call);
393
394       try
395       {
396         return (vamsas.objects.simple.Alignment) _resp;
397       } catch (java.lang.Exception _exception)
398       {
399         return (vamsas.objects.simple.Alignment) org.apache.axis.utils.JavaUtils
400                 .convert(_resp, vamsas.objects.simple.Alignment.class);
401       }
402     }
403   }
404
405   public vamsas.objects.simple.MsaResult getResult(java.lang.String job_id)
406           throws java.rmi.RemoteException
407   {
408     if (super.cachedEndpoint == null)
409     {
410       throw new org.apache.axis.NoEndPointException();
411     }
412
413     org.apache.axis.client.Call _call = createCall();
414     _call.setOperation(_operations[2]);
415     _call.setUseSOAPAction(true);
416     _call.setSOAPActionURI("");
417     _call
418             .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
419     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
420             "getResult"));
421
422     setRequestHeaders(_call);
423     setAttachments(_call);
424
425     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
426     { job_id });
427
428     if (_resp instanceof java.rmi.RemoteException)
429     {
430       throw (java.rmi.RemoteException) _resp;
431     }
432     else
433     {
434       extractAttachments(_call);
435
436       try
437       {
438         return (vamsas.objects.simple.MsaResult) _resp;
439       } catch (java.lang.Exception _exception)
440       {
441         return (vamsas.objects.simple.MsaResult) org.apache.axis.utils.JavaUtils
442                 .convert(_resp, vamsas.objects.simple.MsaResult.class);
443       }
444     }
445   }
446
447   public vamsas.objects.simple.WsJobId cancel(java.lang.String jobId)
448           throws java.rmi.RemoteException
449   {
450     if (super.cachedEndpoint == null)
451     {
452       throw new org.apache.axis.NoEndPointException();
453     }
454
455     org.apache.axis.client.Call _call = createCall();
456     _call.setOperation(_operations[3]);
457     _call.setUseSOAPAction(true);
458     _call.setSOAPActionURI("");
459     _call
460             .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
461     _call
462             .setOperationName(new javax.xml.namespace.QName("vamsas",
463                     "cancel"));
464
465     setRequestHeaders(_call);
466     setAttachments(_call);
467
468     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
469     { jobId });
470
471     if (_resp instanceof java.rmi.RemoteException)
472     {
473       throw (java.rmi.RemoteException) _resp;
474     }
475     else
476     {
477       extractAttachments(_call);
478
479       try
480       {
481         return (vamsas.objects.simple.WsJobId) _resp;
482       } catch (java.lang.Exception _exception)
483       {
484         return (vamsas.objects.simple.WsJobId) org.apache.axis.utils.JavaUtils
485                 .convert(_resp, vamsas.objects.simple.WsJobId.class);
486       }
487     }
488   }
489 }