我尝试使用此代码将数据发送到 MsSql 使用 web 服务。当我尝试手动发送数据时,它工作得很好,但是当我尝试通过此代码发送时,它不起作用。返回值始终是正确的值,但不发送到 mydatabase
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
PropertyInfo pi = new PropertyInfo();
pi.setName("DeviceId");
pi.setValue("mumin burak");
pi.setType(String.class);
pi.setNamespace(NAMESPACE);
request.addProperty(pi);
request.addProperty("Lat", "21233232");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
AndroidHttpTransport httpTransport = new AndroidHttpTransport(URL);
SoapPrimitive result = null;
try {
httpTransport.call(SOAP_ACTION, envelope);
result = (SoapPrimitive) envelope.getResponse();
twMsg.setText(result.toString());
} catch (IOException e) {
// TODO Auto-generated catch block
twMsg.setText(e.getMessage());
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
twMsg.setText(e.getMessage());
}