gpt4 book ai didi

安卓 :Problem with parameter passing(webservices)

转载 作者:行者123 更新时间:2023-11-29 02:12:31 25 4
gpt4 key购买 nike

我是网络服务新手,logcat 中的响应有问题。我正在将我所有的参数传递给服务器,但响应有些不可靠,我仔细观察以找出解决方案,但我做不到。我在我的网络服务中使用 Ksoap、WSDL

logcat 消息是这样的

 06-17 14:20:31.168: VERBOSE/TAG(302): `RegisterUserResponse{RegisterUserResult=-1; }`

有人请帮我解决这个问题

private static final String SOAP_ACTION = "http://tempuri.org/RegisterUser";
private static final String METHOD_NAME = "RegisterUser";
private static final String NAMESPACE = "http://tempuri.org";
private static final String URL = "http://........";
private static final String TAG = "HELLO";

Thread t;
ProgressDialog dialog;


@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button signin = (Button) findViewById(R.id.regsubmitbtn);

signin.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
showDialog(0);
t = new Thread() {
public void run() {
register();
}
};
t.start();
}
});
}

@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case 0: {
dialog = new ProgressDialog(this);
dialog.setMessage("Please wait while connecting...");
dialog.setIndeterminate(true);
dialog.setCancelable(true);
return dialog;
}
Button regmalebtn;

public void register() {
Log.v(TAG, "Trying to Login");

SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
soapEnvelope.dotNet = true;

soapEnvelope.setOutputSoapObject(request);

// String response1 = request.getProperty(0).toString() ;
request.addProperty("fname", "raghav");
request.addProperty("lname", "raju");
request.addProperty("dateofbirth", "18-01-1985");
request.addProperty("email", "raghuraju90@yahoo.com");
request.addProperty("password", "1234");
//request.addProperty("password", repassword);
request.addProperty("mobno", "8553456260");
request.addProperty("latitude", "76");
request.addProperty("longitude", "82");
request.addProperty("device_id", "123456");
request.addProperty("gender", "male");
// request.addProperty("latitude',latitude);

HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug = true;
try {
androidHttpTransport.call(SOAP_ACTION, soapEnvelope);
androidHttpTransport
.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");

SoapObject resultsRequestSOAP = (SoapObject) soapEnvelope.bodyIn;
// SoapObject result = (SoapObject) soapEnvelope.getResponse();

Log.v("TAG", String.valueOf(resultsRequestSOAP));
String resultData;
resultData = request.getProperty(0).toString();
}
return null;
}
} catch (Exception e) {

e.printStackTrace();
}

}
}

最佳答案

服务器正在生成该错误。您需要与服务器的开发人员/所有者交谈,让他们检查他们的日志以确定您的交易失败的原因。

关于安卓 :Problem with parameter passing(webservices),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6383634/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com