org.ksoap2.serialization
Class SoapObject

java.lang.Object
  extended by org.ksoap2.serialization.SoapObject
All Implemented Interfaces:
KvmSerializable

public class SoapObject
extends java.lang.Object
implements KvmSerializable

A simple dynamic object that can be used to build soap calls without implementing KvmSerializable Essentially, this is what goes inside the body of a soap envelope - it is the direct subelement of the body and all further subelements Instead of this this class, custom classes can be used if they implement the KvmSerializable interface.


Constructor Summary
SoapObject(java.lang.String namespace, java.lang.String name)
          Creates a new SoapObject instance.
 
Method Summary
 SoapObject addProperty(PropertyInfo propertyInfo, java.lang.Object value)
          Adds a property (parameter) to the object.
 SoapObject addProperty(java.lang.String name, java.lang.Object value)
          Adds a property (parameter) to the object.
 boolean equals(java.lang.Object o)
           
 java.lang.String getName()
           
 java.lang.String getNamespace()
           
 java.lang.Object getProperty(int index)
          Returns a specific property at a certain index.
 java.lang.Object getProperty(java.lang.String name)
           
 int getPropertyCount()
          Returns the number of properties
 void getPropertyInfo(int index, java.util.Hashtable properties, PropertyInfo propertyInfo)
          Places PropertyInfo of desired property into a designated PropertyInfo object
 SoapObject newInstance()
          Creates a new SoapObject based on this, allows usage of SoapObjects as templates.
 void setProperty(int index, java.lang.Object value)
          Sets a specified property to a certain value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SoapObject

public SoapObject(java.lang.String namespace,
                  java.lang.String name)
Creates a new SoapObject instance.

Parameters:
namespace - the namespace for the soap object
name - the name of the soap object
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getName

public java.lang.String getName()

getNamespace

public java.lang.String getNamespace()

getProperty

public java.lang.Object getProperty(int index)
Returns a specific property at a certain index.

Specified by:
getProperty in interface KvmSerializable
Parameters:
index - the index of the desired property
Returns:
the desired property

getProperty

public java.lang.Object getProperty(java.lang.String name)

getPropertyCount

public int getPropertyCount()
Returns the number of properties

Specified by:
getPropertyCount in interface KvmSerializable
Returns:
the number of properties

getPropertyInfo

public void getPropertyInfo(int index,
                            java.util.Hashtable properties,
                            PropertyInfo propertyInfo)
Places PropertyInfo of desired property into a designated PropertyInfo object

Specified by:
getPropertyInfo in interface KvmSerializable
Parameters:
index - index of desired property
propertyInfo - designated retainer of desired property
properties - information about the (de)serializer. Not frequently used.

newInstance

public SoapObject newInstance()
Creates a new SoapObject based on this, allows usage of SoapObjects as templates. One application is to set the expected return type of a soap call if the server does not send explicit type information.

Returns:
a copy of this.

setProperty

public void setProperty(int index,
                        java.lang.Object value)
Sets a specified property to a certain value.

Specified by:
setProperty in interface KvmSerializable
Parameters:
index - the index of the specified property
value - the new value of the property

addProperty

public SoapObject addProperty(java.lang.String name,
                              java.lang.Object value)
Adds a property (parameter) to the object. This is essentially a sub element.

Parameters:
name - The name of the property
value - the value of the property

addProperty

public SoapObject addProperty(PropertyInfo propertyInfo,
                              java.lang.Object value)
Adds a property (parameter) to the object. This is essentially a sub element.

Parameters:
propertyInfo - designated retainer of desired property
value - the value of the property

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object