简体   繁体   中英

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!

Try this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM