使用sudzc从SOAP响应访问解析的值?

时间:2012-06-19 11:19:42

标签: iphone soap sudzc

我使用sudzc创建了一个SOAP Web请求。我不需要在sudzc上对xml响应进行任何单独的解析。问题是我无法访问响应处理程序上的已解析值。我的sudzc文件说它返回值“ArrayOfCategory”。 这是我的处理程序

 [service GetBuyerCategories:self action:@selector(GetBuyerCategoriesHandler:) Email: @"email" Password: @"pass" Token: @"534543543"];

 - (void) GetBuyerCategoriesHandler: (id) value {

  // Handle errors
  if([value isKindOfClass:[NSError class]]) {
    NSLog(@"%@", value);
    return;
 }

  // Handle faults
  if([value isKindOfClass:[SoapFault class]]) {
    NSLog(@"%@", value);
    return;
 }              


// Do something with the MFLArrayOfCategory* result
  MFLArrayOfCategory* result = (MFLArrayOfCategory*)value;

  NSLog(@"GetBuyerCategories returned the value: %@", result);

  }

但在nslog中它返回的值如

GetBuyerCategories returned the value: <ArrayOfCategory></ArrayOfCategory>

xml数据是

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetBuyerCategoriesResponse xmlns="http://www.bids4all.com"><CategoriesList><Category><CategoryID>13</CategoryID><CategoryName>Apparels &amp; Fashion</CategoryName><CategoryDesc>Apparels &amp; Fashion related categories</CategoryDesc></Category><Category><CategoryID>6</CategoryID><CategoryName>Computer Equipment</CategoryName><CategoryDesc>Looking for computer products for your office? Choose a specific product from the list below. You will find free online quoting; practical, expert purchasing advice; advice from other buyers; and multi-vendor buying tools.</CategoryDesc></Category><Category><CategoryID>1</CategoryID><CategoryName>Software</CategoryName><CategoryDesc>Looking for software for your office? Choose a specific product from the list below. You will find free online quoting; practical, expert purchasing advice; advice from other buyers; and multi-vendor buying tools.</CategoryDesc></Category></CategoriesList></GetBuyerCategoriesResponse></soap:Body></soap:Envelope>

是他们在数组中单独获取CategoryID,CategoryName和CategoryDe​​sc的任何方法。

0 个答案:

没有答案