I have enclosed http://imagebin.ca/view/Kus5VJ.html of response with this message.This is my kvm serializable java class
Using java Syntax Highlighting
- package com.example.android.apis;
- import java.util.Hashtable;
- import org.ksoap2.serialization.PropertyInfo;
- import org.ksoap2.serialization.SoapSerializationEnvelope;
- public class getSearchAndResponse implements org.ksoap2.serialization.KvmSerializable {
- private String login;
- private String email;
- private String UserID;
- private String Forename;
- private String Name;
- private String company;
- private String Password;
- private String Designation;
- private String phone;
- private String report_to;
- public getSearchAndResponse(String login,String email,String UserID,String Forename,String Name,String company,String Password ,String Designation,String phone,String report_to){
- this.login = login;
- this.email = email;
- this.UserID = UserID;
- this.Forename = Forename;
- this.Name = Name;
- this.Password = Password;
- this.company= company;
- this.phone=phone;
- this.Designation=Designation;
- this.report_to=report_to;
- }
- public getSearchAndResponse(){
- super();
- }
- public void setPhone(String phone) {
- this.phone = phone;
- }
- public String getPhone() {
- return phone;
- }
- public void setDesignation(String Designation){
- this.Designation=Designation;
- }
- public String getDesignation(){
- return Designation;
- }
- public void setCompname(String company) {
- this.company = company;
- }
- public String getCompname() {
- return company;
- }
- public void setPassword(String Password) {
- this.company = Password;
- }
- public String getPassword() {
- return Password;
- }public void setName(String Name) {
- this.Name = Name;
- }
- public String getName() {
- return Name;
- }public void setForename(String Forename) {
- this.Forename = Forename;
- }
- public String getForename() {
- return Forename;
- }
- public void setUserID(String UserID) {
- this.UserID = UserID;
- }
- public String getUserID() {
- return UserID;
- }
- public void setLogin(String login) {
- this.login = login;
- }
- public String getLogin() {
- return login;
- }public void setEmail(String email) {
- this.email = email;
- }
- public String getEmail() {
- return email;
- }
- public void setReport_to(String report_to) {
- this.report_to = report_to;
- }
- public String getReport_to() {
- return report_to;
- }
- @Override
- public Object getProperty(int i) {
- switch (i)
- {
- case 0:
- return getCompname();
- case 1:
- return getPhone();
- case 2:
- return getLogin();
- case 3:
- return getReport_to();
- case 4:
- return getEmail();
- case 5:
- return getUserID();
- case 6:
- return getForename();
- case 7:
- return getName();
- case 8:
- return getDesignation();
- case 9:
- return getPassword();
- default:
- return null;
- }
- }
- @Override
- public int getPropertyCount() {
- return 10;
- }
- @Override
- public void setProperty(int i, Object o) {
- switch (i)
- {
- case 0:
- this.company = (java.lang.String)o;
- break;
- case 1:
- this.Designation=(java.lang.String)o;
- break;
- case 2:
- this.Forename=(java.lang.String)o;
- break;
- case 3:
- this.Name=(java.lang.String)o;
- break;
- case 4:
- this.Password=(java.lang.String)o;
- break;
- case 5:
- this.UserID=(java.lang.String)o;
- break;
- case 6:
- this.email=(java.lang.String)o;
- break;
- case 7:
- this.login=(java.lang.String)o;
- break;
- case 8:
- this.phone=(java.lang.String)o;
- break;
- case 9:
- this.report_to=(java.lang.String)o;
- break;
- }
- }
- @Override
- public void getPropertyInfo(int index, Hashtable hshtbl, PropertyInfo info) {
- switch (index)
- {
- case 0:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "compname";
- break;
- case 1:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "designation";
- break;
- case 2:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "email";
- break;
- case 3:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "forename";
- break;
- case 4:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "login";
- break;
- case 5:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "name";
- break;
- case 6:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "password";
- break;
- case 7:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "phone";
- break;
- case 8:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "report_to";
- break;
- case 9:
- info.type = PropertyInfo.STRING_CLASS;
- info.name = "userID";
- break;
- default:
- break;
- }
- }
- public void register(SoapSerializationEnvelope classMap)
- {
- classMap.addMapping("http://WS/getSearchAnd", "getSearchAndResponse",this.getClass());
- }
- }
Parsed in 0.056 seconds, using GeSHi 1.0.8.4
This is my main classs were i call the ksoap2 webservice.
Using java Syntax Highlighting
- package com.example.android.apis;
- import java.io.IOException;
- import org.ksoap2.SoapEnvelope;
- import org.ksoap2.serialization.SoapObject;
- import org.ksoap2.serialization.SoapSerializationEnvelope;
- import org.xmlpull.v1.XmlPullParserException;
- import org.ksoap2.transport.AndroidHttpTransport;
- import java.util.Vector;
- import android.app.Activity;
- import android.content.Intent;
- import android.os.Bundle;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.widget.Button;
- import android.widget.EditText;
- import android.widget.TextView;
- import android.widget.Toast;
- public class Activity2 extends Activity{
- /** Called when the activity is first created. */
- private static final String SOAP_ACTION = "http://WS/getSearchAndResponse";
- private static final String METHOD_NAME = "getSearchAndResponse";
- private static final String NAMESPACE = "http://WS";
- private static final String URL = "http://192.168.1.2:8085/axis2/services/LocalDiscoverdb?wsdl";
- @Override
- public void onCreate(Bundle State) {
- super.onCreate(State);
- setContentView(R.layout.main2);
- Button launch = (Button)findViewById(R.id.Button01);
- launch.setOnClickListener( new OnClickListener()
- {
- @Override
- public void onClick(View viewParam)
- { // TODO Auto-generated method stub
- EditText compnameEditText = (EditText) findViewById(R.id.EditText01);
- EditText connameEditText = (EditText) findViewById(R.id.EditText02);
- String sCompName = compnameEditText.getText().toString();
- String sConName = connameEditText.getText().toString();
- TextView ResultText = (TextView) findViewById(R.id.TextView03);
- if(sCompName.equals("") && sConName.equals("")){
- Toast.makeText(Activity2.this, "Please enter Company Name and Contact Name",
- Toast.LENGTH_SHORT).show();
- }
- else{
- Object response = null,obj;
- AndroidHttpTransport transport = new AndroidHttpTransport (URL);
- SoapObject myObject = new SoapObject(NAMESPACE, METHOD_NAME);
- myObject.addProperty("compname", sCompName);
- myObject.addProperty("conname", sConName);
- SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
- envelope.bodyOut = myObject;
- envelope.setOutputSoapObject(myObject);
- transport.debug = true;
- try {
- transport.call(SOAP_ACTION, envelope);
- response = envelope.getResponse();
- //Vector<getSearchAndResponse> re= (Vector<getSearchAndResponse>) envelope.getResponse();
- SoapObject body = (SoapObject) envelope.bodyIn;
- System.out.println(body.getProperty(0).toString());
- ResultText.setText(body.getProperty(0).toString());
- } catch (IOException ex) {
- System.out.println(ex.toString());
- ex.printStackTrace();
- } catch (XmlPullParserException ex) {
- System.out.println(ex.toString());
- ex.printStackTrace();
- }
- //Intent myIntent = new Intent(viewParam.getContext(), Activity3.class);
- //startActivity(myIntent);
- }
- }
- }
- );
- }
- }
Parsed in 0.043 seconds, using GeSHi 1.0.8.4
Please help me to identify were would be the problem.


