Re: [MonoTouch] Web Services Performance for Point of Sales application.
The overhead of using Json over HTTP vrs pretty much anything else (binary over sockets etc) is going to be negated by the speed of the internet - or lack of it. The round trip from your POS to the server is going to be 1ms on a local network, and possibly 10-100ms (or more if it's 3G/4G - 2-5s sometimes) for an internet call. What kind of data are you moving over this connection? How many requests per person buying something? Why does it have to be realtime/near realtime? what happens if the network connection goes away? Personally, I'd explore json over HTTPS ('cos you need it to be secure, right?), with gzip compression on the server end (which is common now anyway) but avoid WCF like the plague. Look at using ServiceStack or something similar. SignalR might also be an option if you need to do bidirectional comms. Sending 1k as json (which might end up as 1.5k) or binary (which might be 1.01k) is nothing compared to creating a connection to the server in the first place. On 27 August 2013 09:30, hocp...@yahoo.com hocp...@yahoo.com wrote: Hello, I've developed the Point of Sales (POS) application in Windows and iPad (iOS devices) app using local database such as MSSQL Server Express and Sqlite3. These applications work great and FAST in local network environment. For multi stations I used MSSSQL network server (TCP open port 1433). For SQLite system, I've wrote a complete WCF server/client then hosted on local network. Again, the systems work great and FAST. Now I want explore Web base application which mean that I must hosting web services on the WWW or Cloud services. So, my question is what web service protocol should I use to maintaining the satisfactory POS performance (the applications still have run locally as native app). I have looks in to JSON, REST protocol but not sure will give the performance that I need because in POS world which requires that fast database access to SELECT(GET), UPDATE(POST) and INSERT(PUT) in real-time or close to real-time. I know that I can't get a real-time performance on web services but if I can get 80% plus performance that worth shooting for. Thanks... Visit our website: http://www.yesmua.com -- View this message in context: http://monotouch.2284126.n4.nabble.com/Web-Services-Performance-for-Point-of-Sales-application-tp4658441.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch -- Nic Wise t. +44 7788 592 806 | @fastchicken b. http://www.fastchicken.co.nz/ ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
Re: [MonoTouch] Web-services vs other + BTFON
In London Bike App (source: https://github.com/nicwise/londonbikeapp ) I check reachability to see if the network is up, and then check a site to see if I can connect. eg: if (Util.IsReachable(www.fastchicken.co.nz)) { var wc = new WebClient(); string s = wc.DownloadString(string.Format(http://www.fastchicken.co.nz?distance={0}time={1};, distance, time)); Util.Log(trip: + s); } public static bool IsReachable (string host) { return Reachability.InternetConnectionStatus () != NetworkStatus.NotReachable Reachability.IsHostReachable (host); } appears to work. However, I'd suggest you also forget the BTFON network, so it doesn't auto-connect. It's an open wifi, so things like FireSheep can pull your traffic easily. On Mon, Nov 7, 2011 at 13:40, David Black david.bl...@casewise.com wrote: Hi there If you are trying to attach to a web service and you own that service why not add a ping method to the service? That way you test reachability, if that succeeds call your ping method and verify the successful call. You should keep in mind that users pay for data and only handshake a small amount of data and do it infrequently. D -Original Message- From: monotouch-boun...@lists.ximian.com [mailto:monotouch-boun...@lists.ximian.com] On Behalf Of simarx Sent: 07 November 2011 13:11 To: monotouch@lists.ximian.com Subject: Re: [MonoTouch] Web-services vs other + BTFON Another Question ... When using the Reachability classes to determine an internet connection, the phone sometimes connects to the BTFON Wifi connection and therefore claims that a valid connection exists. BTFON is the open-wifi thing that you have to sign up to use so it allows a connection but not to your destination unless you've signed up to their service. Is there any way to determine what the NetworkReachability classes have connected to verify it's responded to by the real destination? -- View this message in context: http://monotouch.2284126.n4.nabble.com/Web-services-vs-other-tp3997150p3998564.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch -- Nic Wise t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise b. http://www.fastchicken.co.nz/ Nearest Bus: find when the next bus is coming to your stop. http://goo.gl/Vcz1p mobileAgent (for FreeAgent): get your accounts in your pocket. http://goo.gl/IuBU Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2 ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
Re: [MonoTouch] Web-services vs other?
I can say that I've been using a web service backend for most of the processing in my app, have made probably close to 100-200 calls while developing it and I've never had it timeout. Are you thinking the unreliability is innate to web services or just the way Monotouch handles them? On Thu, Oct 27, 2011 at 7:23 PM, simarx kul...@simarx.com wrote: Hi - I am developing an iPhone application where I am consuming Soap web-services using the standard mechanism provided by MonoDevelop whereby I am adding a web-reference to the web-service and then calling it's methods. On occasion, I do find calls to methods timeout in an inconsistent manner when I know it's not down to a poor net connection. Is there any advice as to whether I should consider using alternative code to consuming web-services? I've read elsewhere that it may be more reliable to Post data directly and process the results myself - using NSMutableUrlRequest for example. I don't really want to put this effort in unless it's going to make a difference. Any advice? -- View this message in context: http://monotouch.2284126.n4.nabble.com/Web-services-vs-other-tp3946648p3946648.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
Re: [MonoTouch] Web-services vs other?
I can confirm Brian's comments. I have 4 web services and about say 50 method in them and my app uses an online / offline model using them. I have had no timeout issues at all. Are you calling then synchronously or async? I only use asynchronous calls so I don't block the UI. Do you have access to your Web Service source code or are they third party? If they are yours I would suggest putting some logging in to see if the problem is server side or client side. I think the default timeouts are ~60 second in asmx web services which should be enough time for most actions. David Black From: monotouch-boun...@lists.ximian.com [mailto:monotouch-boun...@lists.ximian.com] On Behalf Of Brian Newton Sent: 07 November 2011 08:28 To: simarx Cc: monotouch@lists.ximian.com Subject: Re: [MonoTouch] Web-services vs other? I can say that I've been using a web service backend for most of the processing in my app, have made probably close to 100-200 calls while developing it and I've never had it timeout. Are you thinking the unreliability is innate to web services or just the way Monotouch handles them? On Thu, Oct 27, 2011 at 7:23 PM, simarx kul...@simarx.commailto:kul...@simarx.com wrote: Hi - I am developing an iPhone application where I am consuming Soap web-services using the standard mechanism provided by MonoDevelop whereby I am adding a web-reference to the web-service and then calling it's methods. On occasion, I do find calls to methods timeout in an inconsistent manner when I know it's not down to a poor net connection. Is there any advice as to whether I should consider using alternative code to consuming web-services? I've read elsewhere that it may be more reliable to Post data directly and process the results myself - using NSMutableUrlRequest for example. I don't really want to put this effort in unless it's going to make a difference. Any advice? -- View this message in context: http://monotouch.2284126.n4.nabble.com/Web-services-vs-other-tp3946648p3946648.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.commailto:MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
Re: [MonoTouch] Web-services vs other?
We have our own web-services on our own servers and use them all the time for all sorts of purposes and don't experience problems in using them so I know they're running fine. From the iPhone I was regularly getting timeouts getting a connection. So steps I took to progress... 1. Using the Reachability classes - before every attempt to use my web-service, I created an instance of the Reachability class and did a IsHostReachable() check before calling my own methods. My application generally requires most flows to be done in a linear manner. 2. I was doing the IsHostReachable() check synchronously which meant that if the host was unreachable, ie. no internet connection, that check itself was taking a long time to return. 3. Next, I put the IsHostReachable() into it's own thread, but since I was still creating a new call to IsHostReachable() in the thread, the call was still potentially taking a long time to return. 4. Where I'm at now and hopefully the Reachability classes are doing the right thing, is creating a new Thread that exists throughout the application session, and use call-back type mechanism that maintains the status of the reachability. Then before I use any of my web-services, I will just check the reachability status to determine if a net-connection exists rather than call IsHostReachable(). Does this sound like a sensible approach? My current code was using the Reachability classes to determine if an internet connection existed before making -- View this message in context: http://monotouch.2284126.n4.nabble.com/Web-services-vs-other-tp3997150p3998074.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
Re: [MonoTouch] Web-services vs other + BTFON
Hi there If you are trying to attach to a web service and you own that service why not add a ping method to the service? That way you test reachability, if that succeeds call your ping method and verify the successful call. You should keep in mind that users pay for data and only handshake a small amount of data and do it infrequently. D -Original Message- From: monotouch-boun...@lists.ximian.com [mailto:monotouch-boun...@lists.ximian.com] On Behalf Of simarx Sent: 07 November 2011 13:11 To: monotouch@lists.ximian.com Subject: Re: [MonoTouch] Web-services vs other + BTFON Another Question ... When using the Reachability classes to determine an internet connection, the phone sometimes connects to the BTFON Wifi connection and therefore claims that a valid connection exists. BTFON is the open-wifi thing that you have to sign up to use so it allows a connection but not to your destination unless you've signed up to their service. Is there any way to determine what the NetworkReachability classes have connected to verify it's responded to by the real destination? -- View this message in context: http://monotouch.2284126.n4.nabble.com/Web-services-vs-other-tp3997150p3998564.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
Re: [MonoTouch] web-services vs alternative
I personally like ProtocolBuffers see : http://code.google.com/p/protobuf-net/ http://code.google.com/p/protobuf-net/ From their website: /protocol buffers is the name of the binary serialization format used by Google for much of their data communications. It is designed to be: small in size - efficient data storage (far smaller than xml) cheap to process - both at the client and server platform independent - portable between different programming architectures extensible - to add new data to old messages protobuf-net is a .NET implementation of this, allowing you to serialize your .NET objects efficiently and easily. It is compatible with most of the .NET family, including .NET 2.0/3.0/3.5, .NET CF 2.0/3.5, Mono 2.x, Silverlight 2, etc. / This runs about 30-50 times as quick as Soap! You would need to write code to send over TCP/IP using sockets, a REST service or some such depending on what your exact requirements were. If is also cross platform so the code on either end can be any of the supported languages. -- View this message in context: http://monotouch.2284126.n4.nabble.com/web-services-vs-alternative-tp3947477p3948203.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
Re: [MonoTouch] web-services vs alternative
Actually there are two mature implementations for c#. This is the one I personally prefer as its a little more light weight http://code.google.com/p/protobuf-csharp-port/ http://code.google.com/p/protobuf-csharp-port/ Have fun! Tony -- View this message in context: http://monotouch.2284126.n4.nabble.com/web-services-vs-alternative-tp3947477p3948214.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
Re: [MonoTouch] Web Services
Hey Demis, I took your advice and went the WCF path… seems a much better way to do things. I still have a problem though… I created a VERY simple service at http://hotdogs.infocore.com.au/hotdogs/Service1.svc, it works fine in VS 2010 but doesn’t work in MT, I have just exhausted my limited knowledge on trying to figure it out, with no success… I added it as a WCF web reference called hdService and then have the following: hdService.ServiceClient client = new hdService.ServiceClient(); Console.Writeline(client.Greeting”Dean”)); But it doesn’t run, keeps stopping with “Object reference not set to an instance of an object” also referencing the System.ServiceModel.ChannelFactory, whatever that is ☺ I don’t know if it me, MT, the service or what… I’ll leave the service running, can someone try and consume it and tell me if it works? Or tell me what I am missing / doing wrong? Thanks! Dean From: Demis Bellot [mailto:demis.bel...@gmail.com] Sent: Tuesday, 23 August 2011 12:03 AM To: Dean Harry Cc: monotouch@lists.ximian.com Subject: Re: [MonoTouch] Web Services Hey Dean, Apart from the technical limitations, coupling your web services with your RDBMS is generally considered bad practice. (Although I'd also argue that due to its inefficiency, using SOAP in your resource constrained MonoTouch app should also be avoided). Why don't you just go the normal route and wrap your DB logic inside a standard .asmx web service? though my preference would be to avoid SOAP entirely and just use one of the many REST service frameworks available in .NET. If performance ever becomes a problem you can also try using my http://servicestack.net web service framework, where the JSON and JSV endpoints are multiple times more efficient than SOAP web services. D.B Sent from my iPad On 22 Aug 2011, at 03:32, Dean Harry d...@callit.com.aumailto:d...@callit.com.au wrote: Ok so I found my problem is a bug (https://bugzilla.novell.com/show_bug.cgi?id=670956) So I changed the SqlXml class of the Reference.cs file to read, as the poster mentioned at the bottom of the bug report: public partial class SqlXml { [System.Xml.Serialization.XmlAnyElement(Namespace=Any)] [System.Xml.Serialization.XmlAnyElement(Name=Any)] [System.Xml.Serialization.XmlTextAttribute()] public System.Xml.XmlNode Any; } But that still doesn’t work… has anyone been able to get this to work? I’m getting desperate… Cheers, Dean From: monotouch-boun...@lists.ximian.commailto:monotouch-boun...@lists.ximian.com [mailto:monotouch-boun...@lists.ximian.com] On Behalf Of Dean Harry Sent: Sunday, 21 August 2011 1:13 PM To: monotouch@lists.ximian.commailto:monotouch@lists.ximian.com Subject: [MonoTouch] Web Services Hi All, I am having a web service problem I can’t figure out… I have a web service on my MSSQL server with a web method on it… The following works fine in VS.NEThttp://VS.NET but doesn’t work in Mono, now I am using 2.8a but I wouldn’t have thought that anything would have changed in the web services side… The code is: GetMeets service = new GetMeets(); Service.Credentials = new NetworkCredentials(“username”,”password”); It fails on the first line with: “There was an error reflecting type ‘…..SqlXml’. Looking at the InnerException is shows “There was an error reflecting field ‘Any’…. The elemeny Any has been attributed with an XmlAnyElementAttribute and a namespace, but no name. Has anyone come across this before? Cheers, Dean ___ MonoTouch mailing list MonoTouch@lists.ximian.commailto:MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch ___ MonoTouch mailing list MonoTouch@lists.ximian.com http://lists.ximian.com/mailman/listinfo/monotouch
Re: [MonoTouch] Web Services
Hi Dean, From last report it looks like Mono team will only be supporting and implementing the Silverlight Subset of WCF so you'll have to wait till you hear back from them to figure out if what you're trying to do falls within that subset. Although I'm the maintainer of WCF replacement web services stack called http://www.servicestack.net which I currently support on Mono and now recently on MonoTouch. Since it's open source and I'm able to control the entire source code, it's much easier for me to support and add functionality. It's both an RPC/SOAP and REST convention-based web services framework that is configuration-free so is easy to setup. If you're interested I have a preconfigured MonoTouch client application that uses it available here: https://github.com/ServiceStack/ServiceStack.Examples/tree/master/src/MonoTouch/RestFilesClient The project includes all the dependencies you need and has examples of both sync and async clients (both with 1 LOC): //calling sync web service var response = gateway.GetFilesResponse(txtPath.Text); //calling async web service gateway.GetAsyncFilesResponse(txtPath.Text, r = InvokeOnMainThread(() = txtResults.Text = r.Dump()), null); There's no code-gen as the same DTO classes you use to define your web services on the server can be used as-is in your client application to provide a strongly-typed client with an easy and friction-free development workflow. As a bonus it uses my fast Json Serializer which the latest benchmarks places it a multitude of times faster than any serializer shipping with .NET. If you don't mind binary protocols, protobuf-net remains the fastest serializer for .NET and also includes an RPC-based framework. Having spoken with the author, one of his goals was to support MonoTouch although I'm not sure what the current status on MonoTouch is at the moment. Anyway if you decide to try servicetack.net feel free to post any questions/issues you have to the group: https://groups.google.com/forum/#!forum/servicestack Cheers, Demis On 24 Aug 2011, at 08:10, Dean Harry wrote: Hey Demis, I took your advice and went the WCF path… seems a much better way to do things. I still have a problem though… I created a VERY simple service at http://hotdogs.infocore.com.au/hotdogs/Service1.svc, it works fine in VS 2010 but doesn’t work in MT, I have just exhausted my limited knowledge on trying to figure it out, with no success… I added it as a WCF web reference called hdService and then have the following: hdService.ServiceClient client = new hdService.ServiceClient(); Console.Writeline(client.Greeting”Dean”)); But it doesn’t run, keeps stopping with “Object reference not set to an instance of an object” also referencing the System.ServiceModel.ChannelFactory, whatever that is J I don’t know if it me, MT, the service or what… I’ll leave the service running, can someone try and consume it and tell me if it works? Or tell me what I am missing / doing wrong? Thanks! Dean From: Demis Bellot [mailto:demis.bel...@gmail.com] Sent: Tuesday, 23 August 2011 12:03 AM To: Dean Harry Cc: monotouch@lists.ximian.com Subject: Re: [MonoTouch] Web Services Hey Dean, Apart from the technical limitations, coupling your web services with your RDBMS is generally considered bad practice. (Although I'd also argue that due to its inefficiency, using SOAP in your resource constrained MonoTouch app should also be avoided). Why don't you just go the normal route and wrap your DB logic inside a standard .asmx web service? though my preference would be to avoid SOAP entirely and just use one of the many REST service frameworks available in .NET. If performance ever becomes a problem you can also try using my http://servicestack.net web service framework, where the JSON and JSV endpoints are multiple times more efficient than SOAP web services. D.B Sent from my iPad On 22 Aug 2011, at 03:32, Dean Harry d...@callit.com.au wrote: Ok so I found my problem is a bug (https://bugzilla.novell.com/show_bug.cgi?id=670956) So I changed the SqlXml class of the Reference.cs file to read, as the poster mentioned at the bottom of the bug report: public partial class SqlXml { [System.Xml.Serialization.XmlAnyElement(Namespace=Any)] [System.Xml.Serialization.XmlAnyElement(Name=Any)] [System.Xml.Serialization.XmlTextAttribute()] public System.Xml.XmlNode Any; } But that still doesn’t work… has anyone been able to get this to work? I’m getting desperate… Cheers, Dean From: monotouch-boun...@lists.ximian.com [mailto:monotouch-boun...@lists.ximian.com] On Behalf Of Dean Harry Sent: Sunday, 21 August 2011 1:13 PM To: monotouch@lists.ximian.com Subject: [MonoTouch] Web Services Hi All, I am having a web service problem I can’t figure out… I have a web service on my MSSQL