2013-07-15 36 views
1

我正在調用Soap Web服務。它工作正常,但有些時候我正在通過對等異常獲得連接重置。由對等方重置的連接在SOAP Web服務中異常調用

這是我的web服務的代碼中調用

new Thread(new Runnable() { 
       public void run() { 
        Looper.prepare(); 
        String response = ""; 
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
        envelope.dotNet = true; 
        envelope.setOutputSoapObject(serverRequestParams.getSoapObject()); 

        HttpTransportSE httpTransport = new HttpTransportSE(serverRequestParams.getUrl(),90000); 
        httpTransport.debug = true; 
        try { 

         HttpParams my_httpParams = new BasicHttpParams(); 
         final String proxyHost = android.net.Proxy.getDefaultHost(); 
         final int proxyPort = android.net.Proxy.getDefaultPort(); 
         if(proxyPort != -1) 
         { 
          my_httpParams.setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(proxyHost, proxyPort));    
         } 

         httpTransport.call(serverRequestParams.getSoapAction(), envelope); 
         Object data = envelope.getResponse(); 
         if (data instanceof SoapObject) { 
          SoapObject data2 = (SoapObject) data; 
          response = data2.toString(); 
         } else if (data instanceof SoapPrimitive) { 
          SoapPrimitive data3 = (SoapPrimitive) data; 
          response = data3.toString(); 
         } else if (data != null) { 
          response = data.toString(); 
         } else if (data == null) { 
          response = "nodata"; 
         } 
        } 
        catch (Exception e) { 
         System.out.print("Exception:"+e); 
        } 

回答

0

退房以下鏈接可能是其中的一個解決您的問題

link1

link2

link3

這些鏈接由客戶端和服務器端的一些解決方案組成,並提供信息爲何發生。

讓我知道這是否對你有幫助。

相關問題