xsp/test
Lluis Sanchez 1c8eae65eb Changed directory structure and added tests for asp.net 2.0
svn path=/trunk/xsp/; revision=39262
2005-01-20 17:22:57 +00:00
..
1.1 Changed directory structure and added tests for asp.net 2.0 2005-01-20 17:22:57 +00:00
2.0 Changed directory structure and added tests for asp.net 2.0 2005-01-20 17:22:57 +00:00
.cvsignore 2004-04-06 Gonzalo Paniagua Javier <gonzalo@ximian.com> 2004-04-06 02:07:09 +00:00
DumpExtension.cs Write dump.log in the temp directory 2004-06-20 10:41:50 +00:00
EncryptExtension.cs * README: added descrption of web service samples. 2003-07-09 19:22:39 +00:00
Makefile.am Changed directory structure and added tests for asp.net 2.0 2005-01-20 17:22:57 +00:00
README update 2003-07-09 21:23:37 +00:00
favicon.ico 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com> 2004-06-15 16:14:57 +00:00
global.asax Changed directory structure and added tests for asp.net 2.0 2005-01-20 17:22:57 +00:00
index.aspx Changed directory structure and added tests for asp.net 2.0 2005-01-20 17:22:57 +00:00
index2.aspx Changed directory structure and added tests for asp.net 2.0 2005-01-20 17:22:57 +00:00
mod-mono-server.exe.config 2004-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com> 2004-05-03 21:49:53 +00:00
mono-powered-big.png 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com> 2004-06-15 16:14:57 +00:00
mono-xsp.css Changed directory structure and added tests for asp.net 2.0 2005-01-20 17:22:57 +00:00
mono.png 2002-07-28 Gonzalo Paniagua Javier <gonzalo@ximan.com> 2002-07-28 18:51:02 +00:00
monobutton.png 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com> 2004-06-15 16:14:57 +00:00
sample.webapp 2004-11-21 Gonzalo Paniagua Javier <gonzalo@ximian.com> 2004-11-21 23:56:11 +00:00
small-icon.png 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com> 2004-06-15 16:14:57 +00:00
web.config 2004-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com> 2004-06-05 02:48:27 +00:00
xsp.exe.config 2003-09-22 Gonzalo Paniagua Javier <gonzalo@ximian.com> 2003-09-22 21:00:03 +00:00

README

xsp/test
---------
This directory contains little sample ASP.NET pages.

About Web Services samples
--------------------------

Summary of files:

TestService.asmx: A simple web service
ConverterService.asmx: Currency converter web service
DumpExtension.cs: Soap extension that dumps all requests to a file.
EncryptExtension.cs: Soap extension that encrypts all requests.
TraceExtension.cs: Soap extension that logs the soap messages.
ServiceClient.cs: Simple web service client
Reference.cs: Web service client proxies.
ServiceClient.exe.config: Configuration file for ServiceClient.

There are two sample web services, implemented in TestService.asmx and
ConverterService.asmx.

TestService.asmx is a very simple web services with two methods. It shows how
simple is to implement web services using ASP.NET.

The ConverterService implements a simple currency converter. With it you can
make conversions between a limited set of currencies, get a list of currency
rates, get the rate of a given currency or change the rate of a currency.

This sample shows most of the functionality you can get from ASP.NET
web services. 

The service uses Soap headers to keep information about the currently logged
user. Before calling any other method, the client must call Login(). This
method generates an Out header with user information that is sent and stored
in the client. All subsequent calls will include that header so the server
will be able to validate the user.

This WS also makes extensive use of Soap extensions. There are three of them:

- DumpExtension (DumpExtension.cs): This is a global extension that must be 
  configured in the web.config file. It dumps all requests and responses to
  the file dump.log. It will only dump the calls of classes that have the
  [Dump] attribute.
  
- EncryptExtension (EncryptExtension.cs): This extension uses the Rijndael
  algorithm to encrypt all information exchanged between the server and the
  client. For it to work, the web service class must have the [Encrypt]
  attribute. The client proxy class used to connect to the service must also
  have that attribute (see Reference.cs). This is also a global extension
  that must be configured in web.config.
  
- TraceExtension (TraceExtension.cs): This extensions logs the soap requests
  and responses to the file trace.log. The difference between TraceExtension
  and DumpExtension is that TraceExtension logs requests after it's been
  deserialized, so it can log the method name and parameter types and values.
  On the other hand DumpExtension just does a raw dump of the received stream.
  Another difference is that TraceExtension can be applied to individual
  methods, using the attribute [TraceExtension].

In the client side, the client proxies are implemented in Reference.cs.
There is a sample client implemented in ServiceClient.cs that makes some calls
to the services. 

How to test
-----------

Build XSP and start the server as usual.
cd to xsp/test and run ServiceClient.exe passing the hostname and port:

For example:

	mono ServiceClient.exe localhost:8080

After execution, you should see the files trace.log and dump.log in
xsp/server/test with the traces of the requests. You can try to add and remove
the encrypt extension from web.config and ServiceClient.exe.config and see
in dump.log the information being sent in each case.