Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to de-serialize an object in objective-C
    primarykey
    data
    text
    <p>I have an error when I try to make a wcf method work. One of the parameters are NSMutableArray and the Object type is TypeClass. I checked everything with the NSMutableArray and everything seems fine. </p> <p>My code for the parameter is:</p> <pre><code>NSData *myPostData = [[NSString stringWithFormat:@"{\"parameter1\":\"%@\"}",mynsmutablearraylist] dataUsingEncoding:NSUTF8StringEncoding]; NSMutableData *myMutablePostData = [NSMutableData dataWithData:myPostData]; </code></pre> <p>The parameter type in wcf is like List&lt; TypeClass>.</p> <p>I can see the values of the object and keys of the mynsmutablearraylist. But I can't understand why it doesn't work.</p> <p>This wcf method works for the Win8 metro application but I can't make it work for IOS.</p> <blockquote> <p>The server encountered an error processing the request. The exception message is 'The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:typeclass. The InnerException message was 'There was an error deserializing the object of type System.Collections.Generic.List`1[[ServiceOfMine.Entities.TypeClass, ServiceOfMine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]. Encountered invalid character ' '.'. Please see InnerException for more details.'. See server logs for more details. The exception stack trace is: </p> </blockquote> <p><strong>Added Info:</strong></p> <p>When I test the parameters with the exactly the same values , it works fine. The part of the Request in SOAPUI:</p> <pre><code>&gt; &gt;.... &gt; &gt; &lt;tem: parameter4&gt;parvalue&lt;/tem: parameter4&gt; &gt; &gt; &lt; tem: typeclass&gt; &gt; &gt; &lt;!--Zero or more repetitions:--&gt; &gt; &gt; &lt;ser:TypeClass&gt; &gt; &gt; &gt; &gt; &lt;ser:drugId&gt;&lt;/ser:drugId&gt; &gt; &gt; &lt;ser:drugname&gt;&lt;/ser:drugname&gt; &gt; &gt; &lt;/ser:TypeClass&gt; &gt; &gt; &lt;ser:TypeClass&gt; &gt; &gt; &gt; &gt; &lt;ser:drugId&gt;&lt;/ser:drugId&gt; &gt; &gt; &lt;ser:drugname&gt;&lt;/ser:drugname&gt; &gt; &gt; &lt;/ser:TypeClass&gt; &gt; &gt; &lt;/ tem: typeclass&gt; &gt; &gt; ... </code></pre>
    singulars
    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.
 

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