我嘗試使用webservice發送數據到MsSql這個代碼。當我嘗試發送數據 Manuely其工作很好,但是當我嘗試通過此代碼發送不起作用。 返回值始終是正確的值,但不發送給MYDATABASEKsoap2發送數據不起作用「request.addProperty(」Lat「,」21233232「);」不工作
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());
}
感謝您的回答。我想發送字符串值。我需要Marshal界面嗎? – teknodram
編號只是'request.addProperty(「PROPERTY_NAME」,「PROPERTY_VALUE」);' – OguzOzkeroglu
request.addProperty(「PROPERTY_NAME」,「PROPERTY_VALUE」); doent工作webserver獲取參數,但web服務器功能doent工作,並沒有發送數據到sql – teknodram