下面是我的代码。在这段代码中,我使用的是ksoap2-android-assembly-3.3.0-jar-with-dependencies.jar。但是我收到以下错误(我在doInBackgroud()
方法中放入了所有这些代码):
SoapSerializationEnvelope env = new SoapSerializationEnvelope(
SoapEnvelope.VER12);
env.dotNet = false;
env.xsd = SoapSerializationEnvelope.XSD;
env.enc = SoapSerializationEnvelope.ENC;
SoapObject request = new SoapObject(NAMESPACE, "login");
request.addProperty("username", "xxxx");
request.addProperty("apiKey", "xxxxx");
env.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(null, env);
Object result = env.getResponse();
Log.d("AMAR sessionId", result.toString());
我得到了以下错误。我谷歌这么多次,我得到了一些建议。我几乎尝试了所有。但我仍然没有得到任何解决方案。请给我一些关于Magento肥皂请求的想法。
org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org /soap/envelope/}Envelope (position:START_TAG <{http://schemas.xmlsoap.org/wsdl/}wsdl:definitions name='Magento' targetNamespace='urn:Magento'>@2:291 in java.io.InputStreamReader@4214c770)
at org.kxml2.io.KXmlParser.require(KXmlParser.java:2056)
at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:128)
at org.ksoap2.transport.Transport.parseResponse(Transport.java:118)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:275)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:118)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:113)
at org.embitel.screen.WishListActivity$WishListAsync.doInBackground(WishListActivity.java:68)
at org.embitel.screen.WishListActivity$WishListAsync.doInBackground(WishListActivity.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)