af51043c5327c5a45d7439a67e0e20ec71627e32
[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  */
7
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 */
26
27 package ext.vamsas;
28
29 public class JPredWSServiceLocator extends org.apache.axis.client.Service implements ext.vamsas.JPredWSService {
30
31     public JPredWSServiceLocator() {
32     }
33
34
35     public JPredWSServiceLocator(org.apache.axis.EngineConfiguration config) {
36         super(config);
37     }
38
39     // Use to get a proxy class for jpred
40     private java.lang.String jpred_address = "http://anaplog.compbio.dundee.ac.uk:8080/axis/services/jpred";
41
42     public java.lang.String getjpredAddress() {
43         return jpred_address;
44     }
45
46     // The WSDD service name defaults to the port name.
47     private java.lang.String jpredWSDDServiceName = "jpred";
48
49     public java.lang.String getjpredWSDDServiceName() {
50         return jpredWSDDServiceName;
51     }
52
53     public void setjpredWSDDServiceName(java.lang.String name) {
54         jpredWSDDServiceName = name;
55     }
56
57     public ext.vamsas.JPredWS getjpred() throws javax.xml.rpc.ServiceException {
58        java.net.URL endpoint;
59         try {
60             endpoint = new java.net.URL(jpred_address);
61         }
62         catch (java.net.MalformedURLException e) {
63             throw new javax.xml.rpc.ServiceException(e);
64         }
65         return getjpred(endpoint);
66     }
67
68     public ext.vamsas.JPredWS getjpred(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
69         try {
70             ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(portAddress, this);
71             _stub.setPortName(getjpredWSDDServiceName());
72             return _stub;
73         }
74         catch (org.apache.axis.AxisFault e) {
75             return null;
76         }
77     }
78
79     public void setjpredEndpointAddress(java.lang.String address) {
80         jpred_address = address;
81     }
82
83     /**
84      * For the given interface, get the stub implementation.
85      * If this service has no port for the given interface,
86      * then ServiceException is thrown.
87      */
88     public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
89         try {
90             if (ext.vamsas.JPredWS.class.isAssignableFrom(serviceEndpointInterface)) {
91                 ext.vamsas.JpredSoapBindingStub _stub = new ext.vamsas.JpredSoapBindingStub(new java.net.URL(jpred_address), this);
92                 _stub.setPortName(getjpredWSDDServiceName());
93                 return _stub;
94             }
95         }
96         catch (java.lang.Throwable t) {
97             throw new javax.xml.rpc.ServiceException(t);
98         }
99         throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
100     }
101
102     /**
103      * For the given interface, get the stub implementation.
104      * If this service has no port for the given interface,
105      * then ServiceException is thrown.
106      */
107     public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
108         if (portName == null) {
109             return getPort(serviceEndpointInterface);
110         }
111         java.lang.String inputPortName = portName.getLocalPart();
112         if ("jpred".equals(inputPortName)) {
113             return getjpred();
114         }
115         else  {
116             java.rmi.Remote _stub = getPort(serviceEndpointInterface);
117             ((org.apache.axis.client.Stub) _stub).setPortName(portName);
118             return _stub;
119         }
120     }
121
122     public javax.xml.namespace.QName getServiceName() {
123         return new javax.xml.namespace.QName("vamsas", "JPredWSService");
124     }
125
126     private java.util.HashSet ports = null;
127
128     public java.util.Iterator getPorts() {
129         if (ports == null) {
130             ports = new java.util.HashSet();
131             ports.add(new javax.xml.namespace.QName("vamsas", "jpred"));
132         }
133         return ports.iterator();
134     }
135
136     /**
137     * Set the endpoint address for the specified port name.
138     */
139     public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
140         if ("jpred".equals(portName)) {
141             setjpredEndpointAddress(address);
142         }
143         else { // Unknown Port Name
144             throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
145         }
146     }
147
148     /**
149     * Set the endpoint address for the specified port name.
150     */
151     public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
152         setEndpointAddress(portName.getLocalPart(), address);
153     }
154
155 }