// This class was generated by the JAXRPC SI, do not edit.
// Contents subject to change without notice.
// JAX-RPC Standard Implementation (1.1.2, build R23)
// Generated source version: 1.1.2

package org.tempuri.sample;

import com.sun.xml.rpc.encoding.*;
import com.sun.xml.rpc.client.ServiceExceptionImpl;
import com.sun.xml.rpc.util.exception.*;
import com.sun.xml.rpc.soap.SOAPVersion;
import com.sun.xml.rpc.client.HandlerChainImpl;
import javax.xml.rpc.*;
import javax.xml.rpc.encoding.*;
import javax.xml.rpc.handler.HandlerChain;
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.namespace.QName;

public class PresidentialElectionResults2004_Impl extends com.sun.xml.rpc.client.BasicService implements PresidentialElectionResults2004 {
    private static final QName serviceName = new QName("http://dietrich.ganx4.com/", "Presidential Election Results 2004");
    private static final QName ns1_Presidential$20$Election$20$Results$20$2004Port_QNAME = new QName("http://dietrich.ganx4.com/", "Presidential Election Results 2004Port");
    private static final Class presidentialElectionResults2004PortType_PortClass = org.tempuri.sample.PresidentialElectionResults2004PortType.class;
    
    public PresidentialElectionResults2004_Impl() {
        super(serviceName, new QName[] {
                        ns1_Presidential$20$Election$20$Results$20$2004Port_QNAME
                    },
            new org.tempuri.sample.PresidentialElectionResults2004_SerializerRegistry().getRegistry());
        
    }
    
    public java.rmi.Remote getPort(QName portName, Class serviceDefInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (portName.equals(ns1_Presidential$20$Election$20$Results$20$2004Port_QNAME) &&
                serviceDefInterface.equals(presidentialElectionResults2004PortType_PortClass)) {
                return getPresidentialElectionResults2004Port();
            }
        } catch (Exception e) {
            throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e));
        }
        return super.getPort(portName, serviceDefInterface);
    }
    
    public java.rmi.Remote getPort(Class serviceDefInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (serviceDefInterface.equals(presidentialElectionResults2004PortType_PortClass)) {
                return getPresidentialElectionResults2004Port();
            }
        } catch (Exception e) {
            throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e));
        }
        return super.getPort(serviceDefInterface);
    }
    
    public org.tempuri.sample.PresidentialElectionResults2004PortType getPresidentialElectionResults2004Port() {
        String[] roles = new String[] {};
        HandlerChainImpl handlerChain = new HandlerChainImpl(getHandlerRegistry().getHandlerChain(ns1_Presidential$20$Election$20$Results$20$2004Port_QNAME));
        handlerChain.setRoles(roles);
        org.tempuri.sample.PresidentialElectionResults2004PortType_Stub stub = new org.tempuri.sample.PresidentialElectionResults2004PortType_Stub(handlerChain);
        try {
            stub._initialize(super.internalTypeRegistry);
        } catch (JAXRPCException e) {
            throw e;
        } catch (Exception e) {
            throw new JAXRPCException(e.getMessage(), e);
        }
        return stub;
    }
}
