简体   繁体   English

我们到底需要在iPhone上针对Web服务进行异常处理的地方

[英]where exactly do we need exception handling for web-services on iPhone

I am a new iPhone developer and totally new to web-services as well. 我是一名新的iPhone开发人员,并且对Web服务也完全陌生。 I had used http://www.sudzc.com/ to develop my obj-c code for my wsdl. 我曾使用http://www.sudzc.com/为wsdl开发obj-c代码。 I need to know that where exactly i need to handle exceptions in this code? 我需要知道在这段代码中到底需要在哪里处理异常? Or the code generated by sudz itself takes care of the exception handling itself? 还是sudz本身生成的代码负责异常处理本身?

Generally the proxy classes from the WSDL has selector methods which gets called,when you do some operation/method call. 通常,WSDL中的代理类具有选择器方法,当您执行一些操作/方法调用时,该选择器方法将被调用。 So you just need to check it out what method (from service level) you are going to call and implement the selector method in your class. 因此,您只需要检查一下要调用的方法(从服务级别),并在您的类中实现选择器方法即可。

Look at the example code generated for your web service. 查看为您的Web服务生成的示例代码。 They give you the generic layout for the error handlers. 它们为错误处理程序提供了通用布局。 Should look something like this: 应该看起来像这样:

// Handle the response from webserviceConnection. //处理来自webserviceConnection的响应。

  • (void) webserviceConnectionHandler: (BOOL) value { (无效)webserviceConnectionHandler :(布尔值){

    // Do something with the BOOL result //对BOOL结果进行处理

    NSLog(@"webserviceConnection returned the value: %@", [NSNumber numberWithBool:value]); NSLog(@“ webserviceConnection返回值:%@”,[NSNumber numberWithBool:value]);

} }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM