Grant
Grant

Reputation: 4543

Pass parameter to a webservice using ksoap2?

I have a simple web service method with a parameter like follows

public String fetchOrderInfo(int g){
...

}

I want to pass a value to int g from an Android program using ksoap2. I have used some thing like this but this doesn't work

...
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);  
    PropertyInfo oId = new PropertyInfo();
    oId.flags=3;
    oId.type=PropertyInfo.INTEGER_CLASS;
    request.addProperty(oId,3);
...

How can I pass a value to int g ?? (Severer is Tomcat7) Thanks!

Upvotes: 1

Views: 533

Answers (1)

Marcos
Marcos

Reputation: 4643

Try this:

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("g", 3);
...

Upvotes: 1

Related Questions