0

私は2つの石鹸を使用する必要があります呼び出しURLは1つのクラスで使用されます。私のコードは:

public class Orderinfo extends Activity {
private static final String SOAP_ACTION = "http://xcart.com/data";
private static final String METHOD_NAME = "data";
private static final String NAMESPACE = "http://xcart.com";
private static final String URL = "http://192.168.1.168:8085/XcartLogin/services/RetailerWs?wsdl";
private static final String URL1 = "http://192.168.1.168:8085/XcartLogin/services/TodayC?wsdl";

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.table);
    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 = (TextView) findViewById(R.id.textView44);
      //  TextView tv = new TextView(this);

        for(int i = 0; i<resultArr.length;i++){
        tv.append(resultArr[i]+"\n\n");
       }


      } catch (Exception e) {
        e.printStackTrace();
      }
   HttpTransportSE ht1 = new HttpTransportSE(URL1);

    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 = (TextView) findViewById(R.id.textView43);
      //  TextView tv = new TextView(this);

        for(int i = 0; i<resultArr.length;i++){
        tv.append(resultArr[i]+"\n\n");
       }


    } catch (Exception e) {
        e.printStackTrace();
    }

   }
  }

ここでは、最初の石鹸呼び出し出力が3である必要があります。2番目の石鹸呼び出し出力は2ですが、両方が2つだけ表示されます。なぜここに例外があるのか​​。助けてください。

4

1 に答える 1

0

両方の呼び出しで要求に1つのevelopeを使用したため、いわゆるサービスメソッドとパラメーターは同じです

于 2012-08-02T07:05:15.983 に答える