2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.util.MessageManager;
25 public class MuscleWSServiceLocator extends org.apache.axis.client.Service
26 implements ext.vamsas.MuscleWSService
28 // Use to get a proxy class for MuscleWS
29 private java.lang.String MuscleWS_address = "http://anaplog.compbio.dundee.ac.uk:8080/axis/services/MuscleWS";
31 // The WSDD service name defaults to the port name.
32 private java.lang.String MuscleWSWSDDServiceName = "MuscleWS";
34 private java.util.HashSet ports = null;
36 public MuscleWSServiceLocator()
40 public MuscleWSServiceLocator(org.apache.axis.EngineConfiguration config)
45 public java.lang.String getMuscleWSAddress()
47 return MuscleWS_address;
50 public java.lang.String getMuscleWSWSDDServiceName()
52 return MuscleWSWSDDServiceName;
55 public void setMuscleWSWSDDServiceName(java.lang.String name)
57 MuscleWSWSDDServiceName = name;
60 public ext.vamsas.MuscleWS getMuscleWS()
61 throws javax.xml.rpc.ServiceException
63 java.net.URL endpoint;
67 endpoint = new java.net.URL(MuscleWS_address);
68 } catch (java.net.MalformedURLException e)
70 throw new javax.xml.rpc.ServiceException(e);
73 return getMuscleWS(endpoint);
76 public ext.vamsas.MuscleWS getMuscleWS(java.net.URL portAddress)
77 throws javax.xml.rpc.ServiceException
81 ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.MuscleWSSoapBindingStub(
83 _stub.setPortName(getMuscleWSWSDDServiceName());
86 } catch (org.apache.axis.AxisFault e)
92 public void setMuscleWSEndpointAddress(java.lang.String address)
94 MuscleWS_address = address;
98 * For the given interface, get the stub implementation. If this service has
99 * no port for the given interface, then ServiceException is thrown.
101 public java.rmi.Remote getPort(Class serviceEndpointInterface)
102 throws javax.xml.rpc.ServiceException
106 if (ext.vamsas.MuscleWS.class
107 .isAssignableFrom(serviceEndpointInterface))
109 ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.MuscleWSSoapBindingStub(
110 new java.net.URL(MuscleWS_address), this);
111 _stub.setPortName(getMuscleWSWSDDServiceName());
115 } catch (java.lang.Throwable t)
117 throw new javax.xml.rpc.ServiceException(t);
120 throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage(
121 "exception.no_stub_implementation_for_interface",
122 new String[] { (serviceEndpointInterface == null ? "null"
123 : serviceEndpointInterface.getName()) }));
127 * For the given interface, get the stub implementation. If this service has
128 * no port for the given interface, then ServiceException is thrown.
130 public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
131 Class serviceEndpointInterface)
132 throws javax.xml.rpc.ServiceException
134 if (portName == null)
136 return getPort(serviceEndpointInterface);
139 java.lang.String inputPortName = portName.getLocalPart();
141 if ("MuscleWS".equals(inputPortName))
143 return getMuscleWS();
147 java.rmi.Remote _stub = getPort(serviceEndpointInterface);
148 ((org.apache.axis.client.Stub) _stub).setPortName(portName);
154 public javax.xml.namespace.QName getServiceName()
156 return new javax.xml.namespace.QName("vamsas", "MuscleWSService");
159 public java.util.Iterator getPorts()
163 ports = new java.util.HashSet();
164 ports.add(new javax.xml.namespace.QName("vamsas", "MuscleWS"));
167 return ports.iterator();
171 * Set the endpoint address for the specified port name.
173 public void setEndpointAddress(java.lang.String portName,
174 java.lang.String address) throws javax.xml.rpc.ServiceException
176 if ("MuscleWS".equals(portName))
178 setMuscleWSEndpointAddress(address);
181 { // Unknown Port Name
182 throw new javax.xml.rpc.ServiceException(
183 MessageManager.formatMessage(
184 "exception.cannot_set_endpoint_address_unknown_port",
185 new String[] { portName }));
190 * Set the endpoint address for the specified port name.
192 public void setEndpointAddress(javax.xml.namespace.QName portName,
193 java.lang.String address) throws javax.xml.rpc.ServiceException
195 setEndpointAddress(portName.getLocalPart(), address);