Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This code parses XML data from web service. It Works.</p> <pre><code> super.onCreate(savedInstanceState); setContentView(R.layout.activity_servis_uygulamasi); Button btn=(Button)findViewById(R.id.button1); btn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { String pSoapAction = "http://tempuri.org/GetMagazaList"; String pMethodName = "GetMagazaList"; String pNameSpace = "http://tempuri.org/"; String pUrl =""; SoapObject result =(SoapObject)getWebServisDATA(pUrl, pMethodName, pNameSpace, pSoapAction, "333"); TextView tv =(TextView)findViewById(R.id.textView2); try { SoapObject soapObjectGetProperty=(SoapObject)result.getProperty(0); SoapObject resDiff = (SoapObject)soapObjectGetProperty.getProperty("diffgram"); SoapObject resDocEl = (SoapObject)resDiff.getProperty("DocumentElement"); StringBuilder stringBuilder = new StringBuilder(); for(int j=0;j&lt;resDocEl.getPropertyCount();j++) { SoapObject resTable= (SoapObject)resDocEl.getProperty(j); String MagazaObjId =resTable.getProperty("MagazaObjId").toString(); String MagazaAdi = resTable.getProperty("MagazaAdi").toString(); String MagazaKodu = resTable.getProperty("MagazaKodu").toString(); String MagazaPosDepoNo =resTable.getProperty("MagazaPosDepoNo").toString(); String PosId = resTable.getProperty("PosId").toString(); String IsYeriObjId = resTable.getProperty("IsYeriObjId").toString(); stringBuilder.append ( "MagazaObjId :" +MagazaObjId+"\n"+ "MagazaAdi :" +MagazaAdi+"\n"+ "MagazaKodu :" +MagazaKodu+"\n"+ "MagazaPosDepoNo :"+MagazaPosDepoNo+"\n"+ "PosId :" +PosId+"\n"+ "Type :" +IsYeriObjId+"\n"+ "******************************" ); stringBuilder.append("\n"); } tv.setText(stringBuilder); } catch(Exception e) { tv.setText(e.getMessage()); } } }); } public static SoapObject getWebServisDATA(String pUrl, String pMethodName,String pNameSpace, String pSoapAction,String pname) { SoapObject result = null; SoapObject request = new SoapObject(pNameSpace, pMethodName); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11); envelope.dotNet = true; request.addProperty("firma",pname); envelope.setOutputSoapObject(request); AndroidHttpTransport httpTransport = new AndroidHttpTransport(pUrl); try { httpTransport.call(pSoapAction, envelope); result = (SoapObject)envelope.bodyIn; } catch (Exception e) { } return result; </code></pre> <p>}</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. 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