KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > hello > HelloWsServiceLocator


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

7
8 package org.objectweb.jonas.jtests.hello;
9
10 import javax.xml.namespace.QName JavaDoc;
11
12 public class HelloWsServiceLocator extends org.objectweb.jonas.ws.axis.JService implements org.objectweb.jonas.jtests.hello.HelloWsService {
13
14     public HelloWsServiceLocator(String JavaDoc name, QName JavaDoc qname) {
15         
16     }
17     
18     // Use to get a proxy class for HelloPortComponent
19
private final java.lang.String JavaDoc HelloPortComponent_address = "http://dummy_location/HelloPortComponent";
20
21     public java.lang.String JavaDoc getHelloPortComponentAddress() {
22         return HelloPortComponent_address;
23     }
24
25     // The WSDD service name defaults to the port name.
26
private java.lang.String JavaDoc HelloPortComponentWSDDServiceName = "HelloPortComponent";
27
28     public java.lang.String JavaDoc getHelloPortComponentWSDDServiceName() {
29         return HelloPortComponentWSDDServiceName;
30     }
31
32     public void setHelloPortComponentWSDDServiceName(java.lang.String JavaDoc name) {
33         HelloPortComponentWSDDServiceName = name;
34     }
35
36     public org.objectweb.jonas.jtests.hello.HelloWs getHelloPortComponent() throws javax.xml.rpc.ServiceException JavaDoc {
37        java.net.URL JavaDoc endpoint;
38         try {
39             endpoint = new java.net.URL JavaDoc(HelloPortComponent_address);
40         }
41         catch (java.net.MalformedURLException JavaDoc e) {
42             throw new javax.xml.rpc.ServiceException JavaDoc(e);
43         }
44         return getHelloPortComponent(endpoint);
45     }
46
47     public org.objectweb.jonas.jtests.hello.HelloWs getHelloPortComponent(java.net.URL JavaDoc portAddress) throws javax.xml.rpc.ServiceException JavaDoc {
48         try {
49             org.objectweb.jonas.jtests.hello.HelloPortComponentSoapBindingStub _stub = new org.objectweb.jonas.jtests.hello.HelloPortComponentSoapBindingStub(portAddress, this);
50             _stub.setPortName(getHelloPortComponentWSDDServiceName());
51             return _stub;
52         }
53         catch (org.apache.axis.AxisFault e) {
54             return null;
55         }
56     }
57
58     /**
59      * For the given interface, get the stub implementation.
60      * If this service has no port for the given interface,
61      * then ServiceException is thrown.
62      */

63     public java.rmi.Remote JavaDoc getPort(Class JavaDoc serviceEndpointInterface) throws javax.xml.rpc.ServiceException JavaDoc {
64         try {
65             if (org.objectweb.jonas.jtests.hello.HelloWs.class.isAssignableFrom(serviceEndpointInterface)) {
66                 org.objectweb.jonas.jtests.hello.HelloPortComponentSoapBindingStub _stub = new org.objectweb.jonas.jtests.hello.HelloPortComponentSoapBindingStub(new java.net.URL JavaDoc(HelloPortComponent_address), this);
67                 _stub.setPortName(getHelloPortComponentWSDDServiceName());
68                 return _stub;
69             }
70         }
71         catch (java.lang.Throwable JavaDoc t) {
72             throw new javax.xml.rpc.ServiceException JavaDoc(t);
73         }
74         throw new javax.xml.rpc.ServiceException JavaDoc("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
75     }
76
77     /**
78      * For the given interface, get the stub implementation.
79      * If this service has no port for the given interface,
80      * then ServiceException is thrown.
81      */

82     public java.rmi.Remote JavaDoc getPort(javax.xml.namespace.QName JavaDoc portName, Class JavaDoc serviceEndpointInterface) throws javax.xml.rpc.ServiceException JavaDoc {
83         if (portName == null) {
84             return getPort(serviceEndpointInterface);
85         }
86         String JavaDoc inputPortName = portName.getLocalPart();
87         if ("HelloPortComponent".equals(inputPortName)) {
88             return getHelloPortComponent();
89         }
90         else {
91             java.rmi.Remote JavaDoc _stub = getPort(serviceEndpointInterface);
92             ((org.apache.axis.client.Stub) _stub).setPortName(portName);
93             return _stub;
94         }
95     }
96
97     public javax.xml.namespace.QName JavaDoc getServiceName() {
98         return new javax.xml.namespace.QName JavaDoc("http://hello.simple", "HelloWsService");
99     }
100
101     private java.util.HashSet JavaDoc ports = null;
102
103     public java.util.Iterator JavaDoc getPorts() {
104         if (ports == null) {
105             ports = new java.util.HashSet JavaDoc();
106             ports.add(new javax.xml.namespace.QName JavaDoc("HelloPortComponent"));
107         }
108         return ports.iterator();
109     }
110
111 }
112
Popular Tags