1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.nxqd.soap;
17
18 import java.util.logging.Level;
19 import java.util.logging.Logger;
20 import java.util.ArrayList;
21 import java.util.Map;
22 import java.util.List;
23 import java.util.Timer;
24
25 import org.w3c.dom.Document;
26
27 import net.sf.nxqd.NxqdException;
28 import net.sf.nxqd.common.NxqdUtils;
29 import net.sf.nxqd.event.NxqdEvent;
30 import net.sf.nxqd.event.NxqdContainerEvent;
31 import net.sf.nxqd.event.NxqdManagerEvent;
32 import net.sf.nxqd.event.NxqdEventListener;
33 import net.sf.nxqd.event.NxqdManagerEventListener;
34 import net.sf.nxqd.event.NxqdContainerEventListener;
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 import javax.xml.namespace.QName;
53
54 public class Axis2Connector {
55
56 /**
57 * The constant <code>NXQD_QNAME</code> describes the namespace for
58 * the SOAP server functionality.
59 *
60 */
61 private static final String NXQD_QNAME = "http://sourceforge.net/projects/nxqd";
62
63 /**
64 * The constant <code>NXQD_PROTOCOL</code> describes the communication protocol
65 * which will be used to communicate with the server.
66 *
67 */
68 private static final String NXQD_PROTOCOL = "http://";
69
70 /**
71 * The variable <code>logger</code> is used for logging events.
72 *
73 */
74 private static Logger logger = Logger.getLogger(Axis2Connector.class.getName());
75
76 private String hostName;
77
78 private String hostPort;
79
80 public Axis2Connector(String host, String port) {
81 this.hostName = host;
82 this.hostPort = port;
83 }
84
85 /**
86 * The <code>getHostName</code> method returns the host name
87 * of the machine running the Nxqd server.
88 *
89 * @return a <code>String</code> value
90 */
91 public final String getHostName() {
92 return hostName;
93 }
94
95 /**
96 * The <code>getHostPort</code> method returns the host port
97 * of the remote Nxqd server.
98 *
99 * @return an <code>String</code> value
100 */
101 public final String getHostPort() {
102 return hostPort;
103 }
104
105 public Object invoke(String operationName, Object[] parameters) throws NxqdException {
106 return invoke(operationName,
107 new String[0],
108 parameters);
109 }
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128 public Object invoke(String operationName,
129 String[] parameterNames,
130 Object[] parameterValues) throws NxqdException {
131 try {
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159 } catch (Exception e) {
160 logger.severe("Error performing invoke ("+e+")");
161 throw new NxqdException(e);
162 }
163 return null;
164 }
165
166 public Object invoke(String operationName,
167 String[] parameterNames,
168 QName[] parameterTypes,
169 Object[] parameterValues) throws NxqdException {
170 return invoke( operationName,
171 parameterNames,
172 parameterValues);
173 }
174
175 }