File: node9.html

package info (click to toggle)
sympa 4.1.5-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 11,504 kB
  • ctags: 2,195
  • sloc: perl: 18,884; sh: 4,032; makefile: 1,173; ansic: 226; php: 105; lisp: 32
file content (710 lines) | stat: -rw-r--r-- 23,140 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4
patched version by:  Kenshi Muto, Debian Project.
LaTeX2HTML 2002 (1.62),
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>8. Sympa SOAP server</TITLE>
<META NAME="description" CONTENT="8. Sympa SOAP server">
<META NAME="keywords" CONTENT="sympa">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="jLaTeX2HTML v2002 JA patch-1.4">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="sympa.css">

<LINK REL="next" HREF="node10.html">
<LINK REL="previous" HREF="node8.html">
<LINK REL="up" HREF="sympa.html">
<LINK REL="next" HREF="node10.html">
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html885"
  HREF="node10.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html879"
  HREF="sympa.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html873"
  HREF="node8.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html881"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html883"
  HREF="node23.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html886"
  HREF="node10.html">9. Authentication</A>
<B> Up:</B> <A NAME="tex2html880"
  HREF="sympa.html">Sympa Mailing Lists Management Software version</A>
<B> Previous:</B> <A NAME="tex2html874"
  HREF="node8.html">7. WWSympa, Sympa's web interface</A>
 &nbsp <B>  <A NAME="tex2html882"
  HREF="node1.html">Contents</A></B> 
 &nbsp <B>  <A NAME="tex2html884"
  HREF="node23.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html887"
  HREF="node9.html#SECTION00910000000000000000">8.1 Introduction</A>
<LI><A NAME="tex2html888"
  HREF="node9.html#SECTION00920000000000000000">8.2 Web server setup</A>
<LI><A NAME="tex2html889"
  HREF="node9.html#SECTION00930000000000000000">8.3 Sympa setup</A>
<LI><A NAME="tex2html890"
  HREF="node9.html#SECTION00940000000000000000">8.4 The WSDL service description</A>
<LI><A NAME="tex2html891"
  HREF="node9.html#SECTION00950000000000000000">8.5 Client-side programming</A>
<UL>
<LI><A NAME="tex2html892"
  HREF="node9.html#SECTION00951000000000000000">8.5.1 Writting a Java client with Axis</A>
</UL></UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION00900000000000000000"></A>
<A NAME="soap"></A>
<BR>
8. Sympa SOAP server
</H1>

<P>

<H1><A NAME="SECTION00910000000000000000">
8.1 Introduction</A>
</H1>

<P>
<A NAME="tex2html28"
  HREF="http://www.w3.org/2002/ws/">SOAP</A>
is one protocol (generally over HTTP) that 
can be used to provide <B>web services</B>. Sympa SOAP server allows to access a Sympa service 
from within another program, written in any programming language and on any computer. SOAP encapsulates 
procedure calls, input parameters and resulting data in an XML data structure. The Sympa SOAP server's
API is published in a <B>WSDL </B> document, retreived via Sympa's web interface.

<P>
The SOAP server provides a limited set of high level functions including <TT>login</TT>, <TT>which</TT>,
<TT>lists</TT>,<TT>subscribe</TT>,<TT>signoff</TT>. Other functions might be implemented in the future.

<P>
The SOAP server uses <A NAME="tex2html29"
  HREF="http://www.soaplite.com/">SOAP::Lite</A>
Perl library. The server 
is running as a daemon (thanks to FastCGI), receiving the client SOAP requests via a web server (Apache 
for example).

<P>

<H1><A NAME="SECTION00920000000000000000">
8.2 Web server setup</A>
</H1>

<P>
You <B>NEED TO</B> install FastCGI for the SOAP server to work properly because it will run as a daemon.

<P>
Here is a sample piece of your Apache <A NAME="6024"></A><TT>httpd.conf</TT> with a SOAP server configured :<PRE>
	FastCgiServer /sympa_soap_server.fcgi -processes 1
	ScriptAlias /sympasoap /sympa_soap_server.fcgi

	&lt;Location /sympasoap&gt;
   	  SetHandler fastcgi-script
	&lt;/Location&gt;
</PRE>

<P>

<H1><A NAME="SECTION00930000000000000000">
8.3 Sympa setup</A>
</H1>

<P>
The only parameters that you need to set in <A NAME="6027"></A><TT>sympa.conf</TT>/<A NAME="6030"></A><TT>robot.conf</TT> files is
the <A NAME="6033"></A><TT>soap_url</TT> parameter that defines the URL of the SOAP service corresponding
to the ScriptAlias you've previously setup in Apache config. 

<P>
This parameter is used to publish the SOAP service URL in the WSDL file (defining the API) but
also for the SOAP server to deduce what Virtual Robot is concerned by the current SOAP request 
(a single SOAP server will serve all Sympa Virtual robots).

<P>

<H1><A NAME="SECTION00940000000000000000">
8.4 The WSDL service description</A>
</H1>

<P>
Here is what the WSDL file looks like before it is parsed by WWSympa :

<P><PRE>
&lt;?xml version="1.0"?&gt;
&lt;definitions name="Sympa" 
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
	targetNamespace="[conf-&gt;wwsympa_url]/wsdl" 
	xmlns:tns="[conf-&gt;wwsympa_url]/wsdl"
	xmlns="http://schemas.xmlsoap.org/wsdl/" 
	xmlns:xsdl="[conf-&gt;soap_url]/wsdl"&gt;


&lt;!-- types part --&gt;	


&lt;types&gt;
&lt;schema targetNamespace="[conf-&gt;wwsympa_url]/wsdl" 
	xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
	xmlns="http://www.w3.org/2001/XMLSchema"&gt;
	
	&lt;complexType name="ArrayOfLists"&gt;
		&lt;complexContent&gt;
			&lt;restriction base="SOAP-ENC:Array"&gt;
				&lt;attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:listType[]"/&gt;
			&lt;/restriction&gt;
		&lt;/complexContent&gt;
	&lt;/complexType&gt;

	&lt;complexType name="ArrayOfString"&gt;
		&lt;complexContent&gt;
			&lt;restriction base="SOAP-ENC:Array"&gt;
				&lt;attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/&gt;
			&lt;/restriction&gt;
		&lt;/complexContent&gt;
	&lt;/complexType&gt;
	
	&lt;complexType name="listType"&gt;
           &lt;all&gt;
		&lt;element name="listAddress" minOccurs="1" type="string"/&gt;
		&lt;element name="homepage" minOccurs="0" type="string"/&gt;
		&lt;element name="isSubscriber" minOccurs="0" type="boolean"/&gt;
		&lt;element name="isOwner" minOccurs="0" type="boolean"/&gt;
		&lt;element name="isEditor" minOccurs="0" type="boolean"/&gt;
		&lt;element name="subject" minOccurs="0" type="string"/&gt;
           &lt;/all&gt;
	&lt;/complexType&gt;
&lt;/schema&gt;
&lt;/types&gt;


&lt;!-- message part --&gt;

&lt;message name="infoRequest"&gt;
        &lt;part name="listName" type="xsd:string"/&gt;
&lt;/message&gt;

&lt;message name="infoResponse"&gt;
	&lt;part name="return" type="tns:listType"/&gt;
&lt;/message&gt;

&lt;message name="complexWhichRequest"&gt;
&lt;/message&gt;

&lt;message name="complexWhichResponse"&gt;
	&lt;part name="return" type="tns:ArrayOfLists"/&gt;
&lt;/message&gt;

&lt;message name="whichRequest"&gt;
&lt;/message&gt;

&lt;message name="whichResponse"&gt;
	&lt;part name="return" type="tns:ArrayOfString"/&gt;
&lt;/message&gt;

&lt;message name="amIRequest"&gt;
	&lt;part name="list" type="xsd:string"/&gt;
	&lt;part name="function" type="xsd:string"/&gt;
	&lt;part name="user" type="xsd:string"/&gt;
&lt;/message&gt;

&lt;message name="amIResponse"&gt;
	&lt;part name="return" type="xsd:boolean"/&gt;
&lt;/message&gt;

&lt;message name="reviewRequest"&gt;
	&lt;part name="list" type="xsd:string"/&gt;
&lt;/message&gt;

&lt;message name="reviewResponse"&gt;
	&lt;part name="return" type="tns:ArrayOfString"/&gt;
&lt;/message&gt;

&lt;message name="signoffRequest"&gt;
	&lt;part name="list" type="xsd:string"/&gt;
	&lt;part name="email" type="xsd:string" xsd:minOccurs="0"/&gt;	
&lt;/message&gt;

&lt;message name="signoffResponse"&gt;
	&lt;part name="return" type="xsd:boolean"/&gt;
&lt;/message&gt;

&lt;message name="subscribeRequest"&gt;
	&lt;part name="list" type="xsd:string"/&gt;
	&lt;part name="gecos" type="xsd:string" xsd:minOccurs="0"/&gt;	
&lt;/message&gt;

&lt;message name="subscribeResponse"&gt;
	&lt;part name="return" type="xsd:boolean"/&gt;
&lt;/message&gt;

&lt;message name="loginRequest"&gt;
	&lt;part name="email" type="xsd:string"/&gt;
	&lt;part name="password" type="xsd:string"/&gt;
&lt;/message&gt;

&lt;message name="loginResponse"&gt;
	&lt;part name="return" type="xsd:string"/&gt;	
&lt;/message&gt;

&lt;message name="authenticateAndRunRequest"&gt;
	&lt;part name="email" type="xsd:string"/&gt;
	&lt;part name="cookie" type="xsd:string"/&gt;
	&lt;part name="service" type="xsd:string"/&gt;
	&lt;part name="parameters" type="tns:ArrayOfString" xsd:minOccurs="0"/&gt;
&lt;/message&gt;

&lt;message name="authenticateAndRunResponse"&gt;
	&lt;part name="return" type="tns:ArrayOfString" xsd:minOccurs="0"/&gt;	
&lt;/message&gt;

&lt;message name="casLoginRequest"&gt;
	&lt;part name="proxyTicket" type="xsd:string"/&gt;
&lt;/message&gt;

&lt;message name="casLoginResponse"&gt;
	&lt;part name="return" type="xsd:string"/&gt;	
&lt;/message&gt;

&lt;message name="listsRequest"&gt;
	&lt;part name="topic" type="xsd:string" xsd:minOccurs="0"/&gt;
	&lt;part name="subtopic" type="xsd:string" xsd:minOccurs="0"/&gt;
&lt;/message&gt;

&lt;message name="listsResponse"&gt;
	&lt;part name="listInfo" type="xsd:string"/&gt;	
&lt;/message&gt;

&lt;message name="complexListsRequest"&gt;
&lt;/message&gt;

&lt;message name="complexListsResponse"&gt;
	&lt;part name="return" type="tns:ArrayOfLists"/&gt;
&lt;/message&gt;

&lt;message name="checkCookieRequest"&gt;
&lt;/message&gt;

&lt;message name="checkCookieResponse"&gt;
	&lt;part name="email" type="xsd:string"/&gt;
&lt;/message&gt;


&lt;!-- portType part --&gt;

&lt;portType name="SympaPort"&gt;
	&lt;operation name="info"&gt;
		&lt;input message="tns:infoRequest" /&gt;
		&lt;output message="tns:infoResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="complexWhich"&gt;
		&lt;input message="tns:complexWhichRequest" /&gt;
		&lt;output message="tns:complexWhichResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="which"&gt;
		&lt;input message="tns:whichRequest" /&gt;
		&lt;output message="tns:whichResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="amI"&gt;
		&lt;input message="tns:amIRequest" /&gt;
		&lt;output message="tns:amIResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="review"&gt;
		&lt;input message="tns:reviewRequest" /&gt;
		&lt;output message="tns:reviewResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="subscribe"&gt;
		&lt;input message="tns:subscribeRequest" /&gt;
		&lt;output message="tns:subscribeResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="signoff"&gt;
		&lt;input message="tns:signoffRequest" /&gt;
		&lt;output message="tns:signoffResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="login"&gt;
		&lt;input message="tns:loginRequest" /&gt;
		&lt;output message="tns:loginResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="casLogin"&gt;
		&lt;input message="tns:casLoginRequest" /&gt;
		&lt;output message="tns:casLoginResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="authenticateAndRun"&gt;
		&lt;input message="tns:authenticateAndRunRequest" /&gt;
		&lt;output message="tns:authenticateAndRunResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="lists"&gt;
		&lt;input message="tns:listsRequest" /&gt;
		&lt;output message="tns:listsResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="complexLists"&gt;
		&lt;input message="tns:complexListsRequest" /&gt;
		&lt;output message="tns:complexListsResponse" /&gt;
	&lt;/operation&gt;
	&lt;operation name="checkCookie"&gt;
		&lt;input message="tns:checkCookieRequest" /&gt;
		&lt;output message="tns:checkCookieResponse" /&gt;
	&lt;/operation&gt;
&lt;/portType&gt;


&lt;!-- Binding part --&gt;

&lt;binding name="SOAP" type="tns:SympaPort"&gt;
&lt;soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
	&lt;operation name="info"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#info"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="complexWhich"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#complexWhich"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="which"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#which"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="amI"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#amI"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="review"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#review"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="subscribe"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#subscribe"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="signoff"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#signoff"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="login"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#login"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="casLogin"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#casLogin"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="authenticateAndRun"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#authenticateAndRun"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="lists"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#lists"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="complexLists"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#complexLists"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
	&lt;operation name="checkCookie"&gt;
		&lt;soap:operation soapAction="urn:sympasoap#checkCookie"/&gt;
			&lt;input&gt;
				&lt;soap:body use="encoded" 
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/input&gt;
			&lt;output&gt;
				&lt;soap:body use="encoded"
					namespace="urn:sympasoap" 
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
			&lt;/output&gt;
	&lt;/operation&gt;
&lt;/binding&gt;

&lt;!-- service part --&gt;


&lt;service name="SympaSOAP"&gt;
	&lt;port name="SympaPort" binding="tns:SOAP"&gt;
		&lt;soap:address location="[conf-&gt;soap_url]"/&gt;
	&lt;/port&gt;
&lt;/service&gt;

&lt;/definitions&gt;
</PRE>

<P>

<H1><A NAME="SECTION00950000000000000000">
8.5 Client-side programming</A>
</H1>

<P>
Sympa is distributed with 2 sample clients written in Perl and in PHP. Sympa SOAP server has also
been successfully tested with a UPortal Chanel as a Java client (using Axis). The sample PHP SOAP
client has been installed on our demo server :  <A NAME="tex2html30"
  HREF="http://demo.sympa.org/sampleClient.php">http://demo.sympa.org/sampleClient.php</A>.

<P>
Depending on your programming language and the SOAP library you're using, you will either directly 
contact the SOAP service (as with Perl SOAP::Lite library) or first load the WSDL description of
the service (as with PHP nusoap or Java Axis). Axis is able to create a stub from the WSDL document.

<P>
The WSDL document describing the service should be fetch through WWSympa's dedicated URL :
<B>http://your.server/wws/wsdl</B>.

<P>
Note : the <B>login()</B> function maintains a login session using HTTP cookies. If you are not able
to maintain this session by analysing and sending appropriate cookies under SOAP, then you
should use the <B>authenticateAndRun()</B> function that does not require cookies to authenticate.

<P>

<H2><A NAME="SECTION00951000000000000000">
8.5.1 Writting a Java client with Axis</A>
</H2>

<P>
First, download jakarta-axis (http://ws.apache.org/axis/)
<BR>
<P>
You must add the libraries provided with jakarta axis (v &gt;1.1) to you CLASSPATH. These libraries are  :

<P>

<UL>
<LI>axis.jar
</LI>
<LI>saaj.jar
</LI>
<LI>commons-discovery.jar
</LI>
<LI>commons-logging.jar
</LI>
<LI>xercesImpl.jar
</LI>
<LI>jaxrpc.jar
</LI>
<LI>xml-apis.jar
</LI>
<LI>jaas.jar
</LI>
<LI>wsdl4j.jar
</LI>
<LI>soap.jar
</LI>
</UL>

<P>
Next, you have to generate client java classes files from the sympa WSDL url. Use the following command :
<BR>
<P>
java org.apache.axis.wsdl.WSDL2Java -av  WSDL_URL
<BR>
<P>
For example :
<PRE>
java org.apache.axis.wsdl.WSDL2Java -av  http://demo.sympa.org/wws/wsdl
</PRE>

<P>
Exemple of screen output during generation of java files :
<BR> <PRE>
Parsing XML file:  http://demo.sympa.org/wws/wsdl
Generating org/sympa/demo/wws/msdl/ListType.java
Generating org/sympa/demo/wws/msdl/SympaPort.java
Generating org/sympa/demo/wws/msdl/SOAPStub.java
Generating org/sympa/demo/wws/msdl/SympaSOAP.java
Generating org/sympa/demo/wws/msdl/SympaSOAPLocator.java
</PRE>

<P>
If you need  more information or more generated classes (to have the server-side classes or junit testcase classes for example), you can get a list of switches :
<BR>    <PRE>
java org.apache.axis.wsdl.WSDL2Java -h
</PRE>
The reference page is :
<BR>
http://ws.apache.org/axis/java/reference.html

<P>
Take care of Test classes generated by axis, there are not useable as is. You have to stay connected between each test. To use junit testcases, before each soap operation tested, you must call the authenticated connexion to sympa instance.

<P>
Here is a simple Java code that invokes the generated stub to perform a casLogin() and a which() on the remote Sympa SOAP server :
<PRE>
SympaSOAP loc = new SympaSOAPLocator();
((SympaSOAPLocator)loc).setMaintainSession(true);
SympaPort tmp = loc.getSympaPort();
String _value = tmp.casLogin(_ticket);
String _cookie = tmp.checkCookie();
String[] _abonnements = tmp.which();
</PRE>

<P>

<HR>
<!--Navigation Panel-->
<A NAME="tex2html885"
  HREF="node10.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html879"
  HREF="sympa.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html873"
  HREF="node8.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html881"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html883"
  HREF="node23.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html886"
  HREF="node10.html">9. Authentication</A>
<B> Up:</B> <A NAME="tex2html880"
  HREF="sympa.html">Sympa Mailing Lists Management Software version</A>
<B> Previous:</B> <A NAME="tex2html874"
  HREF="node8.html">7. WWSympa, Sympa's web interface</A>
 &nbsp <B>  <A NAME="tex2html882"
  HREF="node1.html">Contents</A></B> 
 &nbsp <B>  <A NAME="tex2html884"
  HREF="node23.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
root
2004-09-10
</ADDRESS>
</BODY>
</HTML>