Getting started with TouchStack

Receiving notifications about the request progress

Handling basic HTTP authentication challenges

About one-way service requests

Passing additional state information

When you launch a web-service request to the server you may want to pass additional state information in order to later access it in your result and error delegates. You can do so as follows:

1. Pass the additional information as the second parameter of the Send method overload:

service.Send(request, "My State Info");

The state is declared as object so you can pass anything you want as additional state information, not just a string.

2. Retrieve it in your result and/or error delegates

service.ServiceResult += delegate(object sender, ServiceResultArgs<TypeOfResponse> args) {
	Console.WriteLine(args.State);
};

service.ServiceError += delegate (object sender, ServiceErrorArgs args) {
	Console.WriteLine(args.State);
};

-=-

Last edited Dec 12, 2011 at 10:17 AM by alexandruboia, version 6

Comments

No comments yet.