ソープコールで取得した値を Android に表示しようとしました。しかし、私はそれを機能させることはできません。アプリケーションを実行すると、Tomcat-Apache にカウント値が表示されます。しかし、私の Android エミュレーターにはカウント値が表示されません。ここにカウント値が表示されないのはなぜですか。私を助けてください。私はその理由を知っています。しかし、コード部分がわかりません。私の間違いは私のアンドロイドコード部分です。コードを変更できる場所。
これは私のWebサービスコードです:
public class RetailerWs {
public String customerData(){
String customerInfo = "";
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/xcart-432pro","root","");
//Find customer information where the customer ID is maximum
PreparedStatement statement =  con.prepareStatement("select * from xcart_orders where status='Q' AND date = CURDATE()");
 ResultSet result = statement.executeQuery();
  int count=0;    
   while(result.next()){
 count++;
 System.out.println(count);
 }
  }
 catch(Exception exc){
    System.out.println(exc.getMessage());
  }
   return customerInfo;
    }
   }
これは私のアンドロイドコード部分です:
   public class RetailerActivity extends Activity {
   private static final String SOAP_ACTION = "http://xcart.com/customerData";
   private static final String METHOD_NAME = "customerData";
   private static final String NAMESPACE = "http://xcart.com";
   private static final String URL = "http://192.168.1.168:8085/XcartLogin/services/RetailerWs?wsdl";
     /** Called when the activity is first created. */
    @Override
   public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.retrieve);
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);
    HttpTransportSE ht = new HttpTransportSE(URL);
    try {
        ht.call(SOAP_ACTION, envelope);
        SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
        SoapPrimitive s = response;
        String str = s.toString();
        String resultArr[] = str.split("&");//Result string will split & store in an array
        TextView tv = new TextView(this);
        for(int i = 0; i<resultArr.length;i++){
        tv.append(resultArr[i]+"\n\n");
       }
        setContentView(tv);
    } catch (Exception e) {
        e.printStackTrace();
       }
      }
      }
Androidエミュレーターでカウント値を出力するようにAndroidコードを変更する必要がある場所。