3

我正在尝试使我的 Monotouch 应用程序与 WCF 服务一起使用。一切正常,但时不时(10 - 30 次服务调用),应用程序因 SIGIL 崩溃。调试器就是这么说的。它发生在随机的地方。

另一名员工在使用相同服务的 iPhone 应用程序上工作。同样的问题,但更频繁。

在模拟器上测试时一切正常。

如果有人遇到同样的问题,请帮忙。使用 asmx 服务会有帮助吗?

谢谢你们。

干杯

4

2 回答 2

10

WCF 在最好的情况下在高流量服务器上是一个臃肿的选项,在移动应用程序中使用 SOAP 是一种足够的资源浪费,应该被认为是不好的做法。

ServiceStack是一个更精简、更快的选项,它还允许您使用 ServiceStack 的强类型、无代码生成服务客户端使用.NET 最快的 JSONJSV文本序列化程序来访问相同的 Web 服务。

ServiceStack 服务客户端的 MonoTouch 版本可从以下网址单独获得: https ://github.com/ServiceStack/ServiceStack/tree/master/release/latest/MonoTouch

此处提供了一个演示如何使用的示例 MonoTouch 应用程序: https ://github.com/ServiceStack/ServiceStack.Examples/tree/master/src/MonoTouch/RestFilesClient

于 2011-07-25T06:56:19.627 回答
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.

于 2011-07-18T17:01:25.863 回答