0
04-14 22:09:40.158: E/REQUEST=(274): Authenticate{Username=lll; }
04-14 22:09:40.158: E/SOAP ENVOLP=(274): **envolpe=org.ksoap2.serialization.SoapSerializationEnvelope@43e5b748
04-14 22:09:43.799: W/System.err(274): org.xmlpull.v1.XmlPullParserException: unexpected type (position:TEXT 
04-14 22:09:43.799: W/System.err(274): Warning: DOMXPa...@27:1 in java.io.InputStreamReader@43e6ec48)** 
04-14 22:09:43.819: W/System.err(274):  at org.kxml2.io.KXmlParser.exception(KXmlParser.java:273)
04-14 22:09:43.819: W/System.err(274):  at org.kxml2.io.KXmlParser.nextTag(KXmlParser.java:1420)
04-14 22:09:43.819: W/System.err(274):  at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:126)
04-14 22:09:43.819: W/System.err(274):  at org.ksoap2.transport.Transport.parseResponse(Transport.java:90)
04-14 22:09:43.819: W/System.err(274):  at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:179)
04-14 22:09:43.819: W/System.err(274):  at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:90)
04-14 22:09:43.829: W/System.err(274):  at com.dev.coaster.SignIn.onClick(SignIn.java:71)
04-14 22:09:43.829: W/System.err(274):  at android.view.View.performClick(View.java:2408)
04-14 22:09:43.829: W/System.err(274):  at android.view.View$PerformClick.run(View.java:8816)
04-14 22:09:43.829: W/System.err(274):  at android.os.Handler.handleCallback(Handler.java:587)
04-14 22:09:43.829: W/System.err(274):  at android.os.Handler.dispatchMessage(Handler.java:92)
04-14 22:09:43.829: W/System.err(274):  at android.os.Looper.loop(Looper.java:123)
04-14 22:09:43.829: W/System.err(274):  at android.app.ActivityThread.main(ActivityThread.java:4627)
04-14 22:09:43.829: W/System.err(274):  at java.lang.reflect.Method.invokeNative(Native Method)
04-14 22:09:43.839: W/System.err(274):  at java.lang.reflect.Method.invoke(Method.java:521)
04-14 22:09:43.839: W/System.err(274):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-14 22:09:43.839: W/System.err(274):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-14 22:09:43.839: W/System.err(274):  at dalvik.system.NativeStart.main(Native Method)
**04-14 22:09:43.839: E/SOAP Result=(274): result=null**

そして、SOAP解析のための私のコードは次のとおりです:-

 SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);    
 request.addProperty("Username","lll");

 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
 envelope.dotNet = true;
 envelope.setOutputSoapObject(request);

            Log.e("REQUEST=",""+request);
            Log.e("SOAP ENVOLP=","envolpe="+envelope);
            // Make the soap call.
            HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
            try {

                //this is the actual part that will call the webservice
                androidHttpTransport.debug = true;
                androidHttpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
                androidHttpTransport.call(SOAP_ACTION, envelope);        

                getResult = envelope.getResponse().toString();
            } catch (Exception e) {
                e.printStackTrace(); 
            }

            // Get the SoapResult from the envelope body.       
            SoapObject result = (SoapObject)envelope.bodyIn;

              Log.e("SOAP Result=","result="+result);
4

1 に答える 1

2

認証方法には複雑なオブジェクトが必要です! 「Authenticate」と呼ばれる 1 つのプロパティと、「Username」と「Password」と呼ばれる 2 つのネストされたプロパティ。ルート プロパティ内にプロパティをネストするには、複雑なオブジェクトを作成する必要があります。こちらをご覧ください: Ksoap2 のタグ内にプロパティをネストする

于 2013-04-15T08:19:12.627 に答える