151
|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13 <html xmlns="http://www.w3.org/1999/xhtml">
|
|
14 <head>
|
|
15 <title>ws-xmlrpc - Advanced Programming Topics</title>
|
|
16 <style type="text/css" media="all">
|
|
17 @import url("./css/maven-base.css");
|
|
18 @import url("./css/maven-theme.css");
|
|
19 @import url("./css/site.css");
|
|
20 </style>
|
|
21 <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
|
|
22 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
|
|
23 </head>
|
|
24 <body class="composite">
|
|
25 <div id="banner">
|
|
26 <a href="" id="bannerLeft">
|
|
27
|
|
28 <img src="images/xmlrpc-logo.gif" alt="" />
|
|
29
|
|
30 </a>
|
|
31 <div class="clear">
|
|
32 <hr/>
|
|
33 </div>
|
|
34 </div>
|
|
35 <div id="breadcrumbs">
|
|
36
|
|
37
|
|
38
|
|
39
|
|
40
|
|
41
|
|
42
|
|
43
|
|
44 <div class="xleft">
|
|
45 Last Published: 2010-02-06
|
|
46 </div>
|
|
47 <div class="xright"> <a href="http://www.apache.org/" class="externalLink">Apache</a>
|
|
48 |
|
|
49 <a href="../">Webservices</a>
|
|
50 |
|
|
51 <a href="">XML-RPC</a>
|
|
52
|
|
53
|
|
54
|
|
55
|
|
56
|
|
57
|
|
58
|
|
59
|
|
60 </div>
|
|
61 <div class="clear">
|
|
62 <hr/>
|
|
63 </div>
|
|
64 </div>
|
|
65 <div id="leftColumn">
|
|
66 <div id="navcolumn">
|
|
67
|
|
68
|
|
69
|
|
70
|
|
71
|
|
72
|
|
73
|
|
74
|
|
75 <h5>XML-RPC</h5>
|
|
76 <ul>
|
|
77
|
|
78 <li class="none">
|
|
79 <a href="index.html">Overview</a>
|
|
80 </li>
|
|
81
|
|
82 <li class="none">
|
|
83 <a href="download.html">Download</a>
|
|
84 </li>
|
|
85
|
|
86 <li class="none">
|
|
87 <a href="changes-report.html">Changes</a>
|
|
88 </li>
|
|
89
|
|
90 <li class="none">
|
|
91 <a href="mail-lists.html">Mailing Lists</a>
|
|
92 </li>
|
|
93
|
|
94 <li class="none">
|
|
95 <a href="contributing.html">Contributing</a>
|
|
96 </li>
|
|
97
|
|
98 <li class="none">
|
|
99 <a href="xmlrpc2">XML-RPC 2</a>
|
|
100 </li>
|
|
101
|
|
102 <li class="none">
|
|
103 <a href="links.html">Links</a>
|
|
104 </li>
|
|
105 </ul>
|
|
106 <h5>Documentation</h5>
|
|
107 <ul>
|
|
108
|
|
109 <li class="none">
|
|
110 <a href="client.html">Client Classes</a>
|
|
111 </li>
|
|
112
|
|
113 <li class="none">
|
|
114 <a href="server.html">Server Side XML-RPC</a>
|
|
115 </li>
|
|
116
|
|
117 <li class="none">
|
|
118 <a href="extensions.html">Vendor Extensions</a>
|
|
119 </li>
|
|
120
|
|
121 <li class="none">
|
|
122 <a href="ssl.html">SSL</a>
|
|
123 </li>
|
|
124
|
|
125 <li class="none">
|
|
126 <strong>Introspection</strong>
|
|
127 </li>
|
|
128
|
|
129 <li class="none">
|
|
130 <a href="advanced.html">Advanced Techniques</a>
|
|
131 </li>
|
|
132
|
|
133 <li class="none">
|
|
134 <a href="types.html">XML-RPC Types</a>
|
|
135 </li>
|
|
136
|
|
137 <li class="none">
|
|
138 <a href="faq.html">FAQ</a>
|
|
139 </li>
|
|
140
|
|
141 <li class="none">
|
|
142 <a href="apidocs/index.html">Javadocs</a>
|
|
143 </li>
|
|
144 </ul>
|
|
145 <h5>Project Documentation</h5>
|
|
146 <ul>
|
|
147
|
|
148
|
|
149
|
|
150
|
|
151
|
|
152
|
|
153
|
|
154
|
|
155
|
|
156
|
|
157
|
|
158
|
|
159
|
|
160
|
|
161
|
|
162
|
|
163
|
|
164
|
|
165
|
|
166
|
|
167
|
|
168
|
|
169
|
|
170
|
|
171
|
|
172
|
|
173
|
|
174 <li class="collapsed">
|
|
175 <a href="project-info.html">Project Information</a>
|
|
176 </li>
|
|
177
|
|
178
|
|
179
|
|
180
|
|
181
|
|
182
|
|
183
|
|
184
|
|
185
|
|
186 <li class="collapsed">
|
|
187 <a href="project-reports.html">Project Reports</a>
|
|
188 </li>
|
|
189 </ul>
|
|
190 <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
|
|
191 <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
|
|
192 </a>
|
|
193
|
|
194
|
|
195
|
|
196
|
|
197
|
|
198
|
|
199
|
|
200
|
|
201 </div>
|
|
202 </div>
|
|
203 <div id="bodyColumn">
|
|
204 <div id="contentBox">
|
|
205 <p>Apache XML-RPC supports XML-RPC introspection, as specified by <a href="http://scripts.incutio.com/xmlrpc/introspection.html" class="externalLink"> http://scripts.incutio.com/xmlrpc/introspection.html</a>. This page describes how to configure the XML-RPC server for introspection.</p>
|
|
206 <div class="section"><h2>What is introspection?</h2>
|
|
207 <p>Introspection is the servers ability to provide metadata to the client. The client may ask "What method names does the server offer?", "How do I invoke method 'foo'?", or "Can you give me help on method 'foo'?".</p>
|
|
208 <p>The client does so by invoking the special methods "system.listMethods", "system.methodSignature" and "system.methodHelp". These are described in detail in the non-official specification for XML-RPC introspection, which you'll find at <a href="http://scripts.incutio.com/xmlrpc/introspection.html" class="externalLink"> http://scripts.incutio.com/xmlrpc/introspection.html</a>.</p>
|
|
209 </div>
|
|
210 <div class="section"><h2>How do I configure the server for introspection?</h2>
|
|
211 <p>The server requires a special mapping. Basically, you simply add a "system" handler, which is implemented by the class <tt>XmlRpcSystemImpl</tt>. Here's how you would do that in the <tt>XmlRpcServlet</tt>:</p>
|
|
212 <div class="source"><pre> public class MyXmlRpcServlet extends XmlRpcServlet {
|
|
213 protected XmlRpcHandlerMapping newXmlRpcHandlerMapping()
|
|
214 throws XmlRpcException {
|
|
215 PropertyHandlerMapping mapping =
|
|
216 (PropertyHandlerMapping) newXmlRpcHandlerMapping();
|
|
217 XmlRpcSystemImpl.addSystemHandler(mapping);
|
|
218 }
|
|
219 }
</pre>
|
|
220 </div>
|
|
221 <p>Quite similar, you would override a protected method, if you prefer using the <tt>WebServer</tt> class:</p>
|
|
222 <div class="source"><pre> public class MyWebServer extends WebServer {
|
|
223 public MyWebServer(int pPort) {
|
|
224 super(pPort);
|
|
225 }
|
|
226
|
|
227 protected XmlRpcStreamServer newXmlRpcStreamServer(){
|
|
228 XmlRpcStreamServer xmlRpcStreamServer = new ConnectionServer();
|
|
229 PropertyHandlerMapping mapping = (PropertyHandlerMapping) xmlRpcStreamServer.getHandlerMapping();
|
|
230 XmlRpcSystemImpl.addSystemHandler(mapping);
|
|
231 return xmlRpcStreamServer;
|
|
232 }
|
|
233 }
</pre>
|
|
234 </div>
|
|
235 </div>
|
|
236
|
|
237 </div>
|
|
238 </div>
|
|
239 <div class="clear">
|
|
240 <hr/>
|
|
241 </div>
|
|
242 <div id="footer">
|
|
243 <div class="xright">©
|
|
244 2001-2010
|
|
245
|
|
246 The Apache Software Foundation
|
|
247
|
|
248
|
|
249
|
|
250
|
|
251
|
|
252
|
|
253
|
|
254
|
|
255 </div>
|
|
256 <div class="clear">
|
|
257 <hr/>
|
|
258 </div>
|
|
259 </div>
|
|
260 </body>
|
|
261 </html>
|