KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > phoneList > business > axis > PhoneListServiceLocator


1 /**
2  * PhoneListServiceLocator.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis 1.2beta Mar 31, 2004 (12:47:03 EST) WSDL2Java emitter.
6  */

7
8 package phoneList.business.axis;
9
10 public class PhoneListServiceLocator extends org.apache.axis.client.Service implements phoneList.business.axis.PhoneListService {
11
12     // Use to get a proxy class for PhoneBook
13
private java.lang.String JavaDoc PhoneBook_address = "http://localhost:9000/phoneBook/PhoneBook";
14
15     public java.lang.String JavaDoc getPhoneBookAddress() {
16         return PhoneBook_address;
17     }
18
19     // The WSDD service name defaults to the port name.
20
private java.lang.String JavaDoc PhoneBookWSDDServiceName = "PhoneBook";
21
22     public java.lang.String JavaDoc getPhoneBookWSDDServiceName() {
23         return PhoneBookWSDDServiceName;
24     }
25
26     public void setPhoneBookWSDDServiceName(java.lang.String JavaDoc name) {
27         PhoneBookWSDDServiceName = name;
28     }
29
30     public phoneList.business.axis.PhoneList getPhoneBook() throws javax.xml.rpc.ServiceException JavaDoc {
31        java.net.URL JavaDoc endpoint;
32         try {
33             endpoint = new java.net.URL JavaDoc(PhoneBook_address);
34         }
35         catch (java.net.MalformedURLException JavaDoc e) {
36             throw new javax.xml.rpc.ServiceException JavaDoc(e);
37         }
38         return getPhoneBook(endpoint);
39     }
40
41     public phoneList.business.axis.PhoneList getPhoneBook(java.net.URL JavaDoc portAddress) throws javax.xml.rpc.ServiceException JavaDoc {
42         try {
43             phoneList.business.axis.PhoneBookSoapBindingStub _stub = new phoneList.business.axis.PhoneBookSoapBindingStub(portAddress, this);
44             _stub.setPortName(getPhoneBookWSDDServiceName());
45             return _stub;
46         }
47         catch (org.apache.axis.AxisFault e) {
48             return null;
49         }
50     }
51
52     public void setPhoneBookEndpointAddress(java.lang.String JavaDoc address) {
53         PhoneBook_address = address;
54     }
55
56     /**
57      * For the given interface, get the stub implementation.
58      * If this service has no port for the given interface,
59      * then ServiceException is thrown.
60      */

61     public java.rmi.Remote JavaDoc getPort(Class JavaDoc serviceEndpointInterface) throws javax.xml.rpc.ServiceException JavaDoc {
62         try {
63             if (phoneList.business.axis.PhoneList.class.isAssignableFrom(serviceEndpointInterface)) {
64                 phoneList.business.axis.PhoneBookSoapBindingStub _stub = new phoneList.business.axis.PhoneBookSoapBindingStub(new java.net.URL JavaDoc(PhoneBook_address), this);
65                 _stub.setPortName(getPhoneBookWSDDServiceName());
66                 return _stub;
67             }
68         }
69         catch (java.lang.Throwable JavaDoc t) {
70             throw new javax.xml.rpc.ServiceException JavaDoc(t);
71         }
72         throw new javax.xml.rpc.ServiceException JavaDoc("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
73     }
74
75     /**
76      * For the given interface, get the stub implementation.
77      * If this service has no port for the given interface,
78      * then ServiceException is thrown.
79      */

80     public java.rmi.Remote JavaDoc getPort(javax.xml.namespace.QName JavaDoc portName, Class JavaDoc serviceEndpointInterface) throws javax.xml.rpc.ServiceException JavaDoc {
81         if (portName == null) {
82             return getPort(serviceEndpointInterface);
83         }
84         String JavaDoc inputPortName = portName.getLocalPart();
85         if ("PhoneBook".equals(inputPortName)) {
86             return getPhoneBook();
87         }
88         else {
89             java.rmi.Remote JavaDoc _stub = getPort(serviceEndpointInterface);
90             ((org.apache.axis.client.Stub) _stub).setPortName(portName);
91             return _stub;
92         }
93     }
94
95     public javax.xml.namespace.QName JavaDoc getServiceName() {
96         return new javax.xml.namespace.QName JavaDoc("urn:phoneBook", "PhoneListService");
97     }
98
99     private java.util.HashSet JavaDoc ports = null;
100
101     public java.util.Iterator JavaDoc getPorts() {
102         if (ports == null) {
103             ports = new java.util.HashSet JavaDoc();
104             ports.add(new javax.xml.namespace.QName JavaDoc("PhoneBook"));
105         }
106         return ports.iterator();
107     }
108
109     /**
110     * Set the endpoint address for the specified port name.
111     */

112     public void setEndpointAddress(java.lang.String JavaDoc portName, java.lang.String JavaDoc address) throws javax.xml.rpc.ServiceException JavaDoc {
113         if ("PhoneBook".equals(portName)) {
114             setPhoneBookEndpointAddress(address);
115         }
116         else { // Unknown Port Name
117
throw new javax.xml.rpc.ServiceException JavaDoc(" Cannot set Endpoint Address for Unknown Port" + portName);
118         }
119     }
120
121     /**
122     * Set the endpoint address for the specified port name.
123     */

124     public void setEndpointAddress(javax.xml.namespace.QName JavaDoc portName, java.lang.String JavaDoc address) throws javax.xml.rpc.ServiceException JavaDoc {
125         setEndpointAddress(portName.getLocalPart(), address);
126     }
127
128 }
129
Popular Tags