// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
/**
 * TestObjectsServiceLocator.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis WSDL2Java emitter.
 */

package ws.stub;

public class TestObjectsServiceLocator extends org.apache.axis.client.Service implements ws.stub.TestObjectsService {

    // Use to get a proxy class for TestObjectsService
    private final java.lang.String TestObjectsService_address = "http://localhost:8080/axis/services/TestObjectsService";

    public java.lang.String getTestObjectsServiceAddress() {
        return TestObjectsService_address;
    }

    // The WSDD service name defaults to the port name.
    private java.lang.String TestObjectsServiceWSDDServiceName = "TestObjectsService";

    public java.lang.String getTestObjectsServiceWSDDServiceName() {
        return TestObjectsServiceWSDDServiceName;
    }

    public void setTestObjectsServiceWSDDServiceName(java.lang.String name) {
        TestObjectsServiceWSDDServiceName = name;
    }

    public ws.stub.TestObjects getTestObjectsService() throws javax.xml.rpc.ServiceException {
       java.net.URL endpoint;
        try {
            endpoint = new java.net.URL(TestObjectsService_address);
        }
        catch (java.net.MalformedURLException e) {
            throw new javax.xml.rpc.ServiceException(e);
        }
        return getTestObjectsService(endpoint);
    }

    public ws.stub.TestObjects getTestObjectsService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
        try {
            ws.stub.TestObjectsServiceSoapBindingStub _stub = new ws.stub.TestObjectsServiceSoapBindingStub(portAddress, this);
            _stub.setPortName(getTestObjectsServiceWSDDServiceName());
            return _stub;
        }
        catch (org.apache.axis.AxisFault e) {
            return null;
        }
    }

    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (ws.stub.TestObjects.class.isAssignableFrom(serviceEndpointInterface)) {
                ws.stub.TestObjectsServiceSoapBindingStub _stub = new ws.stub.TestObjectsServiceSoapBindingStub(new java.net.URL(TestObjectsService_address), this);
                _stub.setPortName(getTestObjectsServiceWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }

    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        if (portName == null) {
            return getPort(serviceEndpointInterface);
        }
        String inputPortName = portName.getLocalPart();
        if ("TestObjectsService".equals(inputPortName)) {
            return getTestObjectsService();
        }
        else  {
            java.rmi.Remote _stub = getPort(serviceEndpointInterface);
            ((org.apache.axis.client.Stub) _stub).setPortName(portName);
            return _stub;
        }
    }

    public javax.xml.namespace.QName getServiceName() {
        return new javax.xml.namespace.QName("http://localhost:8080/axis/services/TestObjectsService", "TestObjectsService");
    }

    private java.util.HashSet ports = null;

    public java.util.Iterator getPorts() {
        if (ports == null) {
            ports = new java.util.HashSet();
            ports.add(new javax.xml.namespace.QName("TestObjectsService"));
        }
        return ports.iterator();
    }

}
