Problem passing parameters with KSOAP2 at a PHP webservice

by Octavian Pascu » Thu, 12 May 2011 09:00:09 GMT

Sponsored Links
 Hi everyone,

I have the following code which calls a PHP webservice. The code
connects to the service, but the paramters are not passed well.
Because I've noticed that I have problems passing the parameters, I
had modified the method to return the parameters, and for the next
code it returnes "m m"(basicly it returns the first letter of the
first parameter twice).

    String SOAP_ACTION = "urn:server#userAuth";
    String METHOD_NAME = "userAuth";

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

//        I've tried this too but with no results
//        request .addProperty("usr",  "");
//        request .addProperty("pass", "xxxxxxxxxxxxxxxxxxxxxx");

    PropertyInfo p1 = new PropertyInfo();
    p1.type = PropertyInfo.STRING_CLASS;

    PropertyInfo p2 = new PropertyInfo();
    p2.type = PropertyInfo.STRING_CLASS;

    SoapSerializationEnvelope envelope = new

    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);, envelope);

    Object result = (Object)envelope.getResponse();
    return result.toString();

To make an ideea, here is the php code...

$server = new nusoap_server;
$server->configureWSDL('server', 'urn:server');
$server->wsdl->schemaTargetNamespace = 'urn:server';
            array('usr' => 'xsd:string', 'pass' => 'xsd:string'),
            array('return' => 'xsd:string'),

function userAuth($value){


        return $a;




Other Threads

1. How to use the Network Manager?

I need to connect my device to the network.
I have a preference order of Wifi/GPRS/dial-up modem in sequence.
How do I go about it?


2. How does FW upgrade work without erasing user data?

Only system.img is updated.  The contents of userdata.img is by definition
the user's data, and if you replace it you replace the user's data.  You
don't include it as part of an update, and you don't put anything you want
to be able to update in it.  Typically the stock device images has a
basically empty user data.

Dianne Hackborn
Android framework engineer

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.


3. Importante sobre XML en Android!

4. Resolving remote hostname .. !

5. What does "Battery Usage" Mean?

6. Double-Permissions when publishing to Android Market?

7. Unable to return back to activity