abgerufen werden muss ich retrived Daten von Web-Service asmx in Android anzeigen müssen.müssen Werte von Web-Service asmx in Android
private class AsyncCallWS extends AsyncTask<Void, Void, Void> {
public boolean isOnline()
{
ConnectivityManager localConnectivityManager = (ConnectivityManager)getSystemService("connectivity");
NetworkInfo localNetworkInfo = localConnectivityManager.getActiveNetworkInfo();
return (localNetworkInfo != null) && (localNetworkInfo.isConnectedOrConnecting()) && (localConnectivityManager.getActiveNetworkInfo().isAvailable()) && (localConnectivityManager.getActiveNetworkInfo().isConnected());
}
@Override
protected void onPreExecute() {
Log.i(TAG, "onPreExecute");
}
@Override
protected Void doInBackground(Void... params) {
Log.i(TAG, "doInBackground");
String NAMESPACE = "http://tempuri.org/";
String URL = "http://example.com/example/GroupMessage/GroupMessage.asmx";
String METHOD_NAME = "GroupList";
String SOAP_ACTION = "http://tempuri.org/GroupList";
try {
SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
Request.addProperty("PortalId","0");
Request.addProperty("ModuleId", "1884");
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.dotNet = true;
soapEnvelope.setOutputSoapObject(Request);
HttpTransportSE transport = new HttpTransportSE(URL);
transport.call(SOAP_ACTION, soapEnvelope);
resultString = (SoapObject)soapEnvelope.getResponse();
Log.i(TAG, "Result Login: " + resultString);
} catch (Exception ex) {
Log.e(TAG, "Error: " + ex.getMessage());
}
return null;
}
@Override
protected void onPostExecute(Void result) {
Log.i(TAG, "onPostExecute");
mInformationTextView = (TextView) findViewById(R.id.informationTextView);
mInformationTextView.setText(resultString.toString());
/* Datas from web service */
SoapObject request2 = (SoapObject)resultString.getProperty(0);
for(int i=0; i<request2.getPropertyCount(); i++) {
**///// code to display datas //////////**
}
Toast.makeText(MainActivity.this, "Response" + resultString.toString(), Toast.LENGTH_LONG).show();
}
Jetzt ich bin immer Antwort wie diese --- anyType {SalGM_GroupInfo = anyType {PortalId = 0; ModuleId = 1884; GroupId = 1; Gruppenname = Test1; }; SalGM_GroupInfo = anyType {PortalId = 0; ModuleId = 1884; Gruppen-ID = 2; Gruppenname = Test2; }; SalGM_GroupInfo = anyType {PortalId = 0; ModuleId = 1884; Gruppen-ID = 3; Gruppenname = Test3; }; SalGM_GroupInfo = anyType {PortalId = 0; ModuleId = 1884; Gruppen-ID = 4; Gruppenname = Test4; }; }
Ich brauche unter Verwendung dynamische Textansicht
PortalId = 0
ModuleId = 1884
GroupId = 1
Groupname = Test1
PortalId = 0
wie die Ausgabe in Android anzuzeigen ModuleId = 1884
GroupId = 2
Groupname = Test2
PortalId = 0
ModuleId = 1884
GroupId = 3
Groupname = Test3
PortalId = 0
ModuleId = 1884
GroupId = 4
Groupname = Test4
Jeder Vorschlag, bitte helfen,
Danke.