BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-10-2009, 02:03 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2009
Model: 7100t
PIN: N/A
Carrier: verizon
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Connection working on the simulator but not on the device

Please Login to Remove!

Hey,

I have been testing an application which calls a web-service on the 8703e simulator.
The application works and I see blue arrows in the top right corner of the screen when the request is sent.

When I transfer my application to the actual blackberry though, I don't see no arrows and the application just waits (no exceptions, nothing).
When I look at the server log I don't see any connection attempt.

I'm on a BES (I have a company blackberry) and set all authorization for the application in the blackberry.

Any idea?
Offline  
Old 04-10-2009, 02:13 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Duplicate the problem, then pull the system event log from the BlackBerry device.
Offline  
Old 04-10-2009, 03:28 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2009
Model: 7100t
PIN: N/A
Carrier: verizon
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

After further investigation (with you ), I realized that the call() times out.

Here is the code


Code:
 String result = "";
        SoapObject request = new SoapObject(NAMESPACE, "WS");
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

        request.addProperty("username", "x");
        envelope.bodyOut = request;
        //envelope.setOutputSoapObject(request);
        try {
            HttpTransport ht = new HttpTransport(SERVER);
            ht.call(null, envelope); // THIS IS GENERATING THE EXCEPTION
            result = (envelope. getResponse()).toString();
        } catch (IOException ex) {
            result = "<Exception>Could not connect to " + user.getUrl() + "</Exception>";

So my question remains, since this works on the simulator, why isn't ht.call() working on the device?
Offline  
Old 04-10-2009, 03:45 PM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

what is the exception?
Offline  
Old 04-13-2009, 08:41 AM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2009
Model: 7100t
PIN: N/A
Carrier: verizon
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

IOException, after a looooooong time out (while on the simulator it's pretty quick)
Offline  
Old 04-13-2009, 09:51 AM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2009
Model: 7100t
PIN: N/A
Carrier: verizon
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually I was wrong, it's a XmlPullParserException.
After the exception I looked with the debugged and the BodyIn of th enveloppe is Null
Offline  
Old 04-13-2009, 02:58 PM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2009
Model: 7100t
PIN: N/A
Carrier: verizon
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I looked at the message and here it is:
org.xmlpull.v1.XmlPullParserException: unexpected type (position:TEXT Connection refus...@1:36 in java.io.InputStreamReader@f0318cd6)

any idea anyone?
Offline  
Old 04-13-2009, 03:20 PM   #8 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2009
Model: 7100t
PIN: N/A
Carrier: verizon
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I managed to get the full msg after dumping the SOAP response:

Connection refused 1xx.xx.xx.xx:8080

how come it does not get refused with the simulator?
Offline  
Old 04-13-2009, 04:11 PM   #9 (permalink)
Knows Where the Search Button Is
 
Join Date: Apr 2009
Model: 7100t
PIN: N/A
Carrier: verizon
Posts: 21
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Since it's working on the simulator (with the simulated BES) I figure that is where the problemis coming from.

Do you have any idea which settings I can change to "allow" this connection? I've never used a BES configuration tool so I have no idea how to change any setting.

Any input is appreciated.
Offline  
Old 04-13-2009, 04:18 PM   #10 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Does your firewall allow port 8080?

Better check with your admin. Your dev machine is probably "inside" the firewall.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.