Some tips when creating WCF web service for iPad consumption

Continuation of previous post.

1) WCF get does not like “NULL” column in the query results

2) // note the “id” should match in declaration and method

[OperationContract]
[WebGet(UriTemplate = “foremen/location/{id}”), Description(“Returns the specified foreman from collection. Returns NotFound if there is no such customer.”)]
List GetForemenByLocation(string id);

3) Plus the old “alphetic” requirement for POST method when invoke web service (see Foreman project iOS code)

NSString* myString = [[NSString alloc] initWithFormat:@”%@%f%f%f%@%fhttp://localhost/EquipmentWcfService/uptime%f%@%@%f%@“, uptime.comments, uptime.down, uptime.idle, uptime.lunch, uptime.unit, uptime.operating, uptime.endMeter, uptime.lastLoad, uptime.lastUpdate, uptime.startUp_ShutDown, uptime.userName];

Leave a comment