Blackberry app stuck trying to access a server.

Posted by Tejaswi Yerukalapudi on Stack Overflow See other posts from Stack Overflow or by Tejaswi Yerukalapudi
Published on 2010-05-11T18:21:01Z Indexed on 2010/05/11 18:24 UTC
Read the original article Hit count: 277

Hi,

I've built a ASP.NET webservice and I'm trying to access it from a Blackberry. I've been testing it out with multiple devices and the simulator and it works fine, but there's just the one Blackberry 9000 (It's not the model, I've tried it out with another Blackberry 9000), and it's stuck waiting for a response from the server. Relevant section of the code that accesses this -

        System.out.println("IN ntwk access thread, start point");
        HttpConnection connection = (HttpConnection)Connector.open(serviceURL + WSNAME);
        connection.setRequestMethod(HttpConnection.POST);
        connection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
        connection.setRequestProperty("Content-length", Integer.toString(postData1.length));
        OutputStream requestOutput = connection.openOutputStream();

        requestOutput.write(postData1);
        requestOutput.close();

        final int responseCode = connection.getResponseCode();
        if(responseCode!= HttpConnection.HTTP_OK) {
            //Process the error condition
        }
        // Request succeeded process the data.

It seems to be getting stuck after connection.getResponseCode(). Is there some way I can verify what's going wrong with this particular device?

Thanks,
Teja

© Stack Overflow or respective owner

Related posts about blackberry

Related posts about httpconnection