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