2006-11-02 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.Web.Services / Test / standalone / README
1 Web Service Test Suite
2 ----------------------
3
4 This directory contains a test suite for testing Web Services. It tests:
5
6 * Proxy generation using the wsdl tool
7 * Access to web services using the generated client proxies
8 * Execution of web services in the server
9
10 This suite not only tests web services running on XSP, but it can also test
11 services running on other platforms and that are available in internet. This
12 will help track down interoperability issues.
13
14 To build the test suite, just run:
15
16 > xsp --nonstop --root server &
17 > make
18
19 This will download the wsdl documents, generate the proxies, build a dll with
20 the proxies, and build the nunit tests. Then you can use nunit-console or
21 gnunit to run the tests (the nunit dll is testclient.dll).
22
23 Which services are tested?
24 --------------------------
25
26 The file services.xml contains the list of services to test. There is an
27 xml element for each web service with the following structure:
28
29   <service>
30     <wsdl>url</wsdl>                                    // url to the wsdl document
31     <name>name</name>                                   // name of the service
32     <protocols>                                                 // List of protocols for which to
33       <protocol>Soap</protocol>                 // generate a proxy
34       <protocol>HttpGet</protocol>
35       <protocol>HttpPost</protocol>
36     </protocols>
37     <clientTest>true</clientTest>               // True if there is a nunit test
38   </service>                                                    // for the service
39
40 Notice that not all web services will have a corresponding nunit test, since
41 such test is not allways possible. However, proxy generation will be tested
42 for all of them.
43
44 You can manually add new services to the list or use the wstest tool to add
45 a list of references included in a DISCO document. For example:
46
47 > ./wstest ur <url> <ignore-file>
48
49 This will download the DISCO document from the provided <url> and add an entry
50 for each service referenced in the document. The second parameter is optional,
51 it is a file that contains a list of wsdl urls that should be ignored from the
52 document.
53
54 The current Makefile downloads references from the following locations:
55
56 * http://www.xmethods.net/default.disco
57 * http://localhost:8080/xsp.disco
58
59 Creating a new nunit test
60 -------------------------
61
62 To test services running in XSP, just add the asmx file in the "server"
63 directory and update the xsp.disco file in there. Then run "make".
64
65 To create a nunit test for a web service already registered, just run:
66
67 > ./wstest gc <url>
68
69 Where url is the URL of the service's WSDL document. This will generate a class
70 in the "client" directory with a basic structure. You should then manually
71 implement the test.
72
73 Other useful targets in of the makefile
74 ---------------------------------------
75
76 make update:    Updates the services.xml list with the references from 
77                 http://www.xmethods.net/default.disco and
78                                 http://localhost:8080/xsp.disco
79                          
80 make gen:               Generates proxies for new service references.
81
82 make regen:             Regenerates all proxies
83
84 make cls:               Removes obsolete proxies and tests.
85
86 make proxies:   Builds the proxy library.
87
88 make tests:             Builds the nunit library.
89
90 make tools:             Builds wstest.
91