title: Webservice returns anyType{} android
body: <p>I'm new in the programming world, so I just need some help.
  I must consume a webservice on android. I've already done one that works fine, but the problem happens when I have to pass a parameter. I'm not sure what I'm doing wrong.</p>
  
  <p>Here's the code of the AsyncTask: </p>
  
  <pre><code>public class PegaHorarioProfessorTask extends AsyncTask&lt;Object, Object, String&gt; {
  
      private static final String NAMESPACE = "http://tempuri.org/";
      private static String URL = "http://fatec.aied.com.br/publico.asmx?WSDL"; //"10.68.76.4/publico.asmx?WSDL";  //        http://fatec.aied.com.br/publico.asmx?WSDL
      private static final String SOAP_ACTION = "http://tempuri.org/HorarioProfessor";
  
          @Override
          public String doInBackground(Object... objects) {
              String frase = null;
  
              SoapObject soap = new SoapObject(NAMESPACE, "HorarioProfessor");
  
              String id = "11";
  
              PropertyInfo profId =new PropertyInfo();
              profId.setName("Id");
              profId.setValue(id);
              profId.setType(String.class);
              soap.addAttribute("Id", id);
  
              SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
              envelope.dotNet = true;
              envelope.setOutputSoapObject(soap);
              HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
  
              SoapObject result = null;
  
              try {
  
                  androidHttpTransport.call(SOAP_ACTION, envelope);
              SoapObject resultado1 = (SoapObject)envelope.getResponse();
  
                  //result = (SoapObject) envelope.bodyIn;
                  //result.getProperty(0);
  
                  if (result != null) {
                      Log.i("Result", result.toString());
                      return result.toString();
                  }
  
              } catch (Exception e) {
                  e.printStackTrace();
              }
              return result.toString();
  
          }
      }
  </code></pre>
  
  <p>So, I pass the ID 11 and it returns 2 Strings. The problem is: it doesn't return anything besides 'anyType{}', and I'm not sure how to receive two strings. I've commented two lines, because I'm not sure if it's better to get the result by envelope.bodyIn or envelope.getResponse().</p>
  
  <p>Maybe, it's necessary to post the Activity that receives the result:</p>
  
  <pre><code>public class ActivityHorarioProfessor extends ActionBarActivity {
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_horario_professor);
  
          String[] aux = null;
  
          Intent intent = this.getIntent();
          Professores professor = (Professores) intent.getSerializableExtra("professorSelecionado");
          if(professor!=null) {
              PegaHorarioProfessorTask prof = new PegaHorarioProfessorTask();
              Log.i("Número", String.valueOf(prof));
              String auxi = null;
              try {
                  auxi = prof.execute().get().toString();
              } catch (InterruptedException e) {
                  e.printStackTrace();
              } catch (ExecutionException e) {
                  e.printStackTrace();
              }
  
              Log.i("Auxi", String.valueOf(auxi));
          }
          else {
              Log.i("It's", "WRONG");
          }
  
      }
  }
  </code></pre>
  
  <p>It just gives back an empty (anyType{}) answer.</p>