Incomplete SOAP response

297 Views Asked by At

I'm working with a WDSL translated with SUDZ to Objective-C, one of the methods returns a XML with parameters to call a service. The problem is that it isn't working as expected because of the translation of SudzC and I'm looking some kind of solution (I have been writing emails for almost 2 months and SudzC don't answer)

My idea is: How can I get the COMPLETE soap answer to parse it later? It could be enough.

Because the problem is that it is only taking the first parameter. If I call the method this is the answer of the handler:

handler

But then in the answer ('value') there is nothing like 'NextParameter'. Indeed, If I use 'objectAtIndex', 'allKeys'.. it throw me an exception.

enter image description here

This is the method:

Method

The WSDL is working, I have tried with the original in Java and here it is a little fragment of the answer:

http://i.imgur.com/dCcOrYg.png

1

There are 1 best solutions below

3
On

I used Sudzc + XMLDictionary (https://github.com/nicklockwood/XMLDictionary) class, to convert the SOAP xml to a dictionary.

Create a new request and set the delegate like this:

[[super soapService] products:self
                      parameter1:@"1"];

#pragma mark - SoapDelegate

- (void)onload:(id)value {
    NSDictionary *soapDictionary = [NSDictionary dictionaryWithXMLString:value];

    NSDictionary *bodyDictionary = [soapDictionary objectForKey:@"soapenv:Body"];


// here you can parse the SOAP response
    NSDictionary *productsDictionary = [[bodyDictionary objectForKey:@"ns1:prductsresponse"] objectForKey:@"products"];

}