开发者

Android :Problem with parameter passing(webservices)

I am new to web services and I got a problem with the response in the logcat. I am passing all my parameters to the server but the response is some what unreliable and I goggled a lot to find out the solution, but I cant.I am using Ksoap, WSDL in my webservices

The logcat message is this

 06-17 14:20:31.168: VERBOSE/TAG(302): `RegisterUserResponse{RegisterUserResult=-1; }`

someone开发者_Python百科 plz help me to solve this

private static final String SOAP_ACTION = "http://tempuri.org/RegisterUser";
private static final String METHOD_NAME = "RegisterUser";
private static final String NAMESPACE = "http://tempuri.org";
private static final String URL = "http://........";
private static final String TAG = "HELLO";

Thread t;
ProgressDialog dialog;


@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    Button signin = (Button) findViewById(R.id.regsubmitbtn);

    signin.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            showDialog(0);
            t = new Thread() {
                public void run() {
                    register();
                }
            };
            t.start();
        }
    });
}

@Override
protected Dialog onCreateDialog(int id) {
    switch (id) {
    case 0: {
        dialog = new ProgressDialog(this);
        dialog.setMessage("Please wait while connecting...");
        dialog.setIndeterminate(true);
        dialog.setCancelable(true);
        return dialog;
    }
Button regmalebtn;

public void register() {
    Log.v(TAG, "Trying to Login");

SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(
            SoapEnvelope.VER11);

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    soapEnvelope.dotNet = true;

    soapEnvelope.setOutputSoapObject(request);

    // String response1 = request.getProperty(0).toString() ;
    request.addProperty("fname", "raghav");
    request.addProperty("lname", "raju");
    request.addProperty("dateofbirth", "18-01-1985");
    request.addProperty("email", "raghuraju90@yahoo.com");
    request.addProperty("password", "1234");
    //request.addProperty("password", repassword);
    request.addProperty("mobno", "8553456260");
    request.addProperty("latitude", "76");
    request.addProperty("longitude", "82");
    request.addProperty("device_id", "123456");
    request.addProperty("gender", "male");
    // request.addProperty("latitude',latitude);

    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
    androidHttpTransport.debug = true;
    try {
        androidHttpTransport.call(SOAP_ACTION, soapEnvelope);
        androidHttpTransport
                .setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");

        SoapObject resultsRequestSOAP = (SoapObject) soapEnvelope.bodyIn;
        // SoapObject result = (SoapObject) soapEnvelope.getResponse();

        Log.v("TAG", String.valueOf(resultsRequestSOAP));
        String resultData;
        resultData = request.getProperty(0).toString();
    }
    return null;
}
} catch (Exception e) {

        e.printStackTrace();
    }

}
}


That error is being generated by the server. You'll need to speak with the developer / owner of the server and get them to check their logs to determine why your transaction is failing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜