Ksoap解析器问题android

时间:2012-05-18 05:36:00

标签: java android

我正在通过ksoap库解析SOAP webservices。解析时我遇到的问题是错误......

 05-18 11:00:14.802: WARN/System.err(444): java.lang.RuntimeException: Cannot serialize: 125.322
    05-18 11:00:14.802: WARN/System.err(444):     at org.ksoap2.serialization.SoapSerializationEnvelope.writeElement(SoapSerializationEnvelope.java:629)
    05-18 11:00:14.802: WARN/System.err(444):     at org.ksoap2.serialization.SoapSerializationEnvelope.writeProperty(SoapSerializationEnvelope.java:613)
    05-18 11:00:14.802: WARN/System.err(444):     at org.ksoap2.serialization.SoapSerializationEnvelope.writeObjectBody(SoapSerializationEnvelope.java:582)
    05-18 11:00:14.812: WARN/System.err(444):     at org.ksoap2.serialization.SoapSerializationEnvelope.writeObjectBody(SoapSerializationEnvelope.java:566)
    05-18 11:00:14.812: WARN/System.err(444):     at org.ksoap2.serialization.SoapSerializationEnvelope.writeElement(SoapSerializationEnvelope.java:623)
    05-18 11:00:14.812: WARN/System.err(444):     at org.ksoap2.serialization.SoapSerializationEnvelope.writeBody(SoapSerializationEnvelope.java:547)
    05-18 11:00:14.812: WARN/System.err(444):     at org.ksoap2.SoapEnvelope.write(SoapEnvelope.java:192)
    05-18 11:00:14.812: WARN/System.err(444):     at org.ksoap2.transport.Transport.createRequestData(Transport.java:74)
    05-18 11:00:14.822: WARN/System.err(444):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:58)
    05-18 11:00:14.822: WARN/System.err(444):     at com.KsoapDemo.KsoapDemoActivity.ManualPaymentProcess(KsoapDemoActivity.java:113)
    05-18 11:00:14.822: WARN/System.err(444):     at com.KsoapDemo.KsoapDemoActivity.onCreate(KsoapDemoActivity.java:27)
    05-18 11:00:14.822: WARN/System.err(444):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    05-18 11:00:14.822: WARN/System.err(444):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
    05-18 11:00:14.822: WARN/System.err(444):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
    05-18 11:00:14.822: WARN/System.err(444):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
    05-18 11:00:14.832: WARN/System.err(444):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
    05-18 11:00:14.832: WARN/System.err(444):     at android.os.Handler.dispatchMessage(Handler.java:99)
    05-18 11:00:14.832: WARN/System.err(444):     at android.os.Looper.loop(Looper.java:123)
    05-18 11:00:14.832: WARN/System.err(444):     at android.app.ActivityThread.main(ActivityThread.java:4627)
    05-18 11:00:14.832: WARN/System.err(444):     at java.lang.reflect.Method.invokeNative(Native Method)
    05-18 11:00:14.832: WARN/System.err(444):     at java.lang.reflect.Method.invoke(Method.java:521)
    05-18 11:00:14.832: WARN/System.err(444):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    05-18 11:00:14.832: WARN/System.err(444):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    05-18 11:00:14.842: WARN/System.err(444):     at dalvik.system.NativeStart.main(Native Method)

代码::

String NAMESPACE = "http://tempuri.org/";
                String METHOD_NAME = "ManualPaymentProcess";
                String SOAP_ACTION = "http://tempuri.org/ManualPaymentProcess";
                String URL = ("http://URL.asmx");


                SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);

                Request.addProperty("UserName", "renish");
                Request.addProperty("Passwrd", "nair");
                Request.addProperty("MerchantName", "nair");
                Request.addProperty("InvoiceNo", "nair");
                Request.addProperty("Amount", 125.322);
                Request.addProperty("Product", "ask");
                Request.addProperty("AgentID", "29031525004722020");
                Request.addProperty("IsPrimaryAgentId", true);

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

                AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);
                androidHttpTransport.call(SOAP_ACTION, envelope);
                soapResponseObject = (SoapObject)envelope.getResponse();
                Log.i("TAG","soapResponseObject"+soapResponseObject);

我在其他服务中取得成功,但在这个网络服务中出现问题....所以你能告诉我这是什么问题吗?

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

您可以在stackoverflow上查看同一错误here的答案。