2

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 ?

BurunduK
  • 293
  • 1
  • 3
  • 17

3 Answers3

3

You are adding it with String.valueOf ... which is a string, so ksoap is doing the right thing.

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
2

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);

sagar
  • 151
  • 2
  • 5
  • 14
1

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