【发布时间】:2011-09-14 10:25:48
【问题描述】:
我正在尝试为 BlackBerry 进行密码验证,我已经编写了代码,运行“调试为黑莓模拟器”,因此我可以看到控制台。目前我正在尝试打印我的结果,但没有任何反应。我没有输出。我将附上代码,我的代码有问题吗?还是我没有为黑莓应用设置?我正在使用 ksoap2,并且已将 jar 附加到库中。我创建了一个 Android 应用程序,它使用几乎相同的代码连接到相同的服务。我收到此错误:
java.io.InterruptedIOException: 本地连接在 ~ 120000 后超时
我已经进入运行配置并激活了 MDS 并启用了注册,还有什么可能阻止连接的吗?
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");
}
这是我激活 SOAP 的变量,我把 x 放进去,因为我无法显示确切的 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";
【问题讨论】:
标签: blackberry java-me blackberry-eclipse-plugin ksoap2