如何在android中将参数值传递给webservice
嗨,朋友们 我在android中使用ksoap2,有人能告诉我如何在android中将参数值传递给webservice吗 谢谢 } 参考:如何在android中将参数值传递给webservice,android,Android,嗨,朋友们 我在android中使用ksoap2,有人能告诉我如何在android中将参数值传递给webservice吗 谢谢 } 参考: public class AndroidClientService extends Activity { private static final String SOAP_ACTION = "http://10.120.10.87:8080/TestService/services/TestService/saveServices"; private s
public class AndroidClientService extends Activity {
private static final String SOAP_ACTION = "http://10.120.10.87:8080/TestService/services/TestService/saveServices";
private static final String OPERATION_NAME = "saveServices";
private static final String WSDL_TARGET_NAMESPACE = "http://10.120.10.87:8080/TestService/services/TestService?WSDL";
private static final String SOAP_ADDRESS = "http://10.120.10.87:8080/TestService/services/TestService";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView textView = new TextView(this);
setContentView(textView);
SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,
OPERATION_NAME);
/*
* PropertyInfo pi = new PropertyInfo(); pi.setName("celcius"); pi.type
* = PropertyInfo.OBJECT_CLASS; pi.setValue(100);
* request.addProperty(pi);
*/
request.addProperty("number", "8806007");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS);
try
{
httpTransport.call(SOAP_ACTION, envelope);
Object response = envelope.getResponse();
textView.setText(response.toString());
}
catch (Exception exception)
{
textView.setText(exception.toString());
}
}