Problem complex types as return variable for SOAP webservice Client (Web service) with ksoap library for android
Hi
I used this tutorial https://www.blogger.com/commen
BUT i have a problem with complex types of soap varaibles.
I have set up a coldfusion webserver. which has the following test webservice.
--------------------
Code:
<cfcomponent>
<cffunction name="getMessage" access="remote" returntype="any" output="no">
<cfargument name="vname" type="string" required="yes">
<cfargument name="nname" type="string" required="yes">
<cfset response = structnew()>
<cfset response.vname = arguments.vname>
<cfset response.nname = arguments.nname>
<cfreturn response>
</cffunction>
</cfcomponent>
---------
THE PROBLEM is that normal strings are comming threw but when I'm setting a complex type to this i can't get the attributes themselve What i get is the whole object as a string.
I looked to cast the object to a string Array Object but then a castexexption comes from Java
Next i tried this Android Client app with vectors but here they say illegal argument.
------------
Code:
import java.util.Vector;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapO
import org.ksoap2.serialization.SoapS
import org.ksoap2.transport.AndroidHt
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListe
import android.widget.EditText;
import android.widget.TextView;
public class test_ws_array extends Activity {
private static final String SOAP_ACTION = "getMessage";
private static final String METHOD_NAME = "getMessage";
private static final String NAMESPACE = "http://rpc.xml.coldfusion";
// !!!!! WICHTIG !!!!! IMMER NEUE IP EINTRAGEN DA SICH DIESE JEDESMAL AENDERT !!!!!
private static final String URL = "http://195.30.48.80:8500/DA/w
//private static final String URL = "http://192.168.1.33:8500/DA/w
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
//Buttons deaktiviert alles automatisch
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("vname", "Christian"
request.addProperty("nname", "Braun"
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(Soap
envelope.setOutputSoapObject(r
AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport (URL);
try {
androidHttpTransport.call(SOAP
SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
Vector XXXX = (Vector) resultsRequestSOAP.getProperty
//Vector XXXX = (Vector) resultsRequestSOAP.getProperty
//Object result = envelope.getResponse();
//Object result = new Object();
//result = envelope.getResponse();
//Object[] results = (Object[]) result;
//2 Zeilen weg die sollten gehen mit Komplexen Objekttypen)
//String[] str = (String[]) result;
//((TextView)findViewById(R.id
((TextView)findViewById(R.id.l
//((TextView)findViewById(R.id
} catch(Exception E) {
((TextView)findViewById(R.id.l
}
}
}
------------
When i make a output with toString() method with the result then this is displayed on the screen:
getMessageResponse{getMessager
Maybe you can help me - this would be very helpful
Have you tried a complex Soap Type in a different way? And maybe have a sample app? Thanx!
Christian
New tutorials from Helloandroid
Recent Apps
Android on Twitter
-
@ursimon (Michal Ursiny)Does your boss or collegue annoy you? Deal with them like Dirty Harry! #android https://t.co/5uR4UX7i
1 hour 44 min ago -
@stephiidixon27 (Stephii)I have just reached level 9 in My Railway! You can get it for FREE on Android! http://t.co/icWbH01Y #android #androidgames
1 hour 44 min ago -
@DroidBoom (Android)NBA's Phoenix Suns All Business With Galaxy Tablets #android #galaxytab http://t.co/7wLrrfRR
1 hour 44 min ago -
@strictlyandroid (StrictlyAndroid News)MIUI 4 for Kindle Fire Now Available for Download [Video] http://t.co/QYbC3BP7 #android
1 hour 44 min ago -
@strictlyandroid (StrictlyAndroid News)Zillow Mortgage Calculator for Android Now Available http://t.co/Dt5TGo4J #android
1 hour 44 min ago
Poll
Useful resources
Android Development Projects
- Need Mobile iPad iPhone Version of My Website by natedevault
- Looking for iPhone / iPad / Android Mobile Apps by neilsonap
- Redesign existing iPhone/iPad App's Graphical User Interface by cstlah
- application video editing by Martinrens
- Mobile Phone App Development by vidasmith
- Android App wanted immediately by JoePublic
- LIST DATA PROJ by nhammoud
- Nonpublic project #1433932 by subpariq
- Alarm Android Application Design by globalheed
- Simple Album App for Android by ayfonfan



I'm coming up with the best solution for making money and fixing computers. It's a about a site which sells and buys used computer hardware and it's really good quality even if it's second hand. Try it yourself!