阻止 Sudzc 生成的 SOAP 请求

发布于 2024-12-13 14:31:31 字数 688 浏览 2 评论 0原文

我正在开发一个使用 Sudzc 与 SOAP Web 服务交互的应用程序。除了对 SoapRequest.h 进行一些修改以及对对象序列化进行一些更改之外,该服务生成的模板运行良好。
默认情况下,模板提供了使用已创建的方法发送 SOAP 请求的可能性,如下所示:

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

请求完成后,控制权将交给处理程序,并由 SOAP 响应返回的值,如下所示:

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

我想知道是是否有可能阻止所发出的请求,而不是强制结束请求。
例如,如果用户从具有 backButton 活动状态的 UINavigationController 发出请求(我知道我可以禁用它,直到请求完成),但是如果用户返回对于前一个控制器,我想阻止活动请求。

我希望它很清楚(如果不是,请告诉我)。

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).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

抽个烟儿 2024-12-20 14:31:31

从服务调用该方法实际上会返回一个 SoapRequest* 对象,您可以使用该对象来管理请求,包括取消请求。例如,您可以这样做...

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

希望有帮助!

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!

生死何惧 2024-12-20 14:31:31

为什么不在 https://twitter.com/#!/sudzc 上询问他们?

我不知道 Sudzc,但我总是在我的服务中创建一个方法 cancelConnection ,可以从 UINavigationController 中的 dealloc 调用该方法。他们当然也做了同样的事情。祝你好运

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文