HttpTransport on 4.6?

Hi all!

I made an application that connects to a Web service using ksoap2. The app works fine on 5.0; but now I want to install it on a BB with 4.6 and it seems that the connection can be done... I've seen on other items that people use HttpConnection rather than HttpTransport. Can I use the Ksoap2 HttTransport in 4.6?

http://en.Wikipedia.org/wiki/General_Packet_Radio_Service

http://en.Wikipedia.org/wiki/Wireless_Application_Protocol

and how they work together:

http://en.Wikipedia.org/wiki/OSI_model

Tags: BlackBerry Developers

Similar Questions

  • Timeout for the HTTPTransport KSoap2

    Hi all

    I have a project where I need to download a large amount of data from .NET web service to the device. I'm using KSoap2 and everything works fine until I actually start the download. I get an error "Connection Timeout".

    I tested the web service separately (from a site) and takes about 5 minutes to download. I also tested the BB project with a small amount of data to the web service itself and everything works fine. I am able to receive the returned data, but as soon as I try to download chuck raining data, the connection times out.  That said, I have 2 questions:

    1. how to specify the timeout for a connection HTTPTransport? I would like to be able to put 10 min for example to avoid time-out error.

    2. is there a limit to the amount of data the device can receive when using HTTPTransport?

    Thanks in advance,

    Daniel

    1 on timeout:

    -------------------------

    Take a look at this thread on the definition of timeout in httpConnection.

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=25155&query.ID=26...

    You can use the SocketConnectionEnhanced interface that allows you to set the timeout fom a direct TCP connection.

    How - to control the timeout for TCP connections via BlackBerry Mobile data system connection Service

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/How_To _...

    2. data about

    --------------------------------

    There are limits on the amount of data that can be downloaded by connection. See this article.

    What is - HTTP 413 request entity too large

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

    But you can download data piece by piece. See this article.

    How - to download large files using the BlackBerry Mobile data system

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800431/How_To _...

    Concerning

    Bika

  • Send or do sessions with the HttpTransport kSOAP, how?

    Hi all

    I connect to my web service with kSOAP2 and the web service method must return session or cookies in the response header.

    How can I get these values, and how I could spend them once again in the following query?

    Help, please

    also please answer with examples of code or links.

    I solved the problem

    the solution in the following link.

    http://sourceforge.NET/forum/forum.php?thread_id=1817911&forum_id=532039

    see you soon,

  • ksoap2 WebService connection has expired

    Hi all

    In my application, I use ksoap2.jar for webservice call.

    Suite code, I used:

    String soapAction = this.namespace + "GetRemesas";
    Remesas vector = new Vector();
    WebService Conection
    SoapObject CPP = new SoapObject (this.namespace, "GetRemesas");
    Envelope SoapSerializationEnvelope = new SoapSerializationEnvelope (SoapEnvelope.VER11);
    parameters
    rpc.addProperty ("imei", Constants.imei);
           
    envelope.bodyOut = rpc;
    envelope.dotNet = true;
    envelope.encodingStyle = SoapSerializationEnvelope.XSD;
    Ht HttpTransport = new HttpTransport (this.url);
    try {}
    HT. Call (soapAction, envelope);
    SoapObject soapObj = envelope.getResponse ((SoapObject));
    final String soapStr = soapObj.toString ();
    for (int i = 0; i)< soapobj.getpropertycount();="" i++)="">
    remesas.addElement (new Remesa ((SoapObject) soapObj.getProperty (i)));
    }
                
    } catch (Exception e) {}
    e.printStackTrace ();
    }

    The application works fine in the pc Simulator but when I install the app in the BlackBerry, it shows me out "Timed" exception

    I tried to access the web service in the BlackBerry browser and it works. I use a BlackBerry Curve 9300. I am of the Spain and my provider is Movistar. Any idea?

    The code fails to "ht.call (soapAction, envelope);"

    Thank you very much.

    I found the solution!

    The problem is, I did not send the name of the NPC and the BlackBerry only configured the username and password.

    I added this to the url of the Web service-> http://webserviceurl; deviceside = true; NPA = APN_Name

  • exception in ksoap please help

    String serviceURL = "http://www.deeptraining.com/webservices/weather.asmx";

    response = (envelope.getResponse ()) m:System.NET.SocketAddress.ToString ();

    String serviceNamespace =http://www.deeptraining.com';

    String serviceMethod = 'GetWeather ';

    String SoapAction = "http://litwinconsulting.com/webservices/GetWeather";

    SoapObject SoapObj =new SoapObject(serviceNamespace,serviceMethod);

    SoapObj.newInstance ();

    SoapObj.addProperty ("city", "delhi");

    Envelope SoapSerializationEnvelope =new SoapSerializationEnvelope (SoapEnvelope.VER11);

    envelope. bodyOut = SoapObj;

    envelope. dotNet = true;

    envelope. implicitTypes = true;

    envelope. encodingStyle = "utf-8";

    envelope. ENC = SoapSerializationEnvelope.ENC2001;

    envelope. xsd = SoapEnvelope.XSD;

    envelope. xsi = SoapEnvelope.XSI;//Build connection

    Ht HttpTransport =new HttpTransport (serviceURL);

    ht.setXmlVersionTag ("");

    Response of object = "nope."

    Try

    {

    HT. Debug = true;

    HT. Call (SoapAction, envelope);

    response = envelope.getResponse ();

    System.out.println (envelope.bodyIn);

    }

    I get exception after ht.debug = true;

    Here's the exception:

    SoapFault - faultcode: "SOAPServer" faultstring: ' System.Web.Services.Protocols.SoapException: server could not process the request. ---> System.NullReferenceException: object reference not set to an instance of an object. \n \n Weather.GetWeather (String City) - end of inner exception stack trace to-' faultactor: "null" detail: org.kxml2.kdom.Node@78aac9ec

    Help, please

    Thank you

    Please help.i really needed this.

  • KSOAP ANALYSIS

    Hey Hi all

    I'm trying my hands with KSOAP for the first time and after trying for a long time, I wrote here to help you.

    I need this post

    
    http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      
        http://mobile.expenseanywhere.com/">
          
            string        string        string            
    

    Here I've stuck with this Tag I do not know how to handle these requests with KSOAP
    Please help me in this.

    This is my Code

    CPP = new SoapObject SoapObject (space of names, MethodName);
    SoapObject CPP = new SoapObject ("", "AuthToken");
    rpc.addProperty ("CorporateId", "CID");
    rpc.addProperty ("Username", "one");
    rpc.addProperty ("Password", "PWD");
    RPC1. AddProperty ("", CPP);
    Envelope SoapSerializationEnvelope = new SoapSerializationEnvelope (SoapEnvelope.VER11);
    envelope.bodyOut = rpc;
    envelope.dotNet = true;
    envelope.encodingStyle = SoapSerializationEnvelope.ENC;

    Ht HttpTransport = new HttpTransport (URL);

    HT. Debug = false;
    ht.setXmlVersionTag(")");
    String result = null;
    Try
    {
    HT. Call (SOAPAction, envelope);
    String s = ht.requestDump;
    s = ht.responseDump;

    result = (envelope.getResponse ()) m:System.NET.SocketAddress.ToString ();
    Body of SoapObject = (SoapObject) envelope.bodyIn;
    result = (String) body.getProperty("verifyLoginResult").toString ();
    System.out.println ("result");
    }
    catch (org.xmlpull.v1.XmlPullParserException x 2)
    {
    Dialog.Inform (EX2.getMessage ());
    }
    catch (Exception ex)
    {
    Dialog.Inform (ex.getMessage ());
    }

    Problem solved

    Thanks for the Suggestions and help

    Concerning

    Deepak

  • IOException zero while making the SOAP request using ksoap2 library.

    Hi I am trying to implement the SOAP request using ksoap2 library, but I'm on it running on the Torch 9810, IOException zero

    httpTransport.call (SOAP_ACTION, soapEnvelope); exception.


    Code is:

    private String NAMESPACE="samplenamespace";
        private String url="webserviceurl";
        private String METHODNAME="getrecords";
        private String SOAP_ACTION=NAMESPACE+"/"+METHODNAME;
    
        private void sendSoapRequest(String email, String startDate, String enddDate) {
            SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(
                    SoapEnvelope.VER11);
            soapEnvelope.implicitTypes = true;
            soapEnvelope.dotNet = true;
            SoapObject soapReqObject = new SoapObject(
                    NAMESPACE, METHODNAME);
    
            soapEnvelope.headerOut = new Element[1];
            soapEnvelope.headerOut[0] = buildAuthHeader();
            soapReqObject.addProperty("email", email);
            soapReqObject.addProperty("startdate", startDate);
            soapReqObject.addProperty("enddate", endDate);
    
            soapEnvelope.setOutputSoapObject(soapReqObject);
            HttpTransport httpTransport = new HttpTransport(url
                    + ";deviceSide=true;interface=wifi");
            httpTransport.debug=true;
            try {
                httpTransport.call(SOAP_ACTION,
                        soapEnvelope);
            } catch (final IOException e) {
                e.printStackTrace();
                UiApplication.getUiApplication().invokeLater(new Runnable() {
    
                    public void run() {
                        Dialog.alert("IOException " + e.getMessage());
    
                    }
                });
    
            } catch (final XmlPullParserException e) {
                e.printStackTrace();
                UiApplication.getUiApplication().invokeLater(new Runnable() {
    
                    public void run() {
                        Dialog.alert("XmlPullParserException " + e.getMessage());
    
                    }
                });
            } catch (final Exception e) {
                e.printStackTrace();
                UiApplication.getUiApplication().invokeLater(new Runnable() {
    
                    public void run() {
                        Dialog.alert("Exception " + e.getMessage());
    
                    }
                });
            }
        }
    
        private Element buildAuthHeader() {
            Element h = new Element().createElement(NAMESPACE, "headername");
            Element username = new Element()
                    .createElement(NAMESPACE, "username");
            username.addChild(Node.TEXT, "usernametext");
            h.addChild(Node.ELEMENT, username);
            Element pass = new Element().createElement(NAMESPACE, "password");
            pass.addChild(Node.TEXT, "passwordtext");
            h.addChild(Node.ELEMENT, pass);
            return h;
        }
    

    I did tried to check a large number of post on KSOAP2 supportforum. Also made changes, but none of them succeeded.

    Any help?

    Solved

    problem was passing parameters (incorrect parameters format)

  • Exception during consumption of huge data from a web service.

    Hello

    I m developing an application to receive data from a Web Service and retain the data received on the device.

    App is developed for OS 4.3.0

    The Web Service call is made using Ksoap. The Code receives the data from the web service, analyzes the data and stores it in an object. This object is then persisted on the device. The data are essentially the coordinates. It takes the number of contacts required as input and passes it to the Web Service. The Web Service then returns the requested number of records

    The code works if I ask data of up to ~ 600 cases. If I specify more than 600 cases, it throws the following exception

    Chain rg.xmlpull.v1.XmlPullParserException:unexpected type (position: TEXT entity request in T...@1:24 in java.io.InputStreamReader@1f87d1b4)

    When I debugged using Eclipse, this exception is thrown on this statement ht.call (soapAction, envelope);

    Would it be because of a time-out? OT is because the Analyzer is not able to analyze huge data?

    Given that this exception occurs on the declaration of ht.call, I guess the problem is with the web service call and not with the code for persistent storage.

    I have included the code here... Is could someone please show me what the problem is?

    C ode to call Web Services

    public Vector getWebData(String count)
        {
    
       Vector personsVectorto = new Vector();
        try
        {
        StringBuffer receivedContent = new StringBuffer();
        String serviceUrl = "........";
        String serviceNamespace = ".....";
        String soapAction = ".........";
    
       SoapObject rpc = new SoapObject(serviceNamespace, "GetContactsList");
            //rpc.addProperty("listSize", "5");
            rpc.addProperty("listSize", count);
         SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    
            envelope.bodyOut = rpc;
    
            envelope.dotNet = true;
            envelope.encodingStyle = SoapSerializationEnvelope.XSD;
            HttpTransport ht = new HttpTransport(serviceUrl);
            ht.debug = true;
    
            ht.call(soapAction, envelope); // This is where thexmlpullparser exception occurs
    
     Object obj = envelope.getResponse();
            SoapObject soapResult = (SoapObject)obj;
    
                for(int i=0; i < soapResult.getPropertyCount(); i++)
    
                {
                  PersonDTO personto = new PersonDTO();
               SoapObject choice = (SoapObject)soapResult.getProperty(i);
                if( choice!=null)
                {
                    for(int j = 0; j < choice.getPropertyCount(); j++)
                    {
                      receivedContent.append(" Reading Property Number" + String.valueOf(j) + " Value = " + choice.getProperty(j).toString());
    
         if (j==0) personto.setElement(1,choice.getProperty(j).toString());
        if (j==1) personto.setElement(2,choice.getProperty(j).toString());
        if (j==2) personto.setElement(3,choice.getProperty(j).toString());
        if (j==3) personto.setElement(4,choice.getProperty(j).toString());
        if (j==4) personto.setElement(5,choice.getProperty(j).toString());
         if (j==5) personto.setElement(6,choice.getProperty(j).toString());
         if (j==6) personto.setElement(7,choice.getProperty(j).toString());
          if (j==7) personto.setElement(8,choice.getProperty(j).toString());
         if (j==8) personto.setElement(9,choice.getProperty(j).toString());
       if (j==9) personto.setElement(10,choice.getProperty(j).toString());
                    }
                }                 
    
                personsVectorto.addElement(personto);
                //storepersistentobject(personsVectorto);
            }
    
            }catch(org.xmlpull.v1.XmlPullParserException ex2)
            {
                String bah1 = ex2.toString();
                Dialog.alert("String: " + bah1);
                String bah2 = ex2.getMessage();
                Dialog.alert("Message: " + bah2); 
    
            }       
    
            catch(Exception ex){
                String bah = ex.toString();
                Dialog.alert("Response: " + bah);
    
                }
    
                return personsVectorto;
        }
    

    Thank you

    Hi Philippe,.

    First Question: Print server response

    Yes - I think for you too in fact just print the answer you'll have to do a regular HTTP call to the server and print it like this:

    StringBuffer sb = new StringBuffer();

    int thumb;

    HttpConnection httpConn = (HttpConnection) Connector.open (url);

    httpConn.setRequestMethod (HttpConnection.GET); or by POST depending on your needs

    in = httpConn.openInputStream ();

    While ((thumb = in.read ())! = - 1).

    {

    SB. Append ((Char) inCh);

    }

    System.out.println ("server response:" + sb.toString ());

    Try and see if you get a request too large entity. Note: you should probably put your SOAP request in GET or POST http request.

    Second Question: Is zipping required?

    This is how I chose to do for my particular needs that transfer me a large amount of data and the compression algorithm seems to keep all my data well below 40 k. However, it is not the only way, you could actually make several requests and get data piece by piece, but I don't know if it works well with SOAP responses. Depending on the type of Network Setup Blackberry you have, you can also set this limit to be higher (I think a maximum of 1 024 Ko for BES).

    Third Question: Timeout Logging

    For wait times, usually the exception you get should indicate that there was a timeout, but if you are suspicious that it's a timeout check your web service and see.

    Hope that helps!

    R

  • What is the method of setxmlversiontag()

    can any body please indicate the purpose of the setxmlversiontag method in the httptransport class

    I think she defines that

    the sent message is in the form of an XML (tag - XML declaration).
    And the tag also provide information on the specification followed when creating XML document.

    To learn more, you can also follow

    http://ksoap2.sourceforge.NET/doc/API/org/ksoap2/transport/transport.html#setXmlVersionTag%28Java.La...

    http://XmlWriter.NET/xml_guide/XML_DECLARATION.shtml

  • ksoap2 return not of xml file

    I use ksoap2 to call webservice.when I pass a string parameter to my webmethod using "addproperty" I assume to get back an xml file but I get o/p like that.

    any type {pattern = any type {element = any type {complex type = any type () ;} ;};] ;}}}} ; DiffGram = any type () ;}

    What should I do to get the actual xml file output?

    Try HttpTransport.requestDump () to get the exact data sent to the Service...

    HTH!

    Saket

  • Sample Web service

    Hi all

    I have searched many sites to something simple to access the webservice in blackberry but couldn't find a solution. Almost all examples follow JDE environment that is not so in my case.

    some sites that I searched recently are:

    ( http://www.blackberryforums.com/developer-forum/155972-blackberry-ksoap2-tutorial-4.html#post1747966 1).

    ( http://craigagreen.com/index.php?/Blog/blackberry-and-net-webservice-tutorial-part-1.html 2).

    I use following:

    1 eclipse IDE

    2-ksoap2-j2me-core-prev - 2.1.2.jar

    Here is my code

    HOME


    public class Home extends UiApplication {
    
        public Home() {
    
                HomeScreen home= new HomeScreen();
                pushScreen(home);
        }
    
        public static void main(String args[])
        {
    
            Home home= new Home();
            home.enterEventDispatcher();
        }
    
    }
    

    MY WebserviceHelper CLASS:

    public class WebServiceHelper {
    
        public String Helper() {
    
            String serviceUrl = "http://172.16.5.132:8080/CalculatorApp/CalculatorWSService";
            String serviceNamespace = "http://calculator.me.org/";
            String soapAction = "";
            String methodName = "add";
    
            SoapObject rpc = new SoapObject(serviceNamespace, methodName);
            rpc.addProperty("i", "1");
            rpc.addProperty("j", "1");
    
            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    
            envelope.bodyOut = rpc;
            envelope.dotNet = false;
            envelope.encodingStyle = SoapSerializationEnvelope.ENC;
    
            HttpTransport ht = new HttpTransport(serviceUrl);
            ht.debug = true;
    //      ht.setXmlVersionTag("");
    
            String result = null;
    
            try
            {
            ht.call(soapAction, envelope);
            result = envelope.getResponse().toString();
            return result;
            }
            catch(org.xmlpull.v1.XmlPullParserException ex2){
                return "ex 1";
            }
            catch(Exception ex){
                return ex.getMessage();
            }
        }
    }
    

    SCREEN:

    public class HomeScreen extends MainScreen {
    
        public HomeScreen()
        {
            add(new RichTextField("Welcome"));
            WebServiceHelper obj= new WebServiceHelper();
            add(new RichTextField(obj.Helper()));
        }
    }
    

    OUTPUT:

    Welcome

    Local connection timed out after ~ 12000

    Please help me...

    Thanks in advance.


    Hi all

    I would like to offer my apologies to all for my ignorance. The code above worked well and did not previously, we had a few problems with the server...

  • net.rim.device.cldc.io.ippp.SocketBaseIOException in the ksoap plug-in

    Hello

    I use ksoap for post user and password to the server for connection module,

    Here is the code for the same,

    SoapObject request =new SoapObject (methodname in the namespace,);

    request.addProperty ("username", "hello");

    request.addProperty ('password', 'Hi');

    Envelope of SoapSerializationEnvelope = SoapSerializationEnvelope (SoapEnvelope.VER11) new;

    envelope. bodyOut = request;

    envelope. dotNet = true;

    HttpTransport ht = HttpTransport (webserviceurl) new;

    HT. debug = true ;

    HT. Call (soapaction, envelope);

    result = envelope.getResponse ((SoapObject));

    I use mds and 4.5 os, however after ht.call (envelope soapaction), ;  I'm special suite

     

    net.rim.device.cldc.io.ippp.SocketBaseIOException: Connection timed out: connect

    Help, please

    Thanks in advance

    You can do this mark as resolved then?  If necessary, especially if it might help someone else, can tell us how you solved the problem?

  • KSOAP2 working on the Simulator, but failed on the device. Help, please!

    Hi all. Please, I need support on this issue.

    I have a request of KSOAP2 running which:

    1) Œuvres ALLWAYS on the Simulator (9700 Simulator)

    2) FAILS on the device when you use 3 G Internet Link

    3) work on the device when hard reseting it and directly using Wi - Fi link (if you switch to 3 G, it starts failing).

    When it do I get the following error:

    type of org.xmlpull.v1.XmlPullParserException:Unexpected (position: TEXT SocketException:...@1:33 in java.io.InputStreamReader@hexhere)

    Some other times I get an IO error faced:

    net.rim.device.cldc.io.ippp.SocketBaseIOException: Connection timed Out

    The funny thing is that it works through 3 G as 1 in 40 times... it seems that 3 G connection is too slow to KSOAP2 to work properly, or something like that. The complex type is small (8 strings).

    My webservice is a webservice VB.NET located on the production IIS server. It works well because it responds to any request of Simulator.

    Additional data:

    -Other Internet applications of device (such as the Internet browser) works well through 3G even when my application does not always succeed. Coverage of 3G service is excellent.

    -J' use JRE 5.0.0.

    -Device is a BlackBerry Bold 9700

    -Webservice is written in VB.NET in the production on the Internet Server, and it works perfectly because it responds to each request of Simulator.

    -J' use javaloader.exe to deploy the cod to the device files (both, ksoap library cod and cod of my project)

    -L'application is not signed.

    -Once the application starts breaks down (when you switch to 3G) it maintains in default if you return to the WiFi again.

    Here is my code:

    String res="";
    boolean error=false;
    Vector seguimientos = null;
    
    SoapObject m_Soapobject=new SoapObject("urn:tempuri", "GetSeguimientos");
    SoapSerializationEnvelope m_Envelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
    m_Envelope.encodingStyle = SoapSerializationEnvelope.ENC;
    
    m_Soapobject.addProperty("strInstance", "r2sistemas");
    m_Soapobject.addProperty("user", "myuser");
    m_Soapobject.addProperty("password", "mypassword");
    m_Soapobject.addProperty("comercialId", "3");
    
    m_Envelope.addMapping("urn:tempuri/encodedTypes", "Seguimiento", new Seguimiento().getClass());
    m_Envelope.bodyOut = m_Soapobject;
    m_Envelope.setOutputSoapObject(m_Soapobject);
    
    HttpTransport ht = new httpTransport("http://www.productionserver.com/service1.asmx");
    ht.setXmlVersionTag("");
    
    try {
        ht.call("urn:tempuri/GetSeguimientos", m_Envelope);
        SoapObject respuesta=(SoapObject)m_Envelope.bodyIn;
        seguimientos=(Vector)respuesta.getProperty(0);
        } catch (IOException e) {
        error=true; res="IO Problem: " + e.toString();
        } catch (XmlPullParserException e) {
        error=true; res="XMLParser problem: " + e.toString();
        }
    
    if(error!=true) {
        Seguimiento seg=(Seguimiento)seguimientos.elementAt(1);
        res=seg.Comentario;
        }
    
    this.add(new LabelField("aa"+ res));
    

    I read on this forum that ksoap2 cannot treat the http error messages. You must download the KSOAP source and change it to do this. Something like ServiceConnectionMidp. The message is this: link

    I use a port KSOAP2 library: ksoap2-j2me-core-prev - 2.1.2.jar, like I said it works fine on the Simulator. I tried to download the source code of KSOAP to debug in the failing methods, but was unnable to do compile ok on Eclipse.

    I really am stuck at this point. Please, any help would be great.

    Thank you in advance.

    Ok. Further reading took me to the problem.

    AFAIK, there are 5 ways to connect to web addresses from a BlackBerry device.

    Of course, the BB Simulator uses one that works with my WS. When my BB is connected via wifi it works as well. However, when I use the 3g from my device connection, I should mention the destinies of correct connection on the connection URL parameters.

    That's what I did:

    I read this: 1 Source

    And this (Spanish): Source 2

    Of course, I noticed that my BB is connected to a BES company, I must indicate the correct ConnectionUID to my address book of device on the connection string. So now the line in my code is:

    HttpTransport ht = new HttpTransport("http://www.address.com/service1.asmx;deviceside=false;ConnectionUID=YOURCONNECTIONUID");
    

    To find your UID connection, take your device, go to Options - Advanced Options - service book. Choose a book of service applications that connects successfully on your device (in my case Blackberry Internet Browser service), open it and copy the ConnectionUID. Then, paste it in the connection string.

    Now, it works great!

    My next challenge is to find connection string parameters correctly so that the application works on any device, not only on my ones company BES.

    Someone knows what should be the standard setting?

    I hope that my help of inquiry.

    P.S. still cannot complete successfully ServiceConnectionMidp...

  • ksoap2 timeout exception

    Hi all

    In my application, I use ksoap2.jar for webservice call.

    WebService with a method called "HelloWorld".

    After the code that I used: -.

    String serviceUrl = "http://192.168.5.38/BlackBerryTime/Service1.asmx";
    String serviceNamespace = "http://tempuri.org/";
    String SoapAction = "http://tempuri.org/HelloWorld";
           
    SoapObject CPP = new SoapObject (serviceNamespace, "HelloWorld");
           
    Envelope SoapSerializationEnvelope = new SoapSerializationEnvelope (SoapEnvelope.VER11);
           
    envelope.bodyOut = rpc;
    envelope.dotNet = true;
    envelope.encodingStyle = SoapSerializationEnvelope.XSD;
           
    Ht HttpTransport = new HttpTransport (serviceUrl);
    HT. Debug = true;
                   
    Try
    {
    HT. Call (soapAction, envelope);
    String result = (envelope.getResult ()) m:System.NET.SocketAddress.ToString ();
           
           
    }
          
    catch (Exception ex)
    {
    String bah = ex.toString ();
    System.out.println ("wrestling..." + ex);
    }

    Copy the following code returns "java.io.InterruptedIOException: Local connection has expired after ~ 120000" exception.

    My call webservice as below: -.

    POST /BlackBerryTime/Service1.asmx HTTP/1.1
    Host: 192.168.5.38
    Content-Type: text/xml; charset = utf-8
    Content-Length: length
    SOAPAction: "http://tempuri.org/HelloWorld".


    container http://www.w3.org/2001/XMLSchema-instance"="http://www.w3.org/2001/XMLSchema"xmlns:soap ="http://schemas.xmlsoap.org/soap/envelope/">" "
     
        http://tempuri.org/"/ >
     

    1. How can I solve this problem...

    2. What are the ways that I set up in my code.

    Thank you Inadvance.

    put the creation of transport in a class outside.
    You can now test the webservice call using JUnitTest (by the importation of HttpTransportSE).

    What about your error: try to reach the address of the Web service in your browser.
    did you start the MDS Simulator or add deviceside = true?
    read the sticky connection thread.

  • Problem TestLogon Ksoap.

    Hello everyone. I'm newbie e.

    I installed Ksoap library correctly and a simple helloworld work very well, but my task is to the identification of Pentecost username and password. My source code is as follows:

    package KsoapTestLogin;
    
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.container.*;
    
    import org.ksoap2.SoapEnvelope;
    import org.ksoap2.SoapFault;
    import org.ksoap2.serialization.SoapObject;
    import org.ksoap2.serialization.SoapSerializationEnvelope;
    import org.ksoap2.transport.HttpTransport;
    
    public class TestLogon extends UiApplication
    {
    
        public static void main(String args[])
        {
            TestLogon kst = new TestLogon();
            kst.enterEventDispatcher();
        }
    
        public TestLogon()
        {
            pushScreen(new kScreen());
        }
    } 
    
    class kScreen extends MainScreen
    {
        public LabelField lf_title;
        public RichTextField rf_results;
        public String results;
    
        public String Username = "Larry.Enderson";
        public String Password = "Password123";
    
        public MenuItem mi_runtest = new MenuItem("Hello World!",4390,10)
            {
                public void run()
                {
                    RunTest();
                }
            };
           public MenuItem testlogon = new MenuItem("Logon",4390,10)
               {
                public void run()
                {
                    TestLogon();
    
                }
            };
    
        protected void makeMenu(Menu menu,int instance)
            {
                menu.add(mi_runtest);
                super.makeMenu(menu,0);
    
                menu.add(testlogon);
                super.makeMenu(menu,0);
            }
    
        public kScreen()
        {
            super();
            LabelField title = new LabelField ("McKinneyRogers", LabelField.HCENTER| LabelField.USE_ALL_WIDTH);
            setTitle(title);
            lf_title = new LabelField("ACME");
            add(lf_title);
    
            rf_results = new RichTextField("Welcome");
            add(rf_results);
    
            results = "";        
    
        }        
    
        public void RunTest() {
    
            String serviceURL = "https://www2.missionleadership.com/mlv4developmentmastek/WS/Blackberry.asmx;deviceside=true";
            String serviceNamespace = "http://www2.missionleadership.com/";
            String serviceMethod = "HelloWorld";
            String SoapAction = "http://www.missionleadership.com/HelloWorld";
            SoapObject SoapObj = new SoapObject(serviceNamespace,serviceMethod);
              SoapObj.newInstance ();
              SoapObj.addProperty ("a", "5");
              SoapObj.addProperty ("b", "6");
    
              SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
              envelope.bodyOut = SoapObj;
              envelope.dotNet = true;
              envelope.implicitTypes = true;
              envelope.encodingStyle = "utf-8";
              envelope.enc = SoapSerializationEnvelope.ENC2001;
              envelope.xsd = SoapEnvelope.XSD;
              envelope.xsi = SoapEnvelope.XSI;
    
              //Build connection
              HttpTransport ht = new HttpTransport(serviceURL);
    
              //Initiate Connection
              Object response = null;
    
              try
              {
                ht.debug = true;
                ht.call (SoapAction, envelope);
                //response = envelope.getResponse().toString();
                response = envelope.getResponse();
                //response =(envelope.getResponse()).toString();
    
                System.out.println (envelope.bodyIn);
              }
              catch(SoapFault sfe)
              {
                  sfe.printStackTrace();
              }
              catch (Exception e)
              {
                System.out.println (e);
                response = e.toString();
              }
    
              rf_results.setText(response.toString());
        }
    
        public void TestLogon()
        {
            String serviceURL = "https://www2.missionleadership.com/mlv4developmentmastek/WS/Blackberry.asmx;deviceside=true";
            String serviceNamespace = "http://www2.missionleadership.com/";
            String serviceMethod = "TestLogon";
            String SoapAction = "http://www.missionleadership.com/TestLogon";
            SoapObject SoapObj = new SoapObject(serviceNamespace,serviceMethod);
            //SoapObject SoapObj = new SoapObject ("urn:iControl:LocalLB/VirtualServer", "get_list");
            SoapObj.newInstance ();
            SoapObj.addProperty("Username", Username);
            SoapObj.addProperty("Password", Password); 
    
            SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
            envelope.bodyOut = SoapObj;
            envelope.dotNet = true;
            envelope.implicitTypes = true;
            envelope.encodingStyle = "utf-8";
            envelope.enc = SoapSerializationEnvelope.ENC2001;
            envelope.xsd = SoapEnvelope.XSD;
            envelope.xsi = SoapEnvelope.XSI;
    
            //Build connection
            HttpTransport ht = new HttpTransport(serviceURL);
    
            ht.setXmlVersionTag("");
            //Initiate Connection
            Object response = "nope";
    
            try
                {
                    ht.debug = true;
                    ht.call (SoapAction, envelope);
                    //response = envelope.getResponse().toString();
                    response = envelope.getResponse();
                    //response =(envelope.getResponse()).toString();
                    System.out.println (envelope.bodyIn);
                }
            catch(SoapFault sfe)
                {
                    sfe.printStackTrace();
                }
            catch (NullPointerException e)
                {
                    System.out.println (e);
                    response = e.toString();
                }
            catch (Exception e)
                {
                    System.out.println (e);
                    response = e.toString();
                }
    
        rf_results.setText(response.toString());
    
        }
    
    }
    

    This correctly program to connect to the server, but the site response cannot be the answer.

    Sorry pals. I fix my problem. The problem coming up with space names wrong... I have wrong address on namespace and the PPA exploded...

Maybe you are looking for