View Javadoc

1   /**
2    * EditSvcLocator.java
3    *
4    * This file was auto-generated from WSDL
5    * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
6    */
7   
8   package org.sirius.server.win32lib.controls.edit;
9   
10  public class EditSvcLocator extends org.apache.axis.client.Service implements
11          org.sirius.server.win32lib.controls.edit.EditSvc {
12  
13      // Use to get a proxy class for EditSvcPort
14      private java.lang.String  EditSvcPort_address        = "http://localhost:8990/win32lib/editsvc";
15  
16      // The WSDD service name defaults to the port name.
17      private java.lang.String  EditSvcPortWSDDServiceName = "EditSvcPort";
18  
19      private java.util.HashSet ports                      = null;
20  
21      public EditSvcLocator() {
22      }
23  
24      public EditSvcLocator(final java.lang.String wsdlLoc,
25              final javax.xml.namespace.QName sName)
26              throws javax.xml.rpc.ServiceException {
27          super(wsdlLoc, sName);
28      }
29  
30      public EditSvcLocator(final org.apache.axis.EngineConfiguration config) {
31          super(config);
32      }
33  
34      @Override
35      public org.sirius.server.win32lib.controls.edit.IEditContract getEditSvcPort()
36              throws javax.xml.rpc.ServiceException {
37          java.net.URL endpoint;
38          try {
39              endpoint = new java.net.URL(EditSvcPort_address);
40          } catch (java.net.MalformedURLException e) {
41              throw new javax.xml.rpc.ServiceException(e);
42          }
43          return getEditSvcPort(endpoint);
44      }
45  
46      @Override
47      public org.sirius.server.win32lib.controls.edit.IEditContract getEditSvcPort(
48              final java.net.URL portAddress)
49              throws javax.xml.rpc.ServiceException {
50          try {
51              org.sirius.server.win32lib.controls.edit.EditSvcPortStub _stub = new org.sirius.server.win32lib.controls.edit.EditSvcPortStub(
52                      portAddress, this);
53              _stub.setPortName(getEditSvcPortWSDDServiceName());
54              return _stub;
55          } catch (org.apache.axis.AxisFault e) {
56              return null;
57          }
58      }
59  
60      @Override
61      public java.lang.String getEditSvcPortAddress() {
62          return EditSvcPort_address;
63      }
64  
65      public java.lang.String getEditSvcPortWSDDServiceName() {
66          return EditSvcPortWSDDServiceName;
67      }
68  
69      /**
70       * For the given interface, get the stub implementation. If this service has
71       * no port for the given interface, then ServiceException is thrown.
72       */
73      @Override
74      public java.rmi.Remote getPort(final Class serviceEndpointInterface)
75              throws javax.xml.rpc.ServiceException {
76          try {
77              if (org.sirius.server.win32lib.controls.edit.IEditContract.class
78                      .isAssignableFrom(serviceEndpointInterface)) {
79                  org.sirius.server.win32lib.controls.edit.EditSvcPortStub _stub = new org.sirius.server.win32lib.controls.edit.EditSvcPortStub(
80                          new java.net.URL(EditSvcPort_address), this);
81                  _stub.setPortName(getEditSvcPortWSDDServiceName());
82                  return _stub;
83              }
84          } catch (java.lang.Throwable t) {
85              throw new javax.xml.rpc.ServiceException(t);
86          }
87          throw new javax.xml.rpc.ServiceException(
88                  "There is no stub implementation for the interface:  "
89                          + (serviceEndpointInterface == null ? "null"
90                                  : serviceEndpointInterface.getName()));
91      }
92  
93      /**
94       * For the given interface, get the stub implementation. If this service has
95       * no port for the given interface, then ServiceException is thrown.
96       */
97      @Override
98      public java.rmi.Remote getPort(final javax.xml.namespace.QName portName,
99              final Class serviceEndpointInterface)
100             throws javax.xml.rpc.ServiceException {
101         if (portName == null) {
102             return getPort(serviceEndpointInterface);
103         }
104         java.lang.String inputPortName = portName.getLocalPart();
105         if ("EditSvcPort".equals(inputPortName)) {
106             return getEditSvcPort();
107         } else {
108             java.rmi.Remote _stub = getPort(serviceEndpointInterface);
109             ((org.apache.axis.client.Stub) _stub).setPortName(portName);
110             return _stub;
111         }
112     }
113 
114     @Override
115     public java.util.Iterator getPorts() {
116         if (ports == null) {
117             ports = new java.util.HashSet();
118             ports.add(new javax.xml.namespace.QName(
119                     "http://edit.controls.win32lib.server.sirius.org/",
120                     "EditSvcPort"));
121         }
122         return ports.iterator();
123     }
124 
125     @Override
126     public javax.xml.namespace.QName getServiceName() {
127         return new javax.xml.namespace.QName(
128                 "http://edit.controls.win32lib.server.sirius.org/", "EditSvc");
129     }
130 
131     public void setEditSvcPortEndpointAddress(final java.lang.String address) {
132         EditSvcPort_address = address;
133     }
134 
135     public void setEditSvcPortWSDDServiceName(final java.lang.String name) {
136         EditSvcPortWSDDServiceName = name;
137     }
138 
139     /**
140      * Set the endpoint address for the specified port name.
141      */
142     public void setEndpointAddress(final java.lang.String portName,
143             final java.lang.String address)
144             throws javax.xml.rpc.ServiceException {
145 
146         if ("EditSvcPort".equals(portName)) {
147             setEditSvcPortEndpointAddress(address);
148         } else { // Unknown Port Name
149             throw new javax.xml.rpc.ServiceException(
150                     " Cannot set Endpoint Address for Unknown Port" + portName);
151         }
152     }
153 
154     /**
155      * Set the endpoint address for the specified port name.
156      */
157     public void setEndpointAddress(final javax.xml.namespace.QName portName,
158             final java.lang.String address)
159             throws javax.xml.rpc.ServiceException {
160         setEndpointAddress(portName.getLocalPart(), address);
161     }
162 
163 }