KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > example > webservice > repository > RepositoryServiceLocator


1 /**
2  * RepositoryServiceLocator.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter.
6  */

7
8 package org.alfresco.example.webservice.repository;
9
10 public class RepositoryServiceLocator extends org.apache.axis.client.Service implements org.alfresco.example.webservice.repository.RepositoryService {
11
12 /**
13  * Provides read and write operations against a repository.
14  */

15
16     public RepositoryServiceLocator() {
17     }
18
19
20     public RepositoryServiceLocator(org.apache.axis.EngineConfiguration config) {
21         super(config);
22     }
23
24     public RepositoryServiceLocator(java.lang.String JavaDoc wsdlLoc, javax.xml.namespace.QName JavaDoc sName) throws javax.xml.rpc.ServiceException JavaDoc {
25         super(wsdlLoc, sName);
26     }
27
28     // Use to get a proxy class for RepositoryService
29
private java.lang.String JavaDoc RepositoryService_address = "http://localhost:8080/alfresco/api/RepositoryService";
30
31     public java.lang.String JavaDoc getRepositoryServiceAddress() {
32         return RepositoryService_address;
33     }
34
35     // The WSDD service name defaults to the port name.
36
private java.lang.String JavaDoc RepositoryServiceWSDDServiceName = "RepositoryService";
37
38     public java.lang.String JavaDoc getRepositoryServiceWSDDServiceName() {
39         return RepositoryServiceWSDDServiceName;
40     }
41
42     public void setRepositoryServiceWSDDServiceName(java.lang.String JavaDoc name) {
43         RepositoryServiceWSDDServiceName = name;
44     }
45
46     public org.alfresco.example.webservice.repository.RepositoryServiceSoapPort getRepositoryService() throws javax.xml.rpc.ServiceException JavaDoc {
47        java.net.URL JavaDoc endpoint;
48         try {
49             endpoint = new java.net.URL JavaDoc(RepositoryService_address);
50         }
51         catch (java.net.MalformedURLException JavaDoc e) {
52             throw new javax.xml.rpc.ServiceException JavaDoc(e);
53         }
54         return getRepositoryService(endpoint);
55     }
56
57     public org.alfresco.example.webservice.repository.RepositoryServiceSoapPort getRepositoryService(java.net.URL JavaDoc portAddress) throws javax.xml.rpc.ServiceException JavaDoc {
58         try {
59             org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub _stub = new org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub(portAddress, this);
60             _stub.setPortName(getRepositoryServiceWSDDServiceName());
61             return _stub;
62         }
63         catch (org.apache.axis.AxisFault e) {
64             return null;
65         }
66     }
67
68     public void setRepositoryServiceEndpointAddress(java.lang.String JavaDoc address) {
69         RepositoryService_address = address;
70     }
71
72     /**
73      * For the given interface, get the stub implementation.
74      * If this service has no port for the given interface,
75      * then ServiceException is thrown.
76      */

77     public java.rmi.Remote JavaDoc getPort(Class JavaDoc serviceEndpointInterface) throws javax.xml.rpc.ServiceException JavaDoc {
78         try {
79             if (org.alfresco.example.webservice.repository.RepositoryServiceSoapPort.class.isAssignableFrom(serviceEndpointInterface)) {
80                 org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub _stub = new org.alfresco.example.webservice.repository.RepositoryServiceSoapBindingStub(new java.net.URL JavaDoc(RepositoryService_address), this);
81                 _stub.setPortName(getRepositoryServiceWSDDServiceName());
82                 return _stub;
83             }
84         }
85         catch (java.lang.Throwable JavaDoc t) {
86             throw new javax.xml.rpc.ServiceException JavaDoc(t);
87         }
88         throw new javax.xml.rpc.ServiceException JavaDoc("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
89     }
90
91     /**
92      * For the given interface, get the stub implementation.
93      * If this service has no port for the given interface,
94      * then ServiceException is thrown.
95      */

96     public java.rmi.Remote JavaDoc getPort(javax.xml.namespace.QName JavaDoc portName, Class JavaDoc serviceEndpointInterface) throws javax.xml.rpc.ServiceException JavaDoc {
97         if (portName == null) {
98             return getPort(serviceEndpointInterface);
99         }
100         java.lang.String JavaDoc inputPortName = portName.getLocalPart();
101         if ("RepositoryService".equals(inputPortName)) {
102             return getRepositoryService();
103         }
104         else {
105             java.rmi.Remote JavaDoc _stub = getPort(serviceEndpointInterface);
106             ((org.apache.axis.client.Stub) _stub).setPortName(portName);
107             return _stub;
108         }
109     }
110
111     public javax.xml.namespace.QName JavaDoc getServiceName() {
112         return new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryService");
113     }
114
115     private java.util.HashSet JavaDoc ports = null;
116
117     public java.util.Iterator JavaDoc getPorts() {
118         if (ports == null) {
119             ports = new java.util.HashSet JavaDoc();
120             ports.add(new javax.xml.namespace.QName JavaDoc("http://www.alfresco.org/ws/service/repository/1.0", "RepositoryService"));
121         }
122         return ports.iterator();
123     }
124
125     /**
126     * Set the endpoint address for the specified port name.
127     */

128     public void setEndpointAddress(java.lang.String JavaDoc portName, java.lang.String JavaDoc address) throws javax.xml.rpc.ServiceException JavaDoc {
129         
130 if ("RepositoryService".equals(portName)) {
131             setRepositoryServiceEndpointAddress(address);
132         }
133         else
134 { // Unknown Port Name
135
throw new javax.xml.rpc.ServiceException JavaDoc(" Cannot set Endpoint Address for Unknown Port" + portName);
136         }
137     }
138
139     /**
140     * Set the endpoint address for the specified port name.
141     */

142     public void setEndpointAddress(javax.xml.namespace.QName JavaDoc portName, java.lang.String JavaDoc address) throws javax.xml.rpc.ServiceException JavaDoc {
143         setEndpointAddress(portName.getLocalPart(), address);
144     }
145
146 }
147
Popular Tags