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: 5
Registered: ‎11-24-2008
My Device: Not Specified
Accepted Solution

Error Connecting To Webservice (KSOAP2)

[ Edited ]

Hello All,

 

I developed a BB application that connects to a webservice at our company. I am using ksoap2 to communicate with the service. Here is my problem: The app works fine on an AT&T Bold, but when one of my customers in the UK tries to run the same app on his Vodafone Bold, he gets the following error:

Error verifying the account!  Details:

Expected: START_TAG {http://

Schemas.xmlsoap.org/soap/

envelope/} Envelope

{position:smileyfrustrated:TART_TAG <html>@2:44 in

java.io.InputStreamReader@d9ad3d7c)

Here is the info on both phones:

Vodafone Bold - O/S v4.6.0.162(Platform 4.0.0.155) - Branding Version 1.0.102.63

AT & T Bold - O/S v4.6.0.167(Platform 4.0.0.157) - Branding Version 1.0.102.142

 

Any help will be greatly appreciated.

 

Thanks,

Lu Pazmino

Message Edited by jdmjza80 on 06-12-2009 06:06 PM
Developer
Posts: 173
Registered: ‎06-11-2009
My Device: Not Specified

Re: Error Connecting To Webservice (KSOAP2)

Try to use soapAction in the HttpTransport object call:


httpt.call(soapAction,envelop);
Developer
Posts: 34
Registered: ‎11-20-2009
My Device: Not Specified

Re: Error Connecting To Webservice (KSOAP2)

I have similar problem .. i have a simple .net webservice .. and similar case ... and i have used ksoap2 and JDE 5.0 ...

 

and using    ht.call(soapAction, envelope);

 

web service is up and running ... but it times out and i get

 

@15271400 "java.io.InterruptedIOException: Local connection timed out after ~ 120000"

 

please help me resolve this issue ..

 

thanks

Developer
Posts: 207
Registered: ‎07-31-2009
My Device: Not Specified

Re: Error Connecting To Webservice (KSOAP2)

@kedarkarthik  - Did u check if you are able to access any web url ?? check this in the browser, I am guessing you probably cannot and this could be cos u did not start the mds simulator . U can do this by running the .bat file in the MDS folder

------------------------------------------------------------------------------------------------------------------------
Click the Kudos! badge on left side of the message , if you are happy with a solution given by a user. When you do so, you are saying thanks to its author.
Mark a reply as a solution , if you think your question has been answered.
To mark a message as a solution: Click "Accept as solution" icon on the reply.
Developer
Posts: 16,637
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Error Connecting To Webservice (KSOAP2)

in reply to the OP:

START_TAG <html> means your ksoap2 parser receives a html message, most likely an error from the webserver. most common would be a 401, authorization required, but others are also possible.

ksoap2 cannot handle http errors, you have to extend its functionality (or live with it). to enhance it download the ServiceConnectionMidp class from ksoap2 and extend it.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 34
Registered: ‎11-20-2009
My Device: Not Specified

Re: Error Connecting To Webservice (KSOAP2)

@ was righht .... my MDS had some issues starting ... I reinstalled and restarted and now i can connect ...

 

 

thank you all...

 

 

New Developer
Posts: 4
Registered: ‎01-06-2010
My Device: Not Specified

Re: Error Connecting To Webservice (KSOAP2)

[ Edited ]

I even tried reinstalling the MDS simulator but iam getting the same error

 

expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:smileyfrustrated:TART_TAG <ResultSet {http://www.w3.org/2001/XMLSchema-instance}xsi:schemaLocation='urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd'>@2:187 in java.io.InputStreamReader@a8ea09ed)

 

can you help me or send me the sample code that worked for you,thanks in advance.

 

my code is

 

 

public void obtenerArticuloSOAP(String id) {
   
   HttpTransport ht = null;
   try {
        
    
    //SoapObject request = new SoapObject("http://local.yahooapis.com/MapsService/V1/geocode", "");   
    SoapObject request = new SoapObject("urn:yahoo", "maps");
    
    request.addProperty("appid", "YD-9G7bey8_JXxQP6rxl.fBFGgCdNjoDMACQA--");
    request.addProperty("street", "701 First Ave");
    request.addProperty("city", "Sunnyvale");
    request.addProperty("state", "CA");
    this.xmlResponse.setText("hi11");
    
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.bodyOut = request;   
     ht =
     new HttpTransport("http://local.yahooapis.com/MapsService/V1/geocode?appid=YD-9G7bey8_JXxQP6rxl.fBFGgCdNjoDMACQA--&stre...");   
   
    //envelope.encodingStyle = SoapSerializationEnvelope.ENC;  
    
    //ht.call("http://local.yahooapis.com/MapsService/V1/geocode", envelope); 
    ht.call("", envelope);
    
    //this.xmlResponse.setText("hi");
    //SoapObject result = (SoapObject)envelope.getResponse();

    System.err.println( ht.requestDump );
    System.err.println( ht.responseDump );

    
//    this.id.setText(result.toString());
//    this.ref.setText(result.toString());
//    this.nombre.setText(result.toString());

    //this.xmlResponse.setText(result.toString());
    //this.id.setText(result.getProperty("Latitude").toString());
    //this.ref.setText(result.getProperty("Longitude").toString());
    //this.nombre.setText(result.getProperty("Zip").toString());   

   }

   catch (Exception e) {
    System.err.println( ht.requestDump );
    System.err.println( ht.responseDump );

    System.err.println("i am here in catch");
    System.err.println("e.getMessage() ::::" + e.getMessage() );
    
    e.printStackTrace();

   }
  }

New Developer
Posts: 5
Registered: ‎11-24-2008
My Device: Not Specified

Re: Error Connecting To Webservice (KSOAP2)

@rajagovi - Here is what worked for me. For the most part it looks similar to your code. The only differences are where I set the encoding style and the dotNet properties.

 

 

            rpc.addProperty("iAccountID", AccountID);
            rpc.addProperty("iUserID", UserID);               
            rpc.addProperty("CallData1", vData1);

            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
            envelope.bodyOut = rpc;
            envelope.dotNet = false;
            envelope.encodingStyle = SoapSerializationEnvelope.XSD;

            HttpTransport ht = new HttpTransport("http://stage.flashforce.com/Tracker/ACTrack.asmx");
            ht.debug = true;

            ht.call("http://stage.flashforce.com/insertCallData", envelope);

 

 

Let me know if this helps.

 

New Developer
Posts: 4
Registered: ‎01-06-2010
My Device: Not Specified

Re: Error Connecting To Webservice (KSOAP2)

hi jdmjza80 , Thanks for the response. I tried setting the encoding style and the dotNet properties but still iam getting the same error, is there something iam missing :-(