1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
public class RetailerActivity extends Activity {
  
  private final String NAMESPACE = "http://xcart.com";
    private final String URL = "http://10.0.0.75:8080/XcartLogin/services/RetrieveData?wsdl";
    private final String SOAP_ACTION = "http://xcart.com/insertData";
    private final String METHOD_NAME = "insertData";
  
    Button btninsert;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       
        setContentView(R.layout.main);
        
        btninsert = (Button)findViewById(R.id.btn_insert1);
        btninsert.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
               Intent in = getIntent();
              // TextView tv = (TextView) findViewById(R.id.textView1);
               
                 //tv.setText("Welcome ,"+getIntent().getExtras().getString("login"));
                 String seq = in.getStringExtra("Username");
               EditText userPassword = (EditText) findViewById(R.id.edittext);
                 String user_Name = userPassword.getText().toString();
          SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
                PropertyInfo unameProp =new PropertyInfo();
                unameProp.setName("userPassword");//Define the variable name in the web service method
                unameProp.setValue(user_Name);//Define value for fname variable
                unameProp.setType(String.class);//Define the type of the variable
                request.addProperty(unameProp);
                PropertyInfo idProp =new PropertyInfo();
                idProp.setName("Username");//Define the variable name in the web service method
                idProp.setValue(seq);//Define value for fname variable
                idProp.setType(String.class);//Define the type of the variable
                request.addProperty(idProp);
                
                
               SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
                  envelope.setOutputSoapObject(request);
                  HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
               
                  try{
                   androidHttpTransport.call(SOAP_ACTION, envelope);
                      SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
                       
                     TextView result = (TextView) findViewById(R.id.textView2);
                      result.setText(response.toString());
                 }
               catch(Exception e){
                 
               }
                  }
        });
    
       
    }
 
  
    }