0

This is my SoapRequest:

SoapRequest* _request = [SoapRequest create: _target action: _action service: self soapAction: @"" postData: _envelope deserializeTo: /*[[DMDDmdInfo alloc] autorelease]*/ [NSMutableArray array]];

I should receive NSMutableArray of DMDDmdInfo objects. Instead I receive NSMutableArray of NSDictionaries.

This is what I have in SoapRequest:connectionDidFinishLoading:

CXMLNode* element = [[Soap getNode: [doc rootElement] withName: @"Body"] childAtIndex:0];
    if(deserializeTo == nil) {
        output = [Soap deserialize:element];
    } else {
        if([deserializeTo respondsToSelector: @selector(initWithNode:)]) {
            //element = [element childAtIndex:0];
            output = [deserializeTo initWithNode: element];
        } else {
            NSString* value = [[[element childAtIndex:0] childAtIndex:0] stringValue];
            output = [Soap convert: value toType: deserializeTo];
        }
    }

Could you please help me solving this issue, to get the desired results: NSMutableArray of DMDDmdInfo objects?

Oleg Danu
  • 4,149
  • 4
  • 29
  • 47

2 Answers2

0

The following code worked for me, we need to specify the SoapArray object for deserializeToparam

SoapRequest* _request = [SoapRequest create: _target action: _action service: self soapAction: @"" postData: _envelope deserializeTo: [[[SoapArray alloc] init] autorelease]];
Nikesh K
  • 621
  • 6
  • 10
-1

although I am still working on it, in my project I used the following code to get a NSMutableArray of the returned objects. I also made some tweaks to SoapRequest.m but you should try first with this little change and see if it works

SoapRequest* _request = [SoapRequest create: _target action: _action service: self soapAction: @"" postData: _envelope deserializeTo: [[[NSMutableArray alloc] init] autorelease]];
maggix
  • 3,268
  • 1
  • 22
  • 36
  • Your construction [[NSMutableArray alloc] autorelease] does not make sense, it is an erroneus one. – Oleg Danu Jun 14 '12 at 11:27
  • While I'd like you to note that the above construction may have been wrong, it worked for me. The one in the code now should be correct, and I'd like to know if this solution works for you. We are definitely working on different web services, and the returned item may be different, but the solution above is the one that worked for me changing from [[SudzCItem alloc] autorelease] to the NSMutableArray – maggix Jun 22 '12 at 08:24