Block SOAP request generated by Sudzc

882 Views Asked by At

I'm working on an application that uses Sudzc to interface with a SOAP web-service. The templates generated by the service works well, apart some modification SoapRequest.h, and some changes to the object serialization.
By default, the template offers the possibility to send the SOAP request using a method already created like this:

MyService* service = [MyService service];
[service login:self action:@selector(handleLogin:) user:@"user" password:@"pass"];

Once the request is finished, control is given to the handler with the value returned by the SOAP response like this:

- (void) handleLogin: (id) value{
  //cast value to your object
}

What I would like to know is if there is a possibility to block the request made, rather than by force to end the request.
For example, if the user makes a request from a UINavigationController who has backButton active (i know i could disable it until the request has been completed), but if the user returns to the previous controller, i would like to block the active request.

I hope it is clear(let me know if it is not).

2

There are 2 best solutions below

1
On BEST ANSWER

Calling the method from your service actually returns a SoapRequest* object that you can use to manage the request, including canceling it. For instance, you could do this...

MyService* service = [MyService service];
SoapRequest* request = [service login:self action:@selector(handleLogin:) user:@"user" password:@"pass"];
[request cancel];

Hope that helps!

0
On

why not asking them on https://twitter.com/#!/sudzc ?

I don't know Sudzc, but I always create a Method cancelConnection in my services that can be called from dealloc in a UINavigationController. They have certainly done the same. Good luck