Re: [MonoTouch] Web-services vs other + BTFON

2011-11-08 Thread Nic Wise
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?

2011-11-07 Thread Brian Newton
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?

2011-11-07 Thread David Black
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?

2011-11-07 Thread simarx

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

2011-11-07 Thread David Black
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