Android使用ksoap通过摘要身份验证连接到soap web服务
我在使用摘要身份验证从PHP soap web服务获取授权头时遇到问题。(PHP客户端与web服务一起正常工作) 我得到错误401,但我在信封中找不到标题。headerIn字段为空 我需要以某种方式连接到web服务—获取标题(主要问题),然后重新创建摘要授权标题(这很容易),然后使用身份验证信息再次连接到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
@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;
}