我是blackberry的新手,我只是试图调用在SAP CRM上执行某些操作的Web服务,但是我得到了这个异常:org.xmlpull.v1.XmlPullParserException:意外类型(位置:END_DOCUMENT null @ 1:0在java中.io.InputStreamReader @ c599f9fd)
这是代码......
SoapObject rpc = new SoapObject(serviceNamespace,"zws_incoming_email");
rpc.addProperty("username","sreenu");
rpc.addProperty("Password","ravi");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.encodingStyle = SoapSerializationEnvelope.ENC;
envelope.env = "http://schemas.xmlsoap.org/soap/envelope/";
HttpTransport ht = new HttpTransport(serviceUrl);
//s ht.requestDump=msg;
ht.debug = true;
String request="";
ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" );
String response=ht.responseDump;
try
{
System.out.print("2222222");
ht.call(soapAction,envelope);
String result = (envelope.getResponse()).toString();
System.out.println("in try block"+result);
System.out.println("Request"+request);
System.out.println("Response"+response);
System.out.println("Result......"+result);
}
catch(org.xmlpull.v1.XmlPullParserException ex2){
String msg2 = ex2.toString();
request=ht.requestDump;
response=ht.responseDump;
System.out.println("Exception...... "+msg2);
System.out.println("request...... "+request);
System.out.println("response...... "+response);
}
catch(Exception ex)
{
String msg1 = ex.toString();
System.out.println(".......... catch block"+msg1);
}
}
在ht.call()方法之后引发异常,请帮助我..............
我有同样的问题,得到END_DOCUMENT
错误,但我解决了它。
主要问题是在模拟器中的代理设置。
当我尝试从Blackberry模拟器访问Web服务时,无论我做了什么,我都会一直收到此错误。经过2天的“研究”,我解决了这个问题。请执行下列操作:
C:\Program Files (x86)\Research In Motion\BlackBerry Email and MDS Services Simulators 4.1.2\MDS\config
(安装了步骤2的包)。打开rimpublic.property
文件。在[HTTP HANDLER]
下添加以下行:
application.handler.http.proxyEnabled = true
application.handler.http.proxyHost=YOUR_PROXY_IP
application.handler.http.proxyPort=PROXY_PORT
application.handler.http.proxyUser=PROXY_USER (with domain if required)
application.handler.http.proxyPass=PASSWORD
application.handler.http.proxyAutoConfig = false`
我有同样的问题,我可以通过再次下载KSOAP库来解决它
ksoap2-机器人组装-3.0.0-RC.4-JAR-与依赖性
发现在https://code.google.com/p/ksoap2-android/
似乎他们在以前的版本中存在问题。我希望它能帮助人们解决同样的问题。