3

I'm trying to make my Monotouch app work with WCF service. Everything works fine but every now and then (10 - 30 service calls), app crashes with SIGIL. Debugger says just that. It happens on random places.

Another employee works on iPhone app which uses same service. Same problem, but more frequent.

Everything works great when testing on simulator.

If somebody's had same problem, please help. Would using asmx service help?

Thank you all.

Cheers

Mr Q
  • 127
  • 8
  • 2
    Hook up `AppDomain.CurrentDomain.UnhandledException` and put a try-catch in your `static void Main`, write the exception to `Console.WriteLine`. Plug in the device and open XCode's console and cause the crash. You should be able to see any .Net exceptions in XCode's console. Does that give any more info? – jonathanpeppers Jul 18 '11 at 13:54
  • Thank you very much for your reply. However, I'm not any smarter. Jul 18 17:22:17 unknown com.apple.SpringBoard[30] : CoreAnimation: timed out fence 500 --- No exceptions at all!! And, this wasn't a timed out in app. – Mr Q Jul 18 '11 at 15:29
  • When are you calling the service? On app start by any chance? – Ian1971 Jul 18 '11 at 16:00
  • Yeah, could you by chance be doing this on the UI thread? Might be worth a shot to use a ThreadPool thread. – jonathanpeppers Jul 18 '11 at 17:00

2 Answers2

10

WCF is a bloated option on high traffic servers at the best of days, using SOAP in a mobile application is a enough of a waste of resources that it should be considered bad practice.

ServiceStack is a much leaner and faster option that also allows you to access your same web services with ServiceStack's strong-typed, code-gen-free Service Client's using .NET's fastest JSON and JSV Text serializers.

The MonoTouch versions of ServiceStack's service clients is available separately from: https://github.com/ServiceStack/ServiceStack/tree/master/release/latest/MonoTouch

And an example MonoTouch application that showing how to use is available here: https://github.com/ServiceStack/ServiceStack.Examples/tree/master/src/MonoTouch/RestFilesClient

mythz
  • 141,670
  • 29
  • 246
  • 390
2

Not much an answer, but I had a similar issue. Worked for a long time to get my desktop WCF client code running on MonoTouch, only to have the app die after 10 or so calls on SIGIL.

Symbolicating and analysing the crash reports showed the app dying somewhere in the WCF stack every time. However I could not distill the issue down into a trivial, reproducable example.

In the end I used the ServiceStack framework (http://www.servicestack.net/) to throw a simple XML REST endpoint in front of my service, and called it using simple WebClient requests and some helper methods to push my objects to/from XML (DataContractSerializer was too slow).

If you have access to the server side, this may be your simplest approach.

TheNextman
  • 12,428
  • 2
  • 36
  • 75
  • I've just switched to asmx service. Works like a charm. It hasn't crashed at all. But thank you for your reply. – Mr Q Jul 21 '11 at 12:22