1 /**
2 *
3 * Copyright 2003-2004 The Apache Software Foundation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.apache.geronimo.axis.client;
18
19 import java.net.URL;
20 import javax.xml.namespace.QName;
21
22 import org.apache.axis.AxisFault;
23 import org.apache.axis.NoEndPointException;
24 import org.apache.axis.client.Call;
25 import org.apache.axis.client.Service;
26
27 /**
28 * @version $Rev: 356022 $ $Date: 2005-12-11 12:58:34 -0800 (Sun, 11 Dec 2005) $
29 */
30 public class GenericServiceEndpoint extends org.apache.axis.client.Stub {
31
32
33 public GenericServiceEndpoint(QName portQName, Service service, URL location) {
34 this.service = service;
35 cachedEndpoint = location;
36 cachedPortName = portQName;
37
38 }
39
40 Call createCall() throws java.rmi.RemoteException {
41 try {
42 org.apache.axis.client.Call _call =
43 (org.apache.axis.client.Call) service.createCall();
44 if (super.maintainSessionSet) {
45 _call.setMaintainSession(super.maintainSession);
46 }
47 if (super.cachedUsername != null) {
48 _call.setUsername(super.cachedUsername);
49 }
50 if (super.cachedPassword != null) {
51 _call.setPassword(super.cachedPassword);
52 }
53 if (super.cachedEndpoint != null) {
54 _call.setTargetEndpointAddress(super.cachedEndpoint);
55 }
56 if (super.cachedTimeout != null) {
57 _call.setTimeout(super.cachedTimeout);
58 }
59 if (super.cachedPortName != null) {
60 _call.setPortName(super.cachedPortName);
61 }
62 java.util.Enumeration keys = super.cachedProperties.keys();
63 while (keys.hasMoreElements()) {
64 java.lang.String key = (java.lang.String) keys.nextElement();
65 _call.setProperty(key, super.cachedProperties.get(key));
66 }
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94 return _call;
95 } catch (java.lang.Throwable t) {
96 throw new org.apache.axis.AxisFault("Failure trying to get the Call object", t);
97 }
98 }
99
100 void checkCachedEndpoint() throws NoEndPointException {
101 if (cachedEndpoint == null) {
102 throw new NoEndPointException();
103 }
104 }
105
106 void setUpCall(Call call) throws AxisFault {
107 setRequestHeaders(call);
108 setAttachments(call);
109 }
110
111 }