Search code examples
blackberryjava-meblackberry-eclipse-pluginksoap2

Can't get kSOAP2 response for BlackBerry


I'm trying to do password validation for BlackBerry, I've written the code, ran "debug as blackberry emulator" so I can see the console. Currently I'm trying to print my result but nothing happens. I get no output. I will attach the code, is there something wrong with my code here? Or have I not applied a setting for blackberry? I am using ksoap2 and I have attached the jar to the library. I have created a Android app that connects to the same service using almost the same code. I get this error:

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

I've gone to the run configurations and activated the MDS and enabled registration, anything else that could be preventing the connection?

SoapObject rpc = new SoapObject(NAMESPACE, METHOD_NAME);
        rpc.addProperty("User", "raji");
        rpc.addProperty("Password", "PASSWORD");
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

        envelope.bodyOut = rpc;
        envelope.dotNet = true;
        envelope.encodingStyle = SoapSerializationEnvelope.XSD;

        HttpTransport ht = new HttpTransport(URL);
        ht.debug = true;

        try
        {
        ht.call(SOAP_ACTION, envelope);

        String result = (envelope.getResult()).toString();
        String result2 = (envelope.getResponse().toString());
        System.out.println(result + "HERE YA GO");
        System.out.println(result2 + "HERE YA GO");

        }
        catch(org.xmlpull.v1.XmlPullParserException ex2){

        }
        catch(Exception ex){
        String bah = ex.toString();
        System.out.println(bah + "HERE YA GO 2");
        }

Here is my variables to activate SOAP, I put the x's in as I can't show the exact IP.

public static final String NAMESPACE = "http://tempuri.org/";
    public static final String URL = "http://xxx.xxx.xx.x:xxxxx/XXXXXXX/IDLMobile.asmx?WSDL";
    public static final String SOAP_ACTION = "http://tempuri.org/ValidateUser";
    public static final String METHOD_NAME = "ValidateUser";

Solution

  • Solved. It was a MDS related problem, and also in the debug run settings, the box "disable registation" was selected, so deselect that and you're good to go.