applied copyright 2008
[jalview.git] / src / ext / vamsas / MuscleWSSoapBindingStub.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3  * Copyright (C) 2008 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
40     extends org.apache.axis.client.Stub 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   private java.util.Vector cachedSerQNames = new java.util.Vector();
52   private java.util.Vector cachedSerFactories = new java.util.Vector();
53   private java.util.Vector cachedDeserFactories = new java.util.Vector();
54
55   public MuscleWSSoapBindingStub()
56       throws org.apache.axis.AxisFault
57   {
58     this(null);
59   }
60
61   public MuscleWSSoapBindingStub(java.net.URL endpointURL,
62                                  javax.xml.rpc.Service service)
63       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.
85         BeanDeserializerFactory.class;
86     //java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
87     //java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
88     java.lang.Class arraysf = org.apache.axis.encoding.ser.
89         ArraySerializerFactory.class;
90     java.lang.Class arraydf = org.apache.axis.encoding.ser.
91         ArrayDeserializerFactory.class;
92     //java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
93     // java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
94     //java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
95     //java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
96     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
97                                           "Sequence");
98     cachedSerQNames.add(qName);
99     cls = vamsas.objects.simple.Sequence.class;
100     cachedSerClasses.add(cls);
101     cachedSerFactories.add(beansf);
102     cachedDeserFactories.add(beandf);
103
104     qName = new javax.xml.namespace.QName("vamsas", "ArrayOf_tns1_Sequence");
105     cachedSerQNames.add(qName);
106     cls = vamsas.objects.simple.Sequence[].class;
107     cachedSerClasses.add(cls);
108     cachedSerFactories.add(arraysf);
109     cachedDeserFactories.add(arraydf);
110
111     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
112                                           "MsaResult");
113     cachedSerQNames.add(qName);
114     cls = vamsas.objects.simple.MsaResult.class;
115     cachedSerClasses.add(cls);
116     cachedSerFactories.add(beansf);
117     cachedDeserFactories.add(beandf);
118
119     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
120                                           "SequenceSet");
121     cachedSerQNames.add(qName);
122     cls = vamsas.objects.simple.SequenceSet.class;
123     cachedSerClasses.add(cls);
124     cachedSerFactories.add(beansf);
125     cachedDeserFactories.add(beandf);
126
127     qName = new javax.xml.namespace.QName("http://simple.objects.vamsas",
128                                           "Object");
129     cachedSerQNames.add(qName);
130     cls = vamsas.objects.simple.Object.class;
131     cachedSerClasses.add(cls);
132     cachedSerFactories.add(beansf);
133     cachedDeserFactories.add(beandf);
134
135     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
136                                           "Alignment");
137     cachedSerQNames.add(qName);
138     cls = vamsas.objects.simple.Alignment.class;
139     cachedSerClasses.add(cls);
140     cachedSerFactories.add(beansf);
141     cachedDeserFactories.add(beandf);
142
143     qName = new javax.xml.namespace.QName("simple.objects.vamsas", "WsJobId");
144     cachedSerQNames.add(qName);
145     cls = vamsas.objects.simple.WsJobId.class;
146     cachedSerClasses.add(cls);
147     cachedSerFactories.add(beansf);
148     cachedDeserFactories.add(beandf);
149
150     qName = new javax.xml.namespace.QName("vamsas", "ArrayOf_xsd_string");
151     cachedSerQNames.add(qName);
152     cls = java.lang.String[].class;
153     cachedSerClasses.add(cls);
154     cachedSerFactories.add(arraysf);
155     cachedDeserFactories.add(arraydf);
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
165   private static void _initOperationDesc1()
166   {
167     org.apache.axis.description.OperationDesc oper;
168     oper = new org.apache.axis.description.OperationDesc();
169     oper.setName("align");
170     oper.addParameter(new javax.xml.namespace.QName("", "seqSet"),
171                       new javax.xml.namespace.QName("simple.objects.vamsas",
172         "SequenceSet"),
173                       vamsas.objects.simple.SequenceSet.class,
174                       org.apache.axis.description.ParameterDesc.IN, false, false);
175     oper.setReturnType(new javax.xml.namespace.QName(
176         "simple.objects.vamsas", "WsJobId"));
177     oper.setReturnClass(vamsas.objects.simple.WsJobId.class);
178     oper.setReturnQName(new javax.xml.namespace.QName("", "alignReturn"));
179     oper.setStyle(org.apache.axis.constants.Style.RPC);
180     oper.setUse(org.apache.axis.constants.Use.ENCODED);
181     _operations[0] = oper;
182
183     oper = new org.apache.axis.description.OperationDesc();
184     oper.setName("getalign");
185     oper.addParameter(new javax.xml.namespace.QName("", "job_id"),
186                       new javax.xml.namespace.QName(
187         "http://www.w3.org/2001/XMLSchema",
188         "string"), java.lang.String.class,
189                       org.apache.axis.description.ParameterDesc.IN, false, false);
190     oper.setReturnType(new javax.xml.namespace.QName(
191         "simple.objects.vamsas", "Alignment"));
192     oper.setReturnClass(vamsas.objects.simple.Alignment.class);
193     oper.setReturnQName(new javax.xml.namespace.QName("", "getalignReturn"));
194     oper.setStyle(org.apache.axis.constants.Style.RPC);
195     oper.setUse(org.apache.axis.constants.Use.ENCODED);
196     _operations[1] = oper;
197
198     oper = new org.apache.axis.description.OperationDesc();
199     oper.setName("getResult");
200     oper.addParameter(new javax.xml.namespace.QName("", "job_id"),
201                       new javax.xml.namespace.QName(
202         "http://www.w3.org/2001/XMLSchema",
203         "string"), java.lang.String.class,
204                       org.apache.axis.description.ParameterDesc.IN, false, false);
205     oper.setReturnType(new javax.xml.namespace.QName(
206         "simple.objects.vamsas", "MsaResult"));
207     oper.setReturnClass(vamsas.objects.simple.MsaResult.class);
208     oper.setReturnQName(new javax.xml.namespace.QName("", "getResultReturn"));
209     oper.setStyle(org.apache.axis.constants.Style.RPC);
210     oper.setUse(org.apache.axis.constants.Use.ENCODED);
211     _operations[2] = oper;
212
213     oper = new org.apache.axis.description.OperationDesc();
214     oper.setName("cancel");
215     oper.addParameter(new javax.xml.namespace.QName("", "jobId"),
216                       new javax.xml.namespace.QName(
217         "http://www.w3.org/2001/XMLSchema",
218         "string"), java.lang.String.class,
219                       org.apache.axis.description.ParameterDesc.IN, false, false);
220     oper.setReturnType(new javax.xml.namespace.QName(
221         "simple.objects.vamsas", "WsJobId"));
222     oper.setReturnClass(vamsas.objects.simple.WsJobId.class);
223     oper.setReturnQName(new javax.xml.namespace.QName("", "cancelReturn"));
224     oper.setStyle(org.apache.axis.constants.Style.RPC);
225     oper.setUse(org.apache.axis.constants.Use.ENCODED);
226     _operations[3] = oper;
227   }
228
229   protected org.apache.axis.client.Call createCall()
230       throws java.rmi.RemoteException
231   {
232     try
233     {
234       org.apache.axis.client.Call _call = (org.apache.axis.client.Call)super.
235           service.createCall();
236
237       if (super.maintainSessionSet)
238       {
239         _call.setMaintainSession(super.maintainSession);
240       }
241
242       if (super.cachedUsername != null)
243       {
244         _call.setUsername(super.cachedUsername);
245       }
246
247       if (super.cachedPassword != null)
248       {
249         _call.setPassword(super.cachedPassword);
250       }
251
252       if (super.cachedEndpoint != null)
253       {
254         _call.setTargetEndpointAddress(super.cachedEndpoint);
255       }
256
257       if (super.cachedTimeout != null)
258       {
259         _call.setTimeout(super.cachedTimeout);
260       }
261
262       if (super.cachedPortName != null)
263       {
264         _call.setPortName(super.cachedPortName);
265       }
266
267       java.util.Enumeration keys = super.cachedProperties.keys();
268
269       while (keys.hasMoreElements())
270       {
271         java.lang.String key = (java.lang.String) keys.nextElement();
272         _call.setProperty(key, super.cachedProperties.get(key));
273       }
274
275       // All the type mapping information is registered
276       // when the first call is made.
277       // The type mapping information is actually registered in
278       // the TypeMappingRegistry of the service, which
279       // is the reason why registration is only needed for the first call.
280       synchronized (this)
281       {
282         if (firstCall())
283         {
284           // must set encoding style before registering serializers
285           _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.
286                                SOAP11_CONSTANTS);
287           _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
288
289           for (int i = 0; i < cachedSerFactories.size(); ++i)
290           {
291             java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
292             javax.xml.namespace.QName qName = (javax.xml.namespace.QName)
293                 cachedSerQNames.get(i);
294             java.lang.Class sf = (java.lang.Class) cachedSerFactories.get(i);
295             java.lang.Class df = (java.lang.Class) cachedDeserFactories.get(i);
296             _call.registerTypeMapping(cls, qName, sf, df, false);
297           }
298         }
299       }
300
301       return _call;
302     }
303     catch (java.lang.Throwable _t)
304     {
305       throw new org.apache.axis.AxisFault(
306           "Failure trying to get the Call object",
307           _t);
308     }
309   }
310
311   public vamsas.objects.simple.WsJobId align(
312       vamsas.objects.simple.SequenceSet seqSet)
313       throws java.rmi.RemoteException
314   {
315     if (super.cachedEndpoint == null)
316     {
317       throw new org.apache.axis.NoEndPointException();
318     }
319
320     org.apache.axis.client.Call _call = createCall();
321     _call.setOperation(_operations[0]);
322     _call.setUseSOAPAction(true);
323     _call.setSOAPActionURI("");
324     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
325     _call.setOperationName(new javax.xml.namespace.QName("vamsas", "align"));
326
327     setRequestHeaders(_call);
328     setAttachments(_call);
329
330     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
331                                           {seqSet});
332
333     if (_resp instanceof java.rmi.RemoteException)
334     {
335       throw (java.rmi.RemoteException) _resp;
336     }
337     else
338     {
339       extractAttachments(_call);
340
341       try
342       {
343         return (vamsas.objects.simple.WsJobId) _resp;
344       }
345       catch (java.lang.Exception _exception)
346       {
347         return (vamsas.objects.simple.WsJobId) org.apache.axis.utils.JavaUtils.
348             convert(_resp,
349                     vamsas.objects.simple.WsJobId.class);
350       }
351     }
352   }
353
354   public vamsas.objects.simple.Alignment getalign(java.lang.String job_id)
355       throws java.rmi.RemoteException
356   {
357     if (super.cachedEndpoint == null)
358     {
359       throw new org.apache.axis.NoEndPointException();
360     }
361
362     org.apache.axis.client.Call _call = createCall();
363     _call.setOperation(_operations[1]);
364     _call.setUseSOAPAction(true);
365     _call.setSOAPActionURI("");
366     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
367     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
368         "getalign"));
369
370     setRequestHeaders(_call);
371     setAttachments(_call);
372
373     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
374                                           {job_id});
375
376     if (_resp instanceof java.rmi.RemoteException)
377     {
378       throw (java.rmi.RemoteException) _resp;
379     }
380     else
381     {
382       extractAttachments(_call);
383
384       try
385       {
386         return (vamsas.objects.simple.Alignment) _resp;
387       }
388       catch (java.lang.Exception _exception)
389       {
390         return (vamsas.objects.simple.Alignment) org.apache.axis.utils.
391             JavaUtils.convert(_resp,
392                               vamsas.objects.simple.Alignment.class);
393       }
394     }
395   }
396
397   public vamsas.objects.simple.MsaResult getResult(java.lang.String job_id)
398       throws java.rmi.RemoteException
399   {
400     if (super.cachedEndpoint == null)
401     {
402       throw new org.apache.axis.NoEndPointException();
403     }
404
405     org.apache.axis.client.Call _call = createCall();
406     _call.setOperation(_operations[2]);
407     _call.setUseSOAPAction(true);
408     _call.setSOAPActionURI("");
409     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
410     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
411         "getResult"));
412
413     setRequestHeaders(_call);
414     setAttachments(_call);
415
416     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
417                                           {job_id});
418
419     if (_resp instanceof java.rmi.RemoteException)
420     {
421       throw (java.rmi.RemoteException) _resp;
422     }
423     else
424     {
425       extractAttachments(_call);
426
427       try
428       {
429         return (vamsas.objects.simple.MsaResult) _resp;
430       }
431       catch (java.lang.Exception _exception)
432       {
433         return (vamsas.objects.simple.MsaResult) org.apache.axis.utils.
434             JavaUtils.convert(_resp,
435                               vamsas.objects.simple.MsaResult.class);
436       }
437     }
438   }
439
440   public vamsas.objects.simple.WsJobId cancel(java.lang.String jobId)
441       throws java.rmi.RemoteException
442   {
443     if (super.cachedEndpoint == null)
444     {
445       throw new org.apache.axis.NoEndPointException();
446     }
447
448     org.apache.axis.client.Call _call = createCall();
449     _call.setOperation(_operations[3]);
450     _call.setUseSOAPAction(true);
451     _call.setSOAPActionURI("");
452     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
453     _call.setOperationName(new javax.xml.namespace.QName("vamsas", "cancel"));
454
455     setRequestHeaders(_call);
456     setAttachments(_call);
457
458     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
459                                           {jobId});
460
461     if (_resp instanceof java.rmi.RemoteException)
462     {
463       throw (java.rmi.RemoteException) _resp;
464     }
465     else
466     {
467       extractAttachments(_call);
468
469       try
470       {
471         return (vamsas.objects.simple.WsJobId) _resp;
472       }
473       catch (java.lang.Exception _exception)
474       {
475         return (vamsas.objects.simple.WsJobId) org.apache.axis.utils.JavaUtils.
476             convert(_resp,
477                     vamsas.objects.simple.WsJobId.class);
478       }
479     }
480   }
481 }