大家好我全部使用KSOAP2 2.6.5但我也使用2.4直到2.6.5并且我收到了同样的错误:
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)
我该如何解决?
答案 0 :(得分:0)
检查网址是否正确解析。
我猜你是用c#制作你的网络方法。 如果是这种情况,那么,
在c#中, 转到解决方案资源管理器 在那里,检查Appcode是否有名为app_offline.htm的文件。
右键单击并将其从项目中排除。
这件小事对我有用。 希望它可以帮助有类似问题的人。