ESME
ESME
Konya
01/11/2016 tarihinden beri üye
60 GY Puanı
49K GY Sırası

Kişisel Sayfaları

İlgi Alanları

2 Rozet
0 Sertifika
1 Soru Sordu
2 Cevap Verdi
0 Blog Yazısı
0 Etiket Takibi

Hakkında

İş Tecrubesi

Kullanıcıya ait İş tecrübesi bilgisi bulunmamaktadır.

Eğitim Geçmişi

Selçuk Üniversitesi
| Aralık 2020 - Aralık 2020

Sertifikalar & Başarılar

GY Sertifikaları (0)
Kullanıcının GY sertifikası bulunmamaktadır.
Diğer Sertifikaları (0)
Kullanıcıya ait sertifika bulunmamaktadır.
Test Sonuçları (0)

Kullanıcıya ait test sonucu bulunmamaktadır.

Dil Becerileri

Son Forum Aktiviteleri

3
Tümünü Gör

web servis dataset

Merhaba arkadaşlar ben web servisten dataset türündeki veriyi androidde göstermek istiyorum da acaba nasıl yapabilrim ?

7 yıl 5 ay önce yanıtladın

Android ile .NET Web Servisten List Tipindeki Veriyi Alma

public class MainActivity extends AppCompatActivity {
    public final static String URL = "http://web.gunyaz.com/Service.asmx?WSDL";
    public static final String NAMESPACE = "http://tempuri.org";
    public static final String SOAP_ACTION = "http://tempuri.org/Raporlar_List";
    private static final String METHOD = "Raporlar_List";
    public ArrayList<String> list;
    private TextView textView;
    public ListView listview;
  public   ArrayAdapter adapter;
    /**
     * ATTENTION: This was auto-generated to implement the App Indexing API.
     * See https://g.co/AppIndexing/AndroidStudio for more information.
     */
    private GoogleApiClient client;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        textView = (TextView) findViewById(R.id.textView2);

        AsyncTaskRunner runner = new AsyncTaskRunner();
        runner.execute();
        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.
        client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
    }

    /**
     * ATTENTION: This was auto-generated to implement the App Indexing API.
     * See https://g.co/AppIndexing/AndroidStudio for more information.
     */
    public Action getIndexApiAction() {
        Thing object = new Thing.Builder()
                .setName("Main Page") // TODO: Define a title for the content shown.
                // TODO: Make sure this auto-generated URL is correct.
                .setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
                .build();
        return new Action.Builder(Action.TYPE_VIEW)
                .setObject(object)
                .setActionStatus(Action.STATUS_TYPE_COMPLETED)
                .build();
    }

    @Override
    public void onStart() {
        super.onStart();

        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.
        client.connect();
        AppIndex.AppIndexApi.start(client, getIndexApiAction());
    }

    @Override
    public void onStop() {
        super.onStop();

        // ATTENTION: This was auto-generated to implement the App Indexing API.
        // See https://g.co/AppIndexing/AndroidStudio for more information.
        AppIndex.AppIndexApi.end(client, getIndexApiAction());
        client.disconnect();
    }

    private class AsyncTaskRunner extends AsyncTask<Object, Object, ArrayList<String>> {


        protected ArrayList<String> doInBackground(Object... params) {
            publishProgress("Loading contents..."); // Calls onProgressUpdate()

            try {

                SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
                SoapObject request = new SoapObject(NAMESPACE, METHOD);
                request.addProperty("param[0]", "Satis_Raporu");
                request.addProperty("param2[0]", "WIN_P1DRPBTL2D2");
                request.addProperty("param2[1]", "UsiS_V65");
                envelope.dotNet = true;
                envelope.bodyOut = request;


                HttpTransportSE transport = new HttpTransportSE(URL);
                try {
                    transport.call(SOAP_ACTION, envelope);
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (XmlPullParserException e) {
                    e.printStackTrace();
                }

                if (envelope.bodyIn != null) {
                    SoapObject response = (SoapObject) envelope.bodyIn;


                    ArrayList<String> arrayList = new ArrayList<String>();

                    int intPropertyCount = response.getPropertyCount();


                    for (int i = 0; i < intPropertyCount; i++) {
                        arrayList.add(response.getProperty(i).toString());


                    }


                }


            } catch (Exception e) {
                e.printStackTrace();
                //resp = e.getMessage();
            }


            return list;
        }


        protected void onPostExecute(ArrayList<String> result) {
            // execution of result of Long time consuming operation
            // In this example it is the return value from the web service
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    // Set adapter
                    adapter = new ArrayAdapter<String>(MainActivity.this, R.layout.activity_main, R.id.product_name, list);

                    listview.setAdapter(adapter);
                }
            });

        }


        protected void onProgressUpdate(Object... text) {

            // Things to be done while execution of long running operation is in
            // progress. For example updating ProgessDialog
        }


    }

}

Arkadaşlar asp.net web servisten list tipinde dönen veriyi listview' e atmak istiyorum fakat program direk durduruluyor. Sizce neden?

 

androide web servisten geln veriyi cekmek

01 Kasım 2016 tarihinde cevaplandı

Merhaba ben web servisten dataset türündeki veriyi çekmeye çalışıyorum fakat çekemedim yardımcı olursanız çok sevinirim teşekkürler