JAL-1432 updated copyright notices
[jalview.git] / src / ext / vamsas / RegistryServiceSoapBindingStub.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 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 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  * The Jalview Authors are detailed in the 'AUTHORS' file.
18  */
19 package ext.vamsas;
20
21 public class RegistryServiceSoapBindingStub extends
22         org.apache.axis.client.Stub implements ext.vamsas.IRegistry
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[1];
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("getServices");
45     oper.setReturnType(new javax.xml.namespace.QName(
46             "registry.objects.vamsas", "ServiceHandles"));
47     oper.setReturnClass(ext.vamsas.ServiceHandles.class);
48     oper.setReturnQName(new javax.xml.namespace.QName("",
49             "getServicesReturn"));
50     oper.setStyle(org.apache.axis.constants.Style.RPC);
51     oper.setUse(org.apache.axis.constants.Use.ENCODED);
52     _operations[0] = oper;
53
54   }
55
56   public RegistryServiceSoapBindingStub() throws org.apache.axis.AxisFault
57   {
58     this(null);
59   }
60
61   public RegistryServiceSoapBindingStub(java.net.URL endpointURL,
62           javax.xml.rpc.Service service) throws org.apache.axis.AxisFault
63   {
64     this(service);
65     super.cachedEndpoint = endpointURL;
66   }
67
68   public RegistryServiceSoapBindingStub(javax.xml.rpc.Service service)
69           throws org.apache.axis.AxisFault
70   {
71     if (service == null)
72     {
73       super.service = new org.apache.axis.client.Service();
74     }
75     else
76     {
77       super.service = service;
78     }
79     java.lang.Class cls;
80     javax.xml.namespace.QName qName;
81     java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
82     java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
83     // java.lang.Class enumsf =
84     // org.apache.axis.encoding.ser.EnumSerializerFactory.class;
85     // java.lang.Class enumdf =
86     // org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
87     java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
88     java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
89     // java.lang.Class simplesf =
90     // org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
91     // java.lang.Class simpledf =
92     // org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
93     // java.lang.Class simplelistsf =
94     // org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
95     // java.lang.Class simplelistdf =
96     // org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
97     qName = new javax.xml.namespace.QName("vamsas",
98             "ArrayOf_tns1_ServiceHandle");
99     cachedSerQNames.add(qName);
100     cls = ext.vamsas.ServiceHandle[].class;
101     cachedSerClasses.add(cls);
102     cachedSerFactories.add(arraysf);
103     cachedDeserFactories.add(arraydf);
104
105     qName = new javax.xml.namespace.QName("registry.objects.vamsas",
106             "ServiceHandles");
107     cachedSerQNames.add(qName);
108     cls = ext.vamsas.ServiceHandles.class;
109     cachedSerClasses.add(cls);
110     cachedSerFactories.add(beansf);
111     cachedDeserFactories.add(beandf);
112
113     qName = new javax.xml.namespace.QName("registry.objects.vamsas",
114             "ServiceHandle");
115     cachedSerQNames.add(qName);
116     cls = ext.vamsas.ServiceHandle.class;
117     cachedSerClasses.add(cls);
118     cachedSerFactories.add(beansf);
119     cachedDeserFactories.add(beandf);
120
121   }
122
123   protected org.apache.axis.client.Call createCall()
124           throws java.rmi.RemoteException
125   {
126     try
127     {
128       org.apache.axis.client.Call _call = (org.apache.axis.client.Call) super.service
129               .createCall();
130       if (super.maintainSessionSet)
131       {
132         _call.setMaintainSession(super.maintainSession);
133       }
134       if (super.cachedUsername != null)
135       {
136         _call.setUsername(super.cachedUsername);
137       }
138       if (super.cachedPassword != null)
139       {
140         _call.setPassword(super.cachedPassword);
141       }
142       if (super.cachedEndpoint != null)
143       {
144         _call.setTargetEndpointAddress(super.cachedEndpoint);
145       }
146       if (super.cachedTimeout != null)
147       {
148         _call.setTimeout(super.cachedTimeout);
149       }
150       if (super.cachedPortName != null)
151       {
152         _call.setPortName(super.cachedPortName);
153       }
154       java.util.Enumeration keys = super.cachedProperties.keys();
155       while (keys.hasMoreElements())
156       {
157         java.lang.String key = (java.lang.String) keys.nextElement();
158         _call.setProperty(key, super.cachedProperties.get(key));
159       }
160       // All the type mapping information is registered
161       // when the first call is made.
162       // The type mapping information is actually registered in
163       // the TypeMappingRegistry of the service, which
164       // is the reason why registration is only needed for the first call.
165       synchronized (this)
166       {
167         if (firstCall())
168         {
169           // must set encoding style before registering serializers
170           _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
171           _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
172           for (int i = 0; i < cachedSerFactories.size(); ++i)
173           {
174             java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
175             javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames
176                     .get(i);
177             java.lang.Class sf = (java.lang.Class) cachedSerFactories
178                     .get(i);
179             java.lang.Class df = (java.lang.Class) cachedDeserFactories
180                     .get(i);
181             _call.registerTypeMapping(cls, qName, sf, df, false);
182           }
183         }
184       }
185       return _call;
186     } catch (java.lang.Throwable _t)
187     {
188       throw new org.apache.axis.AxisFault(
189               "Failure trying to get the Call object", _t);
190     }
191   }
192
193   public ext.vamsas.ServiceHandles getServices()
194           throws java.rmi.RemoteException
195   {
196     if (super.cachedEndpoint == null)
197     {
198       throw new org.apache.axis.NoEndPointException();
199     }
200     org.apache.axis.client.Call _call = createCall();
201     _call.setOperation(_operations[0]);
202     _call.setUseSOAPAction(true);
203     _call.setSOAPActionURI("");
204     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
205     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
206             "getServices"));
207
208     setRequestHeaders(_call);
209     setAttachments(_call);
210     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
211     {});
212
213     if (_resp instanceof java.rmi.RemoteException)
214     {
215       throw (java.rmi.RemoteException) _resp;
216     }
217     else
218     {
219       extractAttachments(_call);
220       try
221       {
222         return (ext.vamsas.ServiceHandles) _resp;
223       } catch (java.lang.Exception _exception)
224       {
225         return (ext.vamsas.ServiceHandles) org.apache.axis.utils.JavaUtils
226                 .convert(_resp, ext.vamsas.ServiceHandles.class);
227       }
228     }
229   }
230
231 }