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
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 of the License, or (at your option) any later version.
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.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
20 public class MuscleWSServiceLocator extends org.apache.axis.client.Service
21 implements ext.vamsas.MuscleWSService
23 // Use to get a proxy class for MuscleWS
24 private java.lang.String MuscleWS_address = "http://anaplog.compbio.dundee.ac.uk:8080/axis/services/MuscleWS";
26 // The WSDD service name defaults to the port name.
27 private java.lang.String MuscleWSWSDDServiceName = "MuscleWS";
29 private java.util.HashSet ports = null;
31 public MuscleWSServiceLocator()
35 public MuscleWSServiceLocator(org.apache.axis.EngineConfiguration config)
40 public java.lang.String getMuscleWSAddress()
42 return MuscleWS_address;
45 public java.lang.String getMuscleWSWSDDServiceName()
47 return MuscleWSWSDDServiceName;
50 public void setMuscleWSWSDDServiceName(java.lang.String name)
52 MuscleWSWSDDServiceName = name;
55 public ext.vamsas.MuscleWS getMuscleWS()
56 throws javax.xml.rpc.ServiceException
58 java.net.URL endpoint;
62 endpoint = new java.net.URL(MuscleWS_address);
63 } catch (java.net.MalformedURLException e)
65 throw new javax.xml.rpc.ServiceException(e);
68 return getMuscleWS(endpoint);
71 public ext.vamsas.MuscleWS getMuscleWS(java.net.URL portAddress)
72 throws javax.xml.rpc.ServiceException
76 ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.MuscleWSSoapBindingStub(
78 _stub.setPortName(getMuscleWSWSDDServiceName());
81 } catch (org.apache.axis.AxisFault e)
87 public void setMuscleWSEndpointAddress(java.lang.String address)
89 MuscleWS_address = address;
93 * For the given interface, get the stub implementation. If this service has
94 * no port for the given interface, then ServiceException is thrown.
96 public java.rmi.Remote getPort(Class serviceEndpointInterface)
97 throws javax.xml.rpc.ServiceException
101 if (ext.vamsas.MuscleWS.class
102 .isAssignableFrom(serviceEndpointInterface))
104 ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.MuscleWSSoapBindingStub(
105 new java.net.URL(MuscleWS_address), this);
106 _stub.setPortName(getMuscleWSWSDDServiceName());
110 } catch (java.lang.Throwable t)
112 throw new javax.xml.rpc.ServiceException(t);
115 throw new javax.xml.rpc.ServiceException(
116 "There is no stub implementation for the interface: "
117 + ((serviceEndpointInterface == null) ? "null"
118 : serviceEndpointInterface.getName()));
122 * For the given interface, get the stub implementation. If this service has
123 * no port for the given interface, then ServiceException is thrown.
125 public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
126 Class serviceEndpointInterface)
127 throws javax.xml.rpc.ServiceException
129 if (portName == null)
131 return getPort(serviceEndpointInterface);
134 java.lang.String inputPortName = portName.getLocalPart();
136 if ("MuscleWS".equals(inputPortName))
138 return getMuscleWS();
142 java.rmi.Remote _stub = getPort(serviceEndpointInterface);
143 ((org.apache.axis.client.Stub) _stub).setPortName(portName);
149 public javax.xml.namespace.QName getServiceName()
151 return new javax.xml.namespace.QName("vamsas", "MuscleWSService");
154 public java.util.Iterator getPorts()
158 ports = new java.util.HashSet();
159 ports.add(new javax.xml.namespace.QName("vamsas", "MuscleWS"));
162 return ports.iterator();
166 * Set the endpoint address for the specified port name.
168 public void setEndpointAddress(java.lang.String portName,
169 java.lang.String address) throws javax.xml.rpc.ServiceException
171 if ("MuscleWS".equals(portName))
173 setMuscleWSEndpointAddress(address);
176 { // Unknown Port Name
177 throw new javax.xml.rpc.ServiceException(
178 " Cannot set Endpoint Address for Unknown Port" + portName);
183 * Set the endpoint address for the specified port name.
185 public void setEndpointAddress(javax.xml.namespace.QName portName,
186 java.lang.String address) throws javax.xml.rpc.ServiceException
188 setEndpointAddress(portName.getLocalPart(), address);