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