Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET J2ME
I have to access 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. I need your help guys. 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();
        }
 
    }
My web Service is as follows.
[WebMethod]
    public string mLogin(string userid, string password)
    {
        string message = string.Empty;
        CommonDataEntity cd = new CommonDataEntity();
         sqlfilter filter = new sqlfilter();
        int retVal=cd.Select_CustomerLogin(filter.SqFilter(userid), filter.SqFilter(password), out message);
 
        if (retVal > 0 && message == "User")
        {
 
            
            return "true#"+cd.mLogin(userid);
 
        }
        else
        {
            return "false#"+userid;
        }
    }
I'm using Ksoap2-j2me-core 2.12 jar to access the Asp services.
 
Please help me out from this.Smile | :)
Posted 31-Dec-12 18:58pm
Edited 2-Jan-13 18:40pm
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 265
1 CPallini 235
2 OriginalGriff 233
3 Maciej Los 195
4 George Jonsson 170
0 OriginalGriff 5,305
1 DamithSL 4,382
2 Maciej Los 3,760
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,901


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100