I have this response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:SurfaceElementListResponse xmlns:ns2="http://isiows.isiom.fr/schema/DmdCreation" xmlns:ns3="http://isiows.isiom.fr/schema/Error" xmlns:ns4="http://isiows.isiom.fr/schema/DmdDetail">
<SurfaceElementListResult>
<idSurfaceElement>9482</idSurfaceElement>
<name>R04-</name>
<type>NIVEAU</type>
</SurfaceElementListResult>
<SurfaceElementListResult>
<idSurfaceElement>9486</idSurfaceElement>
<name>Zone A</name>
<type>ZONE</type>
</SurfaceElementListResult>
</ns2:SurfaceElementListResponse>
</soap:Body>
</soap:Envelope>
I am waiting each object to be deserialized to NSDictionary, as it works on all the other WS response except one above.
In comparison with other responses, in SOAP.m:+ (id) deserialize: (CXMLNode*) element
method, all the responses for the statement NSString* type = [Soap getNodeValue:element withName:@"type"];
return nil, so it is continues with return [Soap deserializeAsDictionary:element];
and I get the necessary result.
In my case when I reach to NSString* type = [Soap getNodeValue:element withName:@"type"];
the statement returns "NIVEAU" for the first object and "ZONE" for the other object, which does not allow the application go and execute [Soap deserializeAsDictionary:element];
and I get a string object instead of NSDictionary as parse result.
Could you please help me solving this issue?
In
looking into the [Soap getNodeValue]... I figured out, that the use of this function is rather too general. It is used as for getting the attributes of the field, as the values of the fields.
In this care I created a new method which is getting only the attribute value:
and replaced it in Soap:deserialize:
And it works perfectly for me, till now. Hope it will help others with the same situation.