Java Ksoap2安卓非法状态异常

Java Ksoap2安卓非法状态异常,java,android,web-services,ksoap2,android-ksoap2,Java,Android,Web Services,Ksoap2,Android Ksoap2,我正在使用Ksoap2来使用我的Web服务,在某些设备上,我遇到了以下异常:java.lang.IllegalStateException:在建立连接后无法设置请求属性 我试图解决它从两天,但没有任何关键来解决它 java.lang.IllegalStateException: Cannot set request property after connection is made at com.android.okhttp.internal.http.HttpURLConnectionImpl

我正在使用Ksoap2来使用我的Web服务,在某些设备上,我遇到了以下异常:java.lang.IllegalStateException:在建立连接后无法设置请求属性

我试图解决它从两天,但没有任何关键来解决它

java.lang.IllegalStateException: Cannot set request property after connection is made
at com.android.okhttp.internal.http.HttpURLConnectionImpl.setRequestProperty(HttpURLConnectionImpl.java:496)
at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.setRequestProperty(DelegatingHttpsURLConnection.java:258)
at com.android.okhttp.internal.http.HttpsURLConnectionImpl.setRequestProperty(HttpsURLConnectionImpl.java:25)
at org.ksoap2.transport.ServiceConnectionSE.setRequestProperty(ServiceConnectionSE.java:101)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:156)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:116)
at mypkg.webservice.SoapRequest.getResponse(SoapRequest.java:66)
at mypkg.webservice.SoapObjectService.call(SoapObjectService.java:45)
at mypkg.webservice.ServiceCall.call(ServiceCall.java:29)
at mypkg.loadContentFromService(ContentManager.java:207)
at mypkg.loadContentFromCache(ContentManager.java:177)
at mypkg.refreshContent(ContentManager.java:125)
at mypkg.refresh(MyClass.java:93)
at mypkg.syncAll(MyClass2.java:148)
下面是我如何使用Ksoap

   String soapAction = SERVICE_NAMESPACE + methodName;
    SoapObject request = new SoapObject(SERVICE_NAMESPACE, methodName);
    if (properties != null)
        for (PropertyInfo pro : properties) {
            request.addProperty(pro);
        }

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.implicitTypes = true;
    envelope.setOutputSoapObject(request);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(serviceURL, 30000);
    androidHttpTransport.debug = false;
    androidHttpTransport.call(soapAction, envelope);
return envelope.getResponse();
有人能帮忙吗


当我将错误值传递给我添加到请求中的PropertyInfo时,我得到了相同的异常。你能展示更多关于你放入PropertyInfo的属性的信息吗?我正在添加普通的服务方法参数,如用户id、用户名、密码等