KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bluecubs > xinco > service > XincoServiceLocator


1 /**
2  * XincoServiceLocator.java
3  *
4  * This file was auto-generated from WSDL
5  * by the Apache Axis WSDL2Java emitter.
6  */

7
8 /**
9  *Copyright 2004 blueCubs.com
10  *
11  *Licensed under the Apache License, Version 2.0 (the "License");
12  *you may not use this file except in compliance with the License.
13  *You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  *Unless required by applicable law or agreed to in writing, software
18  *distributed under the License is distributed on an "AS IS" BASIS,
19  *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  *See the License for the specific language governing permissions and
21  *limitations under the License.
22  *
23  *************************************************************
24  * This project supports the blueCubs vision of giving back
25  * to the community in exchange for free software!
26  * More information on: http://www.bluecubs.org
27  *************************************************************
28  *
29  * Name: XincoServiceLocator
30  *
31  * Description: -
32  *
33  * Original Author: Alexander Manes
34  * Date: 2004
35  *
36  * Modifications:
37  *
38  * Who? When? What?
39  * - - -
40  *
41  *************************************************************
42  */

43
44 package com.bluecubs.xinco.service;
45
46 public class XincoServiceLocator extends org.apache.axis.client.Service implements com.bluecubs.xinco.service.XincoService {
47
48     // Use to get a proxy class for Xinco
49
private final java.lang.String JavaDoc Xinco_address = "http://localhost:8080/xinco/services/Xinco";
50
51     public java.lang.String JavaDoc getXincoAddress() {
52         return Xinco_address;
53     }
54
55     // The WSDD service name defaults to the port name.
56
private java.lang.String JavaDoc XincoWSDDServiceName = "Xinco";
57
58     public java.lang.String JavaDoc getXincoWSDDServiceName() {
59         return XincoWSDDServiceName;
60     }
61
62     public void setXincoWSDDServiceName(java.lang.String JavaDoc name) {
63         XincoWSDDServiceName = name;
64     }
65
66     public com.bluecubs.xinco.service.Xinco getXinco() throws javax.xml.rpc.ServiceException JavaDoc {
67        java.net.URL JavaDoc endpoint;
68         try {
69             endpoint = new java.net.URL JavaDoc(Xinco_address);
70         }
71         catch (java.net.MalformedURLException JavaDoc e) {
72             throw new javax.xml.rpc.ServiceException JavaDoc(e);
73         }
74         return getXinco(endpoint);
75     }
76
77     public com.bluecubs.xinco.service.Xinco getXinco(java.net.URL JavaDoc portAddress) throws javax.xml.rpc.ServiceException JavaDoc {
78         try {
79             com.bluecubs.xinco.service.XincoSoapBindingStub _stub = new com.bluecubs.xinco.service.XincoSoapBindingStub(portAddress, this);
80             _stub.setPortName(getXincoWSDDServiceName());
81             return _stub;
82         }
83         catch (org.apache.axis.AxisFault e) {
84             return null;
85         }
86     }
87
88     /**
89      * For the given interface, get the stub implementation.
90      * If this service has no port for the given interface,
91      * then ServiceException is thrown.
92      */

93     public java.rmi.Remote JavaDoc getPort(Class JavaDoc serviceEndpointInterface) throws javax.xml.rpc.ServiceException JavaDoc {
94         try {
95             if (com.bluecubs.xinco.service.Xinco.class.isAssignableFrom(serviceEndpointInterface)) {
96                 com.bluecubs.xinco.service.XincoSoapBindingStub _stub = new com.bluecubs.xinco.service.XincoSoapBindingStub(new java.net.URL JavaDoc(Xinco_address), this);
97                 _stub.setPortName(getXincoWSDDServiceName());
98                 return _stub;
99             }
100         }
101         catch (java.lang.Throwable JavaDoc t) {
102             throw new javax.xml.rpc.ServiceException JavaDoc(t);
103         }
104         throw new javax.xml.rpc.ServiceException JavaDoc("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
105     }
106
107     /**
108      * For the given interface, get the stub implementation.
109      * If this service has no port for the given interface,
110      * then ServiceException is thrown.
111      */

112     public java.rmi.Remote JavaDoc getPort(javax.xml.namespace.QName JavaDoc portName, Class JavaDoc serviceEndpointInterface) throws javax.xml.rpc.ServiceException JavaDoc {
113         if (portName == null) {
114             return getPort(serviceEndpointInterface);
115         }
116         String JavaDoc inputPortName = portName.getLocalPart();
117         if ("Xinco".equals(inputPortName)) {
118             return getXinco();
119         }
120         else {
121             java.rmi.Remote JavaDoc _stub = getPort(serviceEndpointInterface);
122             ((org.apache.axis.client.Stub) _stub).setPortName(portName);
123             return _stub;
124         }
125     }
126
127     public javax.xml.namespace.QName JavaDoc getServiceName() {
128         return new javax.xml.namespace.QName JavaDoc("urn:Xinco", "XincoService");
129     }
130
131     private java.util.HashSet JavaDoc ports = null;
132
133     public java.util.Iterator JavaDoc getPorts() {
134         if (ports == null) {
135             ports = new java.util.HashSet JavaDoc();
136             ports.add(new javax.xml.namespace.QName JavaDoc("Xinco"));
137         }
138         return ports.iterator();
139     }
140
141 }
142
Popular Tags