Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to save values in to webservice in android?
    text
    copied!<p>I am unable to save values into my webserver which is in .net. i have use the following code but i got the follow in error in emulator..i.e.., </p> <pre><code>Server was unable to process request---&gt; cannot insert the value null into column 'Name', table 'MyWorldApp.dbo.tbl_UserRegistration';column doesnot allow nulls.INSERT fails. The Statement has been terminated. </code></pre> <p>i have use the following link: <a href="http://113.193.181.53/MyWorldApp/Service1.asmx?op=InsertUsertRegistrationDetails" rel="nofollow">http://113.193.181.53/MyWorldApp/Service1.asmx?op=InsertUsertRegistrationDetails</a></p> <p>my code is:</p> <pre><code>import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; import android.app.*; import android.os.*; import android.util.Log; import android.widget.TextView; public class MyworldActivity extends Activity { /** Called when the activity is first created. */ private static final String SOAP_ACTION = "http://localhost/service1/InsertUsertRegistrationDetails"; private static final String METHOD_NAME = "POST"; private static final String NAMESPACE = "http://localhost/service1"; private static final String URL = "http://113.193.181.53/MyWorldApp/Service1.asmx"; TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv=(TextView)findViewById(R.id.text1); call(); } public void call() { try { SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); request.addProperty("Name", "'Rajapandian'"); request.addProperty("UserName", "Rajapandian"); request.addProperty("Password", "123"); request.addProperty("MobileNumber", "456"); request.addProperty("EmailID", "Rajapandian@gmail.com"); request.addProperty("image", "http://www.thehindu.com/multimedia/dynamic/00880/INDIA_CORRUPTION_PR_880168f.jpg"); Log.e("success","success"); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet=true; envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); androidHttpTransport.call(SOAP_ACTION, envelope); Object result = (Object)envelope.getResponse(); tv.setText(result.toString()); } catch (Exception e) { tv.setText(e.getMessage()); } } } </code></pre> <p>can anyone tell me where i have done wrong..</p> <p>thanks in advance..</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload