任何人都可以帮助我使用 SOAP Web 服务编写注册页面的代码。我开发了一个患者检查应用程序,第一个用户必须在其中注册。请帮助我任何人对此有任何想法。在此先感谢。
问问题
2185 次
2 回答
0
您可以使用Ksoap2
将数据发送到您的网络服务并记录您的用户。这里是关于使用这个库从 web 服务获取数据的初学者教程(了解基础知识)在 asp net webservice 和使用 ksoap2 的 android 应用程序之间进行通信
于 2013-04-11T08:48:05.523 回答
0
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME1);
request.addProperty("userFirstname",sFirstName);
request.addProperty("userLastname",sLastName);
request.addProperty("dob",sBOD );
request.addProperty("gender",spinnersex.getSelectedItem().toString());
request.addProperty("address",sAddress);
request.addProperty("city",sCity);
request.addProperty("state", sState);
request.addProperty("pincode",sAreaCode);
request.addProperty("mobile",sPhoneNo );
request.addProperty("mailid",sEmailId );
request.addProperty("bg",spinnerBloodgroup.getSelectedItem().toString());
// request.addProperty("date",Date.getText().toString());
request.addProperty("weight",sweight);
//Declare the version of the SOAP request
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
try {
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
//this is the actual part that will call the webservice
androidHttpTransport.call(SOAP_ACTION1, envelope);
Log.e("ressult","data"+ re);
SoapObject result = (SoapObject)envelope.getResponse();
Log.e("value of result", " result"+result);
if(result!= null)
{
Toast.makeText(getApplicationContext(), "successfully register ", 2000).show() ;
}
else {
Toast.makeText(getApplicationContext(), "Try Again..", 2000).show() ;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
我认为您的问题将通过此代码解决,否则我将简要说明
于 2014-03-11T07:29:30.490 回答