/**
 * MailLocateLocator.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis WSDL2Java emitter.
 */

package com.maillocate;

public class MailLocateLocator extends org.apache.axis.client.Service implements com.maillocate.MailLocate {

    // Use to get a proxy class for MailLocatePort
    private final java.lang.String MailLocatePort_address = "http://www.maillocate.com/soap/index.php";

    public java.lang.String getMailLocatePortAddress() {
        return MailLocatePort_address;
    }

    // The WSDD service name defaults to the port name.
    private java.lang.String MailLocatePortWSDDServiceName = "MailLocatePort";

    public java.lang.String getMailLocatePortWSDDServiceName() {
        return MailLocatePortWSDDServiceName;
    }

    public void setMailLocatePortWSDDServiceName(java.lang.String name) {
        MailLocatePortWSDDServiceName = name;
    }

    public com.maillocate.MailLocatePortType getMailLocatePort() throws javax.xml.rpc.ServiceException {
       java.net.URL endpoint;
        try {
            endpoint = new java.net.URL(MailLocatePort_address);
        }
        catch (java.net.MalformedURLException e) {
            return null; // unlikely as URL was validated in WSDL2Java
        }
        return getMailLocatePort(endpoint);
    }

    public com.maillocate.MailLocatePortType getMailLocatePort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
        try {
            com.maillocate.MailLocateBindingStub _stub = new com.maillocate.MailLocateBindingStub(portAddress, this);
            _stub.setPortName(getMailLocatePortWSDDServiceName());
            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 (com.maillocate.MailLocatePortType.class.isAssignableFrom(serviceEndpointInterface)) {
                com.maillocate.MailLocateBindingStub _stub = new com.maillocate.MailLocateBindingStub(new java.net.URL(MailLocatePort_address), this);
                _stub.setPortName(getMailLocatePortWSDDServiceName());
                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 {
        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://maillocate.com/soap/mlns", "MailLocate");
    }

    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("MailLocatePort"));
        }
        return ports.iterator();
    }

}

