Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First use "soapUI" to see correct request structure(like item names,item namespaces , ...). We assume that you want to write like this XML in request:(here n0 and n1 are namespaces)</p> <pre><code>&lt;n0:strarray xmlns:n0="http://n0 ..." xmlns:n1="http://n1 ..."&gt; &lt;n1:string&gt;hello&lt;/n1:string&gt; &lt;n1:string&gt;world&lt;/n1:string&gt; &lt;/n0:strarray&gt; </code></pre> <p>extend a class from vector:</p> <pre><code>import java.util.Hashtable; import java.util.Vector; import org.ksoap2.serialization.KvmSerializable; import org.ksoap2.serialization.PropertyInfo; public class StringArraySerializer extends Vector&lt;String&gt; implements KvmSerializable { //n1 stores item namespaces: String n1 = "http://n1 ..."; @Override public Object getProperty(int arg0) { return this.get(arg0); } @Override public int getPropertyCount() { return this.size(); } @Override public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) { arg2.setName = "string"; arg2.type = PropertyInfo.STRING_CLASS; arg2.setNamespace = n1; } @Override public void setProperty(int arg0, Object arg1) { this.add(arg1.toString()); } } </code></pre> <p>To build the request you have to do this: </p> <p>1-make a new Vector-Object from this class:</p> <pre><code>StringArraySerializer stringArray = new StringArraySerializer(); </code></pre> <p>2-then you can add elements:</p> <pre><code>stringArray.add("hello"); stringArray.add("world"); </code></pre> <p>3-then you create a PropertyInfo with it:</p> <pre><code>//n0 stores array namespace: String n0 = "http://n0 ..."; stringArrayProperty = new PropertyInfo(); stringArrayProperty.setName("strarray"); stringArrayProperty.setValue(stringArray); stringArrayProperty.setType(stringArray.getClass()); stringArrayProperty.setNamespace(n0); </code></pre> <p>4-then you add all the properties to the request:</p> <pre><code>Request = new SoapObject(NAMESPACE, METHOD_NAME); Request.addProperty(stringArrayProperty); </code></pre> <p>Reference:</p> <p><a href="https://code.google.com/p/ksoap2-android/wiki/CodingTipsAndTricks" rel="nofollow">ksoap2-android,CodingTipsAndTricks</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload