Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6649233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:44:58+00:00 2026-05-26T00:44:58+00:00

I have a SOAP service and I generated classes and functions on SudzC.com .

  • 0

I have a SOAP service and I generated classes and functions on SudzC.com.

So I’m using the soap functions they generated, it returns an NSMutableArray with objects that are inherited by my custom class(which is generated by them, too).

So far everything’s good. My values are getting into the array and I could see any property of any object with one condition: Only inside of the function that’s handling the service.

Just to make it clear, here is the code:

- (void)viewDidLoad
{
    SDZGeneratedWebService* service = [SDZGeneratedWebService service];
    service.logging = YES;

    [service callMyData:self action:@selector(callMyDataHandler:) dataId: 1];
    [super viewDidLoad];
}

- (void) callMyDataHandler: (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 NSMutableArray* result
    NSMutableArray *result = (NSMutableArray *)value;
    MyCustomClass *myObject = [result objectAtIndex:0];
    NSLog(@"%@", myObject.myProperty); //Works Great
}

Like I said, so far everything’s perfect. But I need to use the data outside of this function.

So in my .h file, I created an array like NSMutableArray *myDataArray;

When I intend to copy the result array to myDataArray, it copies the objects(I can see that the myDataArray.count value is equal to result array’s) but all the objects are “out of scope“. So I cannot use them.

I also tried to copy all objects by indexes in a for loop, nope, the objects are getting their values, but when I “addObject” to myDataArray, same, out of scope.

What is wrong here? Can’t I generate an array of a custom class this way?

Edit: The code I’m generating myDataArray:

    myDataArray = [[NSMutableArray alloc] init];
    [myDataArray removeAllObjects];
    for (int i=0; i<((NSMutableArray *)result).count; i++) {
        MyCustomClass *myObject = [result objectAtIndex:i];
        [myDataArray addObject:myObject];
        [myObject release];
    }

    [self.tableView reloadData];
} //(End of callMyDataHandler function)

I before tried this way, too:

    [myDataArray removeAllObjects];
    duyurular = [result mutableCopy];
} //(End of callMyDataHandler function)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:44:59+00:00Added an answer on May 26, 2026 at 12:44 am

    You can copy objects from one array to another using this method:

    NSArray *source;
    NSArray *dst = [[NSArray alloc] initWithArray:source];
    

    In your code you should remove line: [myObject release]; and I would better call [((NSMutableArray *)result) count] rather then using dot notation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SOAP service that returns an array of a complex type. The
I have a basic SOAP service that I generated from a provided WSDL. The
I Have an internal SOAP Web service that is being called from an external
I have a complex RIA client that communicates with a WCF SOAP web service,
I have an ASP.NET web service running that accepts both HTTP POST and SOAP
I have a SOAP request that is known to work using a tool like,
A little up front info: I have a SOAP service (hosted using JAX-WS (Endpoint
All, I have this SOAP web service, the way I do it is generated
I have a classes defined as below (generated using xsd): [GeneratedCodeAttribute(xsd, 4.0.30319.1)] [SerializableAttribute] [DebuggerStepThroughAttribute]
We're trying to consume a web service (Soap) and have generated an adapter for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.