Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android使用ksoap通过摘要身份验证连接到soap web服务_Android_Web Services_Http Status Code 401_Ksoap_Digest Authentication - Fatal编程技术网

Android使用ksoap通过摘要身份验证连接到soap web服务

Android使用ksoap通过摘要身份验证连接到soap web服务,android,web-services,http-status-code-401,ksoap,digest-authentication,Android,Web Services,Http Status Code 401,Ksoap,Digest Authentication,我在使用摘要身份验证从PHP soap web服务获取授权头时遇到问题。(PHP客户端与web服务一起正常工作) 我得到错误401,但我在信封中找不到标题。headerIn字段为空 我需要以某种方式连接到web服务—获取标题(主要问题),然后重新创建摘要授权标题(这很容易),然后使用身份验证信息再次连接到web服务 有什么建议吗 @Override protected String doInBackground(SoapProperty... soapProperties) { if(t

我在使用摘要身份验证从PHP soap web服务获取授权头时遇到问题。(PHP客户端与web服务一起正常工作)

我得到错误401,但我在信封中找不到标题。headerIn字段为空

我需要以某种方式连接到web服务—获取标题(主要问题),然后重新创建摘要授权标题(这很容易),然后使用身份验证信息再次连接到web服务

有什么建议吗

@Override
protected String doInBackground(SoapProperty... soapProperties) {
    if(this.methodName.isEmpty())
        throw new IllegalArgumentException("methodName is not specified");

    String response="";
    android.os.Debug.waitForDebugger();

    try{
        String SOAP_ACTION = this.namespace + "/" + this.methodName;
        SoapObject request = new SoapObject(this.namespace, this.methodName);

        for(SoapProperty s : soapProperties){
            request.addProperty(s.getKey(), s.getValue());
        }

        SoapSerializationEnvelope envelope;
        envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.setOutputSoapObject(request);

        HttpTransportSE ht = new HttpTransportSE(this.url);

        ht.call(SOAP_ACTION, envelope);
        response = (String)envelope.getResponse();
    }
    catch(Exception e){
        e.printStackTrace();
        publishProgress(true);
    }

    return response;
}