001    /**
002     * ReportIncidentService_ServiceLocator.java
003     *
004     * This file was auto-generated from WSDL
005     * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
006     */
007    
008    package org.apache.camel.example.reportincident;
009    
010    public class ReportIncidentService_ServiceLocator extends org.apache.axis.client.Service implements org.apache.camel.example.reportincident.ReportIncidentService_Service {
011    
012        public ReportIncidentService_ServiceLocator() {
013        }
014    
015    
016        public ReportIncidentService_ServiceLocator(org.apache.axis.EngineConfiguration config) {
017            super(config);
018        }
019    
020        public ReportIncidentService_ServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
021            super(wsdlLoc, sName);
022        }
023    
024        // Use to get a proxy class for ReportIncidentPort
025        private java.lang.String ReportIncidentPort_address = "http://reportincident.example.camel.apache.org";
026    
027        public java.lang.String getReportIncidentPortAddress() {
028            return ReportIncidentPort_address;
029        }
030    
031        // The WSDD service name defaults to the port name.
032        private java.lang.String ReportIncidentPortWSDDServiceName = "ReportIncidentPort";
033    
034        public java.lang.String getReportIncidentPortWSDDServiceName() {
035            return ReportIncidentPortWSDDServiceName;
036        }
037    
038        public void setReportIncidentPortWSDDServiceName(java.lang.String name) {
039            ReportIncidentPortWSDDServiceName = name;
040        }
041    
042        public org.apache.camel.example.reportincident.ReportIncidentService_PortType getReportIncidentPort() throws javax.xml.rpc.ServiceException {
043           java.net.URL endpoint;
044            try {
045                endpoint = new java.net.URL(ReportIncidentPort_address);
046            }
047            catch (java.net.MalformedURLException e) {
048                throw new javax.xml.rpc.ServiceException(e);
049            }
050            return getReportIncidentPort(endpoint);
051        }
052    
053        public org.apache.camel.example.reportincident.ReportIncidentService_PortType getReportIncidentPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
054            try {
055                org.apache.camel.example.reportincident.ReportIncidentBindingStub _stub = new org.apache.camel.example.reportincident.ReportIncidentBindingStub(portAddress, this);
056                _stub.setPortName(getReportIncidentPortWSDDServiceName());
057                return _stub;
058            }
059            catch (org.apache.axis.AxisFault e) {
060                return null;
061            }
062        }
063    
064        public void setReportIncidentPortEndpointAddress(java.lang.String address) {
065            ReportIncidentPort_address = address;
066        }
067    
068        /**
069         * For the given interface, get the stub implementation.
070         * If this service has no port for the given interface,
071         * then ServiceException is thrown.
072         */
073        public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
074            try {
075                if (org.apache.camel.example.reportincident.ReportIncidentService_PortType.class.isAssignableFrom(serviceEndpointInterface)) {
076                    org.apache.camel.example.reportincident.ReportIncidentBindingStub _stub = new org.apache.camel.example.reportincident.ReportIncidentBindingStub(new java.net.URL(ReportIncidentPort_address), this);
077                    _stub.setPortName(getReportIncidentPortWSDDServiceName());
078                    return _stub;
079                }
080            }
081            catch (java.lang.Throwable t) {
082                throw new javax.xml.rpc.ServiceException(t);
083            }
084            throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
085        }
086    
087        /**
088         * For the given interface, get the stub implementation.
089         * If this service has no port for the given interface,
090         * then ServiceException is thrown.
091         */
092        public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
093            if (portName == null) {
094                return getPort(serviceEndpointInterface);
095            }
096            java.lang.String inputPortName = portName.getLocalPart();
097            if ("ReportIncidentPort".equals(inputPortName)) {
098                return getReportIncidentPort();
099            }
100            else  {
101                java.rmi.Remote _stub = getPort(serviceEndpointInterface);
102                ((org.apache.axis.client.Stub) _stub).setPortName(portName);
103                return _stub;
104            }
105        }
106    
107        public javax.xml.namespace.QName getServiceName() {
108            return new javax.xml.namespace.QName("http://reportincident.example.camel.apache.org", "ReportIncidentService");
109        }
110    
111        private java.util.HashSet ports = null;
112    
113        public java.util.Iterator getPorts() {
114            if (ports == null) {
115                ports = new java.util.HashSet();
116                ports.add(new javax.xml.namespace.QName("http://reportincident.example.camel.apache.org", "ReportIncidentPort"));
117            }
118            return ports.iterator();
119        }
120    
121        /**
122        * Set the endpoint address for the specified port name.
123        */
124        public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
125            
126    if ("ReportIncidentPort".equals(portName)) {
127                setReportIncidentPortEndpointAddress(address);
128            }
129            else 
130    { // Unknown Port Name
131                throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
132            }
133        }
134    
135        /**
136        * Set the endpoint address for the specified port name.
137        */
138        public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
139            setEndpointAddress(portName.getLocalPart(), address);
140        }
141    
142    }