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