Formatted source
[jalview.git] / src / ext / vamsas / JPredWSServiceLocator.java
1 /**
2  * JPredWSServiceLocator.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis 1.2RC2 Nov 16, 2004 (12:19:44 EST) WSDL2Java emitter.
6  */\r
7 \r
8 /*
9 * Jalview - A Sequence Alignment Editor and Viewer
10 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
25 */\r
26 package ext.vamsas;\r
27 \r
28 public class JPredWSServiceLocator extends org.apache.axis.client.Service\r
29     implements ext.vamsas.JPredWSService {\r
30     // Use to get a proxy class for jpred\r
31     private java.lang.String jpred_address = "http://anaplog.compbio.dundee.ac.uk:8080/axis/services/jpred";\r
32 \r
33     // The WSDD service name defaults to the port name.\r
34     private java.lang.String jpredWSDDServiceName = "jpred";\r
35     private java.util.HashSet ports = null;\r
36 \r
37     public JPredWSServiceLocator() {\r
38     }\r
39 \r
40     public JPredWSServiceLocator(org.apache.axis.EngineConfiguration config) {\r
41         super(config);\r
42     }\r
43 \r
44     public java.lang.String getjpredAddress() {\r
45         return jpred_address;\r
46     }\r
47 \r
48     public java.lang.String getjpredWSDDServiceName() {\r
49         return jpredWSDDServiceName;\r
50     }\r
51 \r
52     public void setjpredWSDDServiceName(java.lang.String name) {\r
53         jpredWSDDServiceName = name;\r
54     }\r
55 \r
56     public ext.vamsas.JPredWS getjpred() throws javax.xml.rpc.ServiceException {\r
57         java.net.URL endpoint;\r
58 \r
59         try {\r
60             endpoint = new java.net.URL(jpred_address);\r
61         } catch (java.net.MalformedURLException e) {\r
62             throw new javax.xml.rpc.ServiceException(e);\r
63         }\r
64 \r
65         return getjpred(endpoint);\r
66     }\r
67 \r
68     public ext.vamsas.JPredWS getjpred(java.net.URL portAddress)\r
69         throws javax.xml.rpc.ServiceException {\r
70         try {\r
71             ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(portAddress,\r
72                     this);\r
73             _stub.setPortName(getjpredWSDDServiceName());\r
74 \r
75             return _stub;\r
76         } catch (org.apache.axis.AxisFault e) {\r
77             return null;\r
78         }\r
79     }\r
80 \r
81     public void setjpredEndpointAddress(java.lang.String address) {\r
82         jpred_address = address;\r
83     }\r
84 \r
85     /**
86  * For the given interface, get the stub implementation.
87  * If this service has no port for the given interface,
88  * then ServiceException is thrown.
89  */\r
90     public java.rmi.Remote getPort(Class serviceEndpointInterface)\r
91         throws javax.xml.rpc.ServiceException {\r
92         try {\r
93             if (ext.vamsas.JPredWS.class.isAssignableFrom(\r
94                         serviceEndpointInterface)) {\r
95                 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(new java.net.URL(\r
96                             jpred_address), this);\r
97                 _stub.setPortName(getjpredWSDDServiceName());\r
98 \r
99                 return _stub;\r
100             }\r
101         } catch (java.lang.Throwable t) {\r
102             throw new javax.xml.rpc.ServiceException(t);\r
103         }\r
104 \r
105         throw new javax.xml.rpc.ServiceException(\r
106             "There is no stub implementation for the interface:  " +\r
107             ((serviceEndpointInterface == null) ? "null"\r
108                                                 : serviceEndpointInterface.getName()));\r
109     }\r
110 \r
111     /**
112  * For the given interface, get the stub implementation.
113  * If this service has no port for the given interface,
114  * then ServiceException is thrown.
115  */\r
116     public java.rmi.Remote getPort(javax.xml.namespace.QName portName,\r
117         Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {\r
118         if (portName == null) {\r
119             return getPort(serviceEndpointInterface);\r
120         }\r
121 \r
122         java.lang.String inputPortName = portName.getLocalPart();\r
123 \r
124         if ("jpred".equals(inputPortName)) {\r
125             return getjpred();\r
126         } else {\r
127             java.rmi.Remote _stub = getPort(serviceEndpointInterface);\r
128             ((org.apache.axis.client.Stub) _stub).setPortName(portName);\r
129 \r
130             return _stub;\r
131         }\r
132     }\r
133 \r
134     public javax.xml.namespace.QName getServiceName() {\r
135         return new javax.xml.namespace.QName("vamsas", "JPredWSService");\r
136     }\r
137 \r
138     public java.util.Iterator getPorts() {\r
139         if (ports == null) {\r
140             ports = new java.util.HashSet();\r
141             ports.add(new javax.xml.namespace.QName("vamsas", "jpred"));\r
142         }\r
143 \r
144         return ports.iterator();\r
145     }\r
146 \r
147     /**
148 * Set the endpoint address for the specified port name.
149 */\r
150     public void setEndpointAddress(java.lang.String portName,\r
151         java.lang.String address) throws javax.xml.rpc.ServiceException {\r
152         if ("jpred".equals(portName)) {\r
153             setjpredEndpointAddress(address);\r
154         } else { // Unknown Port Name\r
155             throw new javax.xml.rpc.ServiceException(\r
156                 " Cannot set Endpoint Address for Unknown Port" + portName);\r
157         }\r
158     }\r
159 \r
160     /**
161 * Set the endpoint address for the specified port name.
162 */\r
163     public void setEndpointAddress(javax.xml.namespace.QName portName,\r
164         java.lang.String address) throws javax.xml.rpc.ServiceException {\r
165         setEndpointAddress(portName.getLocalPart(), address);\r
166     }\r
167 }\r