Note that there are some explanatory texts on larger screens.

plurals
  1. POObjective C - sudzc, returns empty ArrayOfString, but xml response contains data
    primarykey
    data
    text
    <p>I'm newbie in Objective C. I'm trying to consume an webservice with sudcz. I've got and Webservice server created in PHP an MySQL and now I'd like to comunicate with the server and getting a relevant results. </p> <p>When calling a method i'm getting corrent XML response from the server but returned object of type ArrayOfString seems to be empty. NSLog prints just &lt;ArrayOfString>&lt;/ArrayOfString>, i'm assuming sudzc wasn't albe to parse xml in to a aproporiate form therefore the returned object is empty, am I wrong ? or I just cant see or cope with the returned object ? Has someone got any clue ?</p> <p>If any materials needed i'll post them. Thx. </p> <p>Added : </p> <pre><code> CXMLElementNode* element = [[Soap getNode: [doc rootElement] withName: @"Body"] childAtIndex:0]; if(deserializeTo == nil) { output = [Soap deserialize:element]; } else { NSLog(@"Deserialize to : %@", deserializeTo); if([deserializeTo respondsToSelector: @selector(initWithNode:)]) //problematic section element = [element childAtIndex:0]; NSLog(@"NSSstring element : %@", element); output = [deserializeTo initWithNode: element]; } else { NSString* value = [[[element childAtIndex:0] childAtIndex:0] stringValue]; NSLog(@"NSSstring value : %@", value); output = [Soap convert: value toType: deserializeTo]; } NSLog(@"output : %@", output); } </code></pre> <p>I think the problematic section is where I putted comments problematic section. Because object element is xml element and after calling output = [deserializeTo initWithNode: element], nothing happens, NSLog(output) prints the same output as printed NSLog(deserializeTo) before calling message initWithNode: element on object deserializeTo I suspect SoapObject instance method initWithNode that it doesn't work as it should, because my deserializeTo is instance of class RSiArrayOfstring a that class is subset of SoapObject and it delegates this message to parent class (SoapObject) and the implementation of this message in SoapObject is :</p> <pre><code>// Called when initializing the object from a node - (id) initWithNode: (CXMLNode*) node { if(self = [self init]) { } return self; } </code></pre> <p>i can't see any manipulation with argument node</p> <p>OUTPUT from debugger during executing this code : </p> <pre><code>2012-02-08 20:22:03.166 URS[1170:b603] Deserialize to : &amp;lt;ArrayOfstring&gt;&amp;lt;/ArrayOfstring&gt; 2012-02-08 20:23:17.258 URS[1170:b603] NSSstring element : &amp;lt;CXMLElement 0x5d7b920 [0x59701b0] return &amp;lt;return arrayType="SOAP-ENC:Array[6]" type="SOAP-ENC:Array"&gt;&amp;lt; item arrayType="xsd:string[1]" type="SOAP-ENC:Array"&gt;&amp;lt; item type="xsd:string"&gt;1 - Elektroúdržba&amp;lt;/item&gt;&amp;lt; /item&gt;&amp;lt; item arrayType="xsd:string[1]" type="SOAP-ENC:Array"&gt;&amp;lt; item type="xsd:string"&gt;2 - Zámočnícka dielňa&amp;lt; /item&gt;&amp;lt; /item&gt;&amp;lt; item arrayType="xsd:string[1]" type="SOAP-ENC:Array"&gt;&amp;lt; item type="xsd:string"&gt;3 - Údržba žeriavov&lt;/item&gt;&amp;lt; /item&gt;&amp;lt; item arrayType="xsd:string[1]" type="SOAP-ENC:Array"&gt;&amp;lt; item type="xsd:string"&gt;6 - Zámočnícká dielňa H4&amp;lt; /item&gt;&amp;lt; /item&gt;&amp;lt; item arrayType="xsd:string[1]" type="SOAP-ENC:Array"&gt;&amp;lt; item type="xsd:string"&gt;4 - Mechanici&amp;lt; /item&gt;&amp;lt; /item&gt;&amp;lt; item arrayType="xsd:string[1]" type="SOAP-ENC:Array"&gt;&amp;lt; item type="xsd:string"&gt;5 - Údržba CNC&amp;lt; /item&gt;&amp;lt; /item&gt;&amp;lt; /return&gt;&gt; 2012-02-08 20:56:11.353 URS[1170:b603] output : &amp;lt; ArrayOfstring&gt;&amp;lt; /ArrayOfstring </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload