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