Reputation: 293
when adding a property to an soap object can't specify it's type .... I need integer but it always sets it to "d:string" <timestamp i:type="d:string">1312191347</timestamp>
here is the way I add the proprety:
SoapObject _client = new SoapObject("urn:PopfaxService", "PopfaxService.getModifiedObjects");
PropertyInfo UIDInfo = new PropertyInfo ();
UIDInfo.name = "timestamp";
UIDInfo.type = PropertyInfo.INTEGER_CLASS;
_client.addProperty(UIDInfo,String.valueOf(timestamp));
can anyone help ?
Upvotes: 2
Views: 2725
Reputation:
Try this:
PropertyInfo pi1 = new PropertyInfo();
pi1.setName("arg0");
pi1.setValue("username");
pi1.setType(String.class);
request.addProperty(pi1);
PropertyInfo pi2 = new PropertyInfo();
pi2.setName("arg1");
pi2.setValue("password");
pi2.setType(String.class);
request.addProperty(pi2);
until I'm replaced username and password to arg0 and arg1, this dont work
Upvotes: 1
Reputation: 161
This may help you...
public String call(String a,String b)
{
SoapObject request = new SoapObject(WSDL_TARGET_NAMESPACE,OPERATION_NAME);
PropertyInfo pi=new PropertyInfo();
pi.setName("username");
pi.setValue(a);
pi.setType(a.getClass());
request.addProperty(pi);
pi=new PropertyInfo();
pi.setName("password");
pi.setValue(b);
pi.setType(b.getClass());
request.addProperty(pi);
Upvotes: 2
Reputation: 29912
You are adding it with String.valueOf ... which is a string, so ksoap is doing the right thing.
Upvotes: 3