apply gpl development license
[jalview.git] / src / ext / vamsas / JpredSoapBindingStub.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 package ext.vamsas;
20
21 public class JpredSoapBindingStub extends org.apache.axis.client.Stub
22         implements ext.vamsas.Jpred
23 {
24   private java.util.Vector cachedSerClasses = new java.util.Vector();
25
26   private java.util.Vector cachedSerQNames = new java.util.Vector();
27
28   private java.util.Vector cachedSerFactories = new java.util.Vector();
29
30   private java.util.Vector cachedDeserFactories = new java.util.Vector();
31
32   static org.apache.axis.description.OperationDesc[] _operations;
33
34   static
35   {
36     _operations = new org.apache.axis.description.OperationDesc[4];
37     _initOperationDesc1();
38   }
39
40   private static void _initOperationDesc1()
41   {
42     org.apache.axis.description.OperationDesc oper;
43     oper = new org.apache.axis.description.OperationDesc();
44     oper.setName("predict");
45     oper.addParameter(new javax.xml.namespace.QName("", "seq"),
46             new javax.xml.namespace.QName("simple.objects.vamsas",
47                     "Sequence"), vamsas.objects.simple.Sequence.class,
48             org.apache.axis.description.ParameterDesc.IN, false, false);
49     oper.setReturnType(new javax.xml.namespace.QName(
50             "http://www.w3.org/2001/XMLSchema", "string"));
51     oper.setReturnClass(java.lang.String.class);
52     oper.setReturnQName(new javax.xml.namespace.QName("", "predictReturn"));
53     oper.setStyle(org.apache.axis.constants.Style.RPC);
54     oper.setUse(org.apache.axis.constants.Use.ENCODED);
55     _operations[0] = oper;
56
57     oper = new org.apache.axis.description.OperationDesc();
58     oper.setName("predictOnMsa");
59     oper.addParameter(new javax.xml.namespace.QName("", "msf"),
60             new javax.xml.namespace.QName("http://simple.objects.vamsas",
61                     "Msfalignment"),
62             vamsas.objects.simple.Msfalignment.class,
63             org.apache.axis.description.ParameterDesc.IN, false, false);
64     oper.setReturnType(new javax.xml.namespace.QName(
65             "http://www.w3.org/2001/XMLSchema", "string"));
66     oper.setReturnClass(java.lang.String.class);
67     oper.setReturnQName(new javax.xml.namespace.QName("",
68             "predictOnMsaReturn"));
69     oper.setStyle(org.apache.axis.constants.Style.RPC);
70     oper.setUse(org.apache.axis.constants.Use.ENCODED);
71     _operations[1] = oper;
72
73     oper = new org.apache.axis.description.OperationDesc();
74     oper.setName("getpredict");
75     oper.addParameter(new javax.xml.namespace.QName("", "job_id"),
76             new javax.xml.namespace.QName(
77                     "http://www.w3.org/2001/XMLSchema", "string"),
78             java.lang.String.class,
79             org.apache.axis.description.ParameterDesc.IN, false, false);
80     oper.setReturnType(new javax.xml.namespace.QName(
81             "http://simple.objects.vamsas", "Secstructpred"));
82     oper.setReturnClass(vamsas.objects.simple.Secstructpred.class);
83     oper.setReturnQName(new javax.xml.namespace.QName("",
84             "getpredictReturn"));
85     oper.setStyle(org.apache.axis.constants.Style.RPC);
86     oper.setUse(org.apache.axis.constants.Use.ENCODED);
87     _operations[2] = oper;
88
89     oper = new org.apache.axis.description.OperationDesc();
90     oper.setName("getresult");
91     oper.addParameter(new javax.xml.namespace.QName("", "job_id"),
92             new javax.xml.namespace.QName(
93                     "http://www.w3.org/2001/XMLSchema", "string"),
94             java.lang.String.class,
95             org.apache.axis.description.ParameterDesc.IN, false, false);
96     oper.setReturnType(new javax.xml.namespace.QName(
97             "http://simple.objects.vamsas", "JpredResult"));
98     oper.setReturnClass(vamsas.objects.simple.JpredResult.class);
99     oper
100             .setReturnQName(new javax.xml.namespace.QName("",
101                     "getresultReturn"));
102     oper.setStyle(org.apache.axis.constants.Style.RPC);
103     oper.setUse(org.apache.axis.constants.Use.ENCODED);
104     _operations[3] = oper;
105
106   }
107
108   public JpredSoapBindingStub() throws org.apache.axis.AxisFault
109   {
110     this(null);
111   }
112
113   public JpredSoapBindingStub(java.net.URL endpointURL,
114           javax.xml.rpc.Service service) throws org.apache.axis.AxisFault
115   {
116     this(service);
117     super.cachedEndpoint = endpointURL;
118   }
119
120   public JpredSoapBindingStub(javax.xml.rpc.Service service)
121           throws org.apache.axis.AxisFault
122   {
123     if (service == null)
124     {
125       super.service = new org.apache.axis.client.Service();
126     }
127     else
128     {
129       super.service = service;
130     }
131     java.lang.Class cls;
132     javax.xml.namespace.QName qName;
133     java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
134     java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
135     /*
136      * java.lang.Class enumsf =
137      * org.apache.axis.encoding.ser.EnumSerializerFactory.class; java.lang.Class
138      * enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
139      * java.lang.Class arraysf =
140      * org.apache.axis.encoding.ser.ArraySerializerFactory.class;
141      * java.lang.Class arraydf =
142      * org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
143      * java.lang.Class simplesf =
144      * org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
145      * java.lang.Class simpledf =
146      * org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
147      * java.lang.Class simplelistsf =
148      * org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
149      * java.lang.Class simplelistdf =
150      * org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
151      */
152     qName = new javax.xml.namespace.QName("http://simple.objects.vamsas",
153             "JpredResult");
154     cachedSerQNames.add(qName);
155     cls = vamsas.objects.simple.JpredResult.class;
156     cachedSerClasses.add(cls);
157     cachedSerFactories.add(beansf);
158     cachedDeserFactories.add(beandf);
159
160     qName = new javax.xml.namespace.QName("simple.objects.vamsas", "Result");
161     cachedSerQNames.add(qName);
162     cls = vamsas.objects.simple.Result.class;
163     cachedSerClasses.add(cls);
164     cachedSerFactories.add(beansf);
165     cachedDeserFactories.add(beandf);
166
167     qName = new javax.xml.namespace.QName("http://simple.objects.vamsas",
168             "Secstructpred");
169     cachedSerQNames.add(qName);
170     cls = vamsas.objects.simple.Secstructpred.class;
171     cachedSerClasses.add(cls);
172     cachedSerFactories.add(beansf);
173     cachedDeserFactories.add(beandf);
174
175     qName = new javax.xml.namespace.QName("http://simple.objects.vamsas",
176             "Msfalignment");
177     cachedSerQNames.add(qName);
178     cls = vamsas.objects.simple.Msfalignment.class;
179     cachedSerClasses.add(cls);
180     cachedSerFactories.add(beansf);
181     cachedDeserFactories.add(beandf);
182
183     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
184             "Sequence");
185     cachedSerQNames.add(qName);
186     cls = vamsas.objects.simple.Sequence.class;
187     cachedSerClasses.add(cls);
188     cachedSerFactories.add(beansf);
189     cachedDeserFactories.add(beandf);
190
191   }
192
193   protected org.apache.axis.client.Call createCall()
194           throws java.rmi.RemoteException
195   {
196     try
197     {
198       org.apache.axis.client.Call _call = (org.apache.axis.client.Call) super.service
199               .createCall();
200       if (super.maintainSessionSet)
201       {
202         _call.setMaintainSession(super.maintainSession);
203       }
204       if (super.cachedUsername != null)
205       {
206         _call.setUsername(super.cachedUsername);
207       }
208       if (super.cachedPassword != null)
209       {
210         _call.setPassword(super.cachedPassword);
211       }
212       if (super.cachedEndpoint != null)
213       {
214         _call.setTargetEndpointAddress(super.cachedEndpoint);
215       }
216       if (super.cachedTimeout != null)
217       {
218         _call.setTimeout(super.cachedTimeout);
219       }
220       if (super.cachedPortName != null)
221       {
222         _call.setPortName(super.cachedPortName);
223       }
224       java.util.Enumeration keys = super.cachedProperties.keys();
225       while (keys.hasMoreElements())
226       {
227         java.lang.String key = (java.lang.String) keys.nextElement();
228         _call.setProperty(key, super.cachedProperties.get(key));
229       }
230       // All the type mapping information is registered
231       // when the first call is made.
232       // The type mapping information is actually registered in
233       // the TypeMappingRegistry of the service, which
234       // is the reason why registration is only needed for the first call.
235       synchronized (this)
236       {
237         if (firstCall())
238         {
239           // must set encoding style before registering serializers
240           _call
241                   .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
242           _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
243           for (int i = 0; i < cachedSerFactories.size(); ++i)
244           {
245             java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
246             javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames
247                     .get(i);
248             java.lang.Class sf = (java.lang.Class) cachedSerFactories
249                     .get(i);
250             java.lang.Class df = (java.lang.Class) cachedDeserFactories
251                     .get(i);
252             _call.registerTypeMapping(cls, qName, sf, df, false);
253           }
254         }
255       }
256       return _call;
257     } catch (java.lang.Throwable _t)
258     {
259       throw new org.apache.axis.AxisFault(
260               "Failure trying to get the Call object", _t);
261     }
262   }
263
264   public java.lang.String predict(vamsas.objects.simple.Sequence seq)
265           throws java.rmi.RemoteException
266   {
267     if (super.cachedEndpoint == null)
268     {
269       throw new org.apache.axis.NoEndPointException();
270     }
271     org.apache.axis.client.Call _call = createCall();
272     _call.setOperation(_operations[0]);
273     _call.setUseSOAPAction(true);
274     _call.setSOAPActionURI("");
275     _call
276             .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
277     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
278             "predict"));
279
280     setRequestHeaders(_call);
281     setAttachments(_call);
282     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
283     { seq });
284
285     if (_resp instanceof java.rmi.RemoteException)
286     {
287       throw (java.rmi.RemoteException) _resp;
288     }
289     else
290     {
291       extractAttachments(_call);
292       try
293       {
294         return (java.lang.String) _resp;
295       } catch (java.lang.Exception _exception)
296       {
297         return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(
298                 _resp, java.lang.String.class);
299       }
300     }
301   }
302
303   public java.lang.String predictOnMsa(
304           vamsas.objects.simple.Msfalignment msf)
305           throws java.rmi.RemoteException
306   {
307     if (super.cachedEndpoint == null)
308     {
309       throw new org.apache.axis.NoEndPointException();
310     }
311     org.apache.axis.client.Call _call = createCall();
312     _call.setOperation(_operations[1]);
313     _call.setUseSOAPAction(true);
314     _call.setSOAPActionURI("");
315     _call
316             .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
317     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
318             "predictOnMsa"));
319
320     setRequestHeaders(_call);
321     setAttachments(_call);
322     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
323     { msf });
324
325     if (_resp instanceof java.rmi.RemoteException)
326     {
327       throw (java.rmi.RemoteException) _resp;
328     }
329     else
330     {
331       extractAttachments(_call);
332       try
333       {
334         return (java.lang.String) _resp;
335       } catch (java.lang.Exception _exception)
336       {
337         return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(
338                 _resp, java.lang.String.class);
339       }
340     }
341   }
342
343   public vamsas.objects.simple.Secstructpred getpredict(
344           java.lang.String job_id) throws java.rmi.RemoteException
345   {
346     if (super.cachedEndpoint == null)
347     {
348       throw new org.apache.axis.NoEndPointException();
349     }
350     org.apache.axis.client.Call _call = createCall();
351     _call.setOperation(_operations[2]);
352     _call.setUseSOAPAction(true);
353     _call.setSOAPActionURI("");
354     _call
355             .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
356     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
357             "getpredict"));
358
359     setRequestHeaders(_call);
360     setAttachments(_call);
361     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
362     { job_id });
363
364     if (_resp instanceof java.rmi.RemoteException)
365     {
366       throw (java.rmi.RemoteException) _resp;
367     }
368     else
369     {
370       extractAttachments(_call);
371       try
372       {
373         return (vamsas.objects.simple.Secstructpred) _resp;
374       } catch (java.lang.Exception _exception)
375       {
376         return (vamsas.objects.simple.Secstructpred) org.apache.axis.utils.JavaUtils
377                 .convert(_resp, vamsas.objects.simple.Secstructpred.class);
378       }
379     }
380   }
381
382   public vamsas.objects.simple.JpredResult getresult(java.lang.String job_id)
383           throws java.rmi.RemoteException
384   {
385     if (super.cachedEndpoint == null)
386     {
387       throw new org.apache.axis.NoEndPointException();
388     }
389     org.apache.axis.client.Call _call = createCall();
390     _call.setOperation(_operations[3]);
391     _call.setUseSOAPAction(true);
392     _call.setSOAPActionURI("");
393     _call
394             .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
395     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
396             "getresult"));
397
398     setRequestHeaders(_call);
399     setAttachments(_call);
400     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
401     { 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       try
411       {
412         return (vamsas.objects.simple.JpredResult) _resp;
413       } catch (java.lang.Exception _exception)
414       {
415         return (vamsas.objects.simple.JpredResult) org.apache.axis.utils.JavaUtils
416                 .convert(_resp, vamsas.objects.simple.JpredResult.class);
417       }
418     }
419   }
420
421 }