Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 13
Registered: ‎12-12-2011
My Device: Blackberyy Bold 9780
My Carrier: T-Mobile
Accepted Solution

Http.call Error!!

[ Edited ]

Hi,

 

I am trying to call a webservice, what it does is just authenticate the username and password and return a string either 1 or -1. While debugging it gets stuck at httpTransport.call() for like a minute or so then skip to exception giving the error "java.io.InterruptedIOException: Local connection timed out after ~ 120000".

 

 

String ret=null;
 String error=null;
 String SOAPLOGINACTION = "http://nettechltd.net/wwwroot/ttweb/Service1.asmx/Authenticatee"; 
 String SOAPLOGINMETHOD = "Authenticate";
 String WSDL_TARGET_NAMESPACE = "http://nettechltd.net/wwwroot/ttweb/Service1.asmx";
 String SOAP_ADDRESS = "http://nettechltd.net/wwwroot/ttweb/Service1.asmx?WSDL";
        
 SoapObject rpc = new SoapObject(WSDL_TARGET_NAMESPACE,SOAPLOGINMETHOD);
         rpc.addProperty("username","test123");
         rpc.addProperty("password","test123");
                                
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.encodingStyle = SoapSerializationEnvelope.XSD;
    envelope.setOutputSoapObject(rpc); 
HttpTransport httpTransport = new HttpTransport(SOAP_ADDRESS); httpTransport.debug = true; httpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); try { httpTransport.call(SOAPLOGINACTION, envelope); ret = (envelope.getResult()).toString(); Dialog.alert(ret); } catch(Exception ex) {
  error = ex.toString(); }

 

Any suggestions are welcome. 

 

Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: Http.call Error!!

Hi jahan,
On which you are debugging simulator or device, if it is simulator check the MDS connection is checked or not,
If it is device check the ServiceConnectionMidp class to ensure the connection suffix is correct or not.

Thanks.
New Developer
Posts: 13
Registered: ‎12-12-2011
My Device: Blackberyy Bold 9780
My Carrier: T-Mobile

Re: Http.call Error!!

I am debugging simulator and yep MDS connection is checked.

Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: Http.call Error!!

Just now i try this code, and the problem is

String SOAPLOGINACTION = "http://nettechltd.net/wwwroot/ttweb/Service1.asmx/Authenticatee";

Replace with
String SOAPLOGINACTION = "http://nettechltd.net/wwwroot/ttweb/Service1.asmx/Authenticate";

Thanks.
New Developer
Posts: 13
Registered: ‎12-12-2011
My Device: Blackberyy Bold 9780
My Carrier: T-Mobile

Re: Http.call Error!!

Clocked on...tried that also but i just can't figure out what's going wrong here. I am totally Confused.com
Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: Http.call Error!!

What is there to confuse??
New Developer
Posts: 13
Registered: ‎12-12-2011
My Device: Blackberyy Bold 9780
My Carrier: T-Mobile

Re: Http.call Error!!

The confusion is that i can't figure out whats going wrong.......is there any other way i can try to call the web service?

Don't understand why can't it connect and times out.

Highlighted
Developer
Posts: 543
Registered: ‎12-23-2010
My Device: Z10
My Carrier: Airtel

Re: Http.call Error!!

There may be problem in your net connections, I tried that code and i got -1 as response.
New Developer
Posts: 13
Registered: ‎12-12-2011
My Device: Blackberyy Bold 9780
My Carrier: T-Mobile

Re: Http.call Error!!

Tried a different connection but still getting the same exception. How did you manage to get response? I rum the simulator with MDS enabled. I can make connection to ftp but in this case its doesn't work. Is there any other way i could call the web service?