【问题标题】:java.lang.IllegalArgumentException: invalid IPv4 format J2me Midp 2.0 and Asp.net version 4.0java.lang.IllegalArgumentException:无效的 IPv4 格式 J2me Midp 2.0 和 Asp.net 4.0 版
【发布时间】:2012-12-31 06:19:48
【问题描述】:

我必须通过 j2me 应用程序 MIDP-2.0 访问 IIS Asp.net 4.0 版服务。相同的 J2me 代码可以访问 Asp.net 2.0 版本的服务。

我无法弄清楚我必须在我的 J2me 代码中进行哪些更改以及在何处进行更改?为此谷歌了很多,但没有得到任何解决方案。我的代码如下:

    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();
        }

    }

我正在使用 Ksoap2-j2me-core 2.12 jar 来访问 Asp 服务。

【问题讨论】:

  • 我非常需要你们的帮助。只给我一些线索,我会处理剩下的部分。
  • [WebMethod] public string mLogin(string userid, string password) { string message = string.Empty; CommonDataEntity cd = new CommonDataEntity(); sqlfilter 过滤器 = 新的 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; } }
  • 以上是我的网络方法...
  • gnat 先生,你能告诉我上面代码中的问题是什么吗?

标签: asp.net java-me ksoap2 midp


【解决方案1】:

对 URL 进行了更改,我的问题得到了解决。 网址就像“http://anup.abc.com/mService/someService.asmx”

将相同替换为“http://121.211.23.123/mService/someService.asmx”并得到输出。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    • 1970-01-01
    • 2011-04-07
    • 2011-12-20
    相关资源
    最近更新 更多