Question

I have to access IIS Asp.net version 4.0 services through j2me Application, MIDP-2.0. Same J2me code can able to access Asp.net version 2.0 services.

I am not able to figure out what and where I have to make changes in my J2me code? Googled a lot for this but didn't get any solution. My code is as follow:

    public String loginVerification(String userId, String pwd){
        String Method_Name = "mLogin";
        //String Method_Name = "LoginCheck";
        try{
        SoapObject request = new SoapObject(Constants.NAMESPACE_URL, Method_Name);
        request.addProperty("userid", userId);
        request.addProperty("password", pwd);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet = true;
        envelope.setOutputSoapObject(request);
        HttpTransport ht = new HttpTransport(Constants.LOGIN_URL);
        ht.debug = true;
        ht.call(Constants.NAMESPACE_URL+Method_Name, envelope); // getting error here
        SoapPrimitive result = (SoapPrimitive) envelope.getResponse();
        return result.toString();
        }catch(IOException e){
            return e.getMessage().toString();
        }catch(XmlPullParserException e){
            return e.getMessage().toString();
        }

    }

I'm using Ksoap2-j2me-core 2.12 jar to access the Asp services.

Was it helpful?

Solution

Made changes in URL and I got my issue solved. Url was like "http://anup.abc.com/mService/someService.asmx"

replaced the same with "http://121.211.23.123/mService/someService.asmx" and got the output.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top