我正在开发一个使用WSDL服务器的应用程序。我已经从wsdl2objc生成了代码。我已经完成了创建soap信封请求头的工作,即将开始服务器调用。你们中的谁可以建议我如何捕获服务器调用的响应。在生成的sudzc代码中,是否有像onload()方法这样的委托方法来捕获响应?
发布于 2013-07-02 04:58:55
您可以在这里找到处理响应的示例代码:
- (IBAction)buttonPressed:(id)sender {
LocalTimeSoapBinding *binding = [[LocalTime LocalTimeSoapBinding] initWithAddress:@"http://www.ripedevelopment.com/webservices/LocalTime.asmx"];
binding.logXMLInOut = YES; // to get logging to the console.
LocalTime_LocalTimeByZipCode *request = [[LocalTime_LocalTimeByZipCode alloc] init];
request.ZipCode = @"29687"; // insert your zip code here.
LocalTimeSoapBindingResponse *resp = [binding LocalTimeByZipCodeUsingParameters:request];
for (id mine in resp.bodyParts)
{
if ([mine isKindOfClass:[LocalTime_LocalTimeByZipCodeResponse class]])
{
field.text = [mine LocalTimeByZipCodeResult];
}
}
}https://stackoverflow.com/questions/11617750
复制相似问题