我正在使用ksop2依赖***(编译' com.google.code.ksoap2-android:ksoap2-android:3.6.0')***用于点击soap web服务,但是在下面异常。
例外 - SoapFault - faultcode:' soap:Server' faultstring:'服务器无法处理请求。 ---> wwdjwdwdewwes' faultactor:' null'详情:org.kxml2.kdom.Node@3303970c
JAVA CODE
private final SoapSerializationEnvelope getSoapSerializationEnvelope(SoapObject request) {
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.implicitTypes = true;
envelope.setAddAdornments(false);
envelope.setOutputSoapObject(request);
return envelope;
}
private final HttpTransportSE getHttpTransportSE() {
HttpTransportSE ht = new HttpTransportSE(Proxy.NO_PROXY,MAIN_REQUEST_URL,60000);
ht.debug = true;
return ht;
}
SoapSerializationEnvelope envelope = getSoapSerializationEnvelope(request);
HttpTransportSE ht = getHttpTransportSE();
ht.call(SOAP_ACTION, envelope);
// testHttpResponse(ht);
received = (SoapObject) envelope.getResponse();
答案 0 :(得分:0)
因为你在envelope
发送了一些空的东西。
if (envelope.bodyIn instanceof SoapFault) {
SoapFault soapFault = (SoapFault) envelope.bodyIn;
String requestStr = androidHttpTransport.requestDump;
} else {
SoapObject soapObject = ((SoapObject) envelope.bodyIn);
String requestStr = androidHttpTransport.requestDump;
}
在requestStr
中检查您的请求并发表评论received = (SoapObject) envelope.getResponse();