PaulG
PaulG

Reputation: 7142

CriticalIOException when trying to call web service

I'm having a little trouble trying to make an HTTP connection on my Blackberry Torch 9800. Here is the line where the problem occurs:

HttpConnection connection = (HttpConnection)Connector.open(URL);

My phone has no data plan and I was trying to do this through wifi. I've been doing it fine this way for a few months now. But suddenly it's giving me a CriticalIOException.

Here is my connection string:

http://mysite.mycompany.com/mws/MyWebService/MyWebService.asmx;interface=wifi

I don't know why this is happening and I don't know what to do about it. Any help would be greatly appreciated.

Thanks!

Upvotes: 1

Views: 77

Answers (2)

Mister Smith
Mister Smith

Reputation: 28189

Please, please don't keep using that legacy Connector.open() approach. This was the way connections were opened in JavaME, and since RIM built its libraries on top of them, they came up with a suffix-based hack to select the transport type. this caused dirty code prone to break, and caused so much pain to new developers (and also senior ones).

RIM introduced ConnectionFactory in OS 5.0 specifically to solve this kind of problems. This was back in 2008, guys we're in 2012!

Have a look at it.

Upvotes: 1

Michael Donohue
Michael Donohue

Reputation: 11876

Typically when using the wifi appender, the deviceside appender is used as well. I'm not sure if this is related to your problem, though.

 ;deviceside=true;interface=wifi

Upvotes: 0

Related Questions