大家好,我使用的是 KSOAP2 2.6.5,但在 2.6.5 之前我也使用了 2.4,我收到了同样的错误:
org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <definitions name='wsLogin' targetNamespace='http://painel01.allinmail.com.br/wsAllin/login.php'>@2:403 in java.io.InputStreamReader@4375ba18)
我尝试了解决方案,但到目前为止还没有找到任何解决方案
我的代码:
private String URL = "http://painel01.allinmail.com.br/wsAllin/login.php?wsdl";
private String METHOD = "getTicket";
private static final String NAMESPACE = "http://painel01.allinmail.com.br/wsAllin/login.php";
private static final String SOAP_ACTION = "http://painel01.allinmail.com.br/wsAllin/login.php#getTicket";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
SoapObject request = new SoapObject(NAMESPACE, METHOD);
request.addAttribute("login", "testeallin");
request.addAttribute("senha", "allin@teste456");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
log("point A");
androidHttpTransport.call(SOAP_ACTION, envelope);
log("point B");
String resultsRequestSOAP = envelope.getResponse().toString();
log("point C");
log(resultsRequestSOAP);
} catch (Exception e) {
e.printStackTrace();
log(e.toString());
}
}
private void log(String msg) {
Log.d("KSOAP2", msg);
}
我的回应是:
point A
org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <definitions name='wsLogin' targetNamespace='http://painel01.allinmail.com.br/wsAllin/login.php'>@2:403 in java.io.InputStreamReader@4375ba18)
我该如何修复它?