I can’t display my class schedule in TextView . The ksoap2 library is ksoap2 . When passing the potok and semestr parameters to the GetCurrentWeek method, it is possible to get data about the current week (the week number is returned). But when passing the parameters potok , semestr , substance (the name of the group is entered in Cyrillic) nothing is displayed for the RaspisForSubstance method, although when you transfer these parameters in the SOAP UI program, everything is displayed and shows the schedule. The question is, what could be the error?

 public class MainActivity extends Activity { private final String NAMESPACE = "http://sfedu-tgn.ru/"; private final String URL = "http://sfedu-tgn.ru/WebServices/Raspisanie.asmx?WSDL"; private final String SOAP_ACTION = "http://sfedu-tgn.ru/RaspisForSubstance"; private final String METHOD_NAME = "RaspisForSubstance"; private static String val1, val2, val3; private static String result; Button b; TextView tv; EditText et1, et2, et3; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); et1 = (EditText) findViewById(R.id.editText1); et2 = (EditText) findViewById(R.id.editText2); et3 = (EditText) findViewById(R.id.editText3); tv = (TextView) findViewById(R.id.tv_result); b = (Button) findViewById(R.id.button1); b.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { val1 = et1.getText().toString(); val2 = et2.getText().toString(); val3 = et3.getText().toString(); AsyncCallWS task = new AsyncCallWS(); task.execute(); } }); } private class AsyncCallWS extends AsyncTask<String, Void, Void>{ @Override protected Void doInBackground(String... params) { getRaspis(val1, val2, val3); return null; } @Override protected void onPostExecute(Void aVoid) { tv.setText(result); } } public void getRaspis(String val1, String val2, String val3){ SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); PropertyInfo req1 = new PropertyInfo(); req1.setName("potok"); req1.setValue(val1.toString()); PropertyInfo req2 = new PropertyInfo(); req2.setName("semestr"); req2.setValue(val2.toString()); PropertyInfo req3 = new PropertyInfo(); req3.setName("substance"); req3.setValue(val3.toString()); request.addProperty(req1); request.addProperty(req2); request.addProperty(req3); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); try { androidHttpTransport.call(SOAP_ACTION, envelope); SoapPrimitive response = (SoapPrimitive) envelope.getResponse(); result = response.toString(); }catch (Exception e){ e.printStackTrace(); } } } 

    1 answer 1

    try to set the encoding

     androidHttpTransport.setXmlVersionTag="<?xml version=“1.0” encoding=“utf-8”?>" 
    • Try to write more detailed answers. Explain what is the basis of your statement? - Nicolas Chabanovsky
    • Perhaps you have a mistake in the encoding - Oleg Khlybov