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.
My code for the parameter is:
NSData *myPostData = [[NSString stringWithFormat:@"{\"parameter1\":\"%@\"}",mynsmutablearraylist] dataUsingEncoding:NSUTF8StringEncoding];
NSMutableData *myMutablePostData = [NSMutableData dataWithData:myPostData];
The parameter type in wcf is like List< TypeClass>.
I can see the values of the object and keys of the mynsmutablearraylist. But I can't understand why it doesn't work.
This wcf method works for the Win8 metro application but I can't make it work for IOS.
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:
Added Info:
When I test the parameters with the exactly the same values , it works fine. The part of the Request in SOAPUI:
> >....
> > <tem: parameter4>parvalue</tem: parameter4>
> > < tem: typeclass>
> > <!--Zero or more repetitions:-->
> > <ser:TypeClass>
> >
> > <ser:drugId></ser:drugId>
> > <ser:drugname></ser:drugname>
> > </ser:TypeClass>
> > <ser:TypeClass>
> >
> > <ser:drugId></ser:drugId>
> > <ser:drugname></ser:drugname>
> > </ser:TypeClass>
> > </ tem: typeclass>
> > ...