package com.yihu.jw.internet.wsapi;

public class WsapiServiceLocator extends org.apache.axis.client.Service implements WsapiService {

    public WsapiServiceLocator() {
    }


    public WsapiServiceLocator(org.apache.axis.EngineConfiguration config) {
        super(config);
    }

    public WsapiServiceLocator(String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
        super(wsdlLoc, sName);
    }

    // Use to get a proxy class for wsapiPort
//    private java.lang.String wsapiPort_address = "http://10.32.0.158:18081/micc/wsapi/1.0";
    private String wsapiPort_address = "http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0";
    public String getwsapiPortAddress() {
        return wsapiPort_address;
    }

    // The WSDD service name defaults to the port name.
    private String wsapiPortWSDDServiceName = "wsapiPort";

    public String getwsapiPortWSDDServiceName() {
        return wsapiPortWSDDServiceName;
    }

    public void setwsapiPortWSDDServiceName(String name) {
        wsapiPortWSDDServiceName = name;
    }

    public Wsapi getwsapiPort() throws javax.xml.rpc.ServiceException {
       java.net.URL endpoint;
        try {
            endpoint = new java.net.URL(wsapiPort_address);
        }
        catch (java.net.MalformedURLException e) {
            throw new javax.xml.rpc.ServiceException(e);
        }
        return getwsapiPort(endpoint);
    }

    public Wsapi getwsapiPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
        try {
            WsapiPortBindingStub _stub = new WsapiPortBindingStub(portAddress, this);
            _stub.setPortName(getwsapiPortWSDDServiceName());
            return _stub;
        }
        catch (org.apache.axis.AxisFault e) {
            return null;
        }
    }

    public void setwsapiPortEndpointAddress(String address) {
        wsapiPort_address = address;
    }

    /**
     * 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 (Wsapi.class.isAssignableFrom(serviceEndpointInterface)) {
                WsapiPortBindingStub _stub = new WsapiPortBindingStub(new java.net.URL(wsapiPort_address), this);
                _stub.setPortName(getwsapiPortWSDDServiceName());
                return _stub;
            }
        }
        catch (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 ("wsapiPort".equals(inputPortName)) {
            return getwsapiPort();
        }
        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://entry.ws.ctd/", "wsapiService");
    }

    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("http://entry.ws.ctd/", "wsapiPort"));
        }
        return ports.iterator();
    }

    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(String portName, String address) throws javax.xml.rpc.ServiceException {

if ("wsapiPort".equals(portName)) {
            setwsapiPortEndpointAddress(address);
        }
        else
{ // Unknown Port Name
            throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
        }
    }

    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(javax.xml.namespace.QName portName, String address) throws javax.xml.rpc.ServiceException {
        setEndpointAddress(portName.getLocalPart(), address);
    }

}
