SOAP服务 - Android,一个CXmlApiException问题

时间:2015-03-25 06:40:01

标签: android android-ksoap2

我正在尝试使用基于SOAP的服务。无法弄清楚为什么会出现以下错误。

在本机代码中引发了CXmlApiException:错误16:scxmlapi(16)XML请求中的文件名无效或丢失。

以下是我的代码

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

            SoapObject response = null;
            try {
                SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
                envelope.dotNet = false;

                Marshal dateMarshal = new MarshalDate();
                dateMarshal.register(envelope);

                MarshalFloat floatMarshal = new MarshalFloat();
                floatMarshal.register(envelope);

                envelope.setOutputSoapObject(request);

                HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
                androidHttpTransport.call(SOAP_ACTION, envelope, headerProperty);
                //response = (SoapObject)envelope.bodyIn;

                //Log.d(TAG, " Got Res "+response.getProperty(0).toString());

                if (envelope.bodyIn instanceof SoapFault) {
                    String str= ((SoapFault) envelope.bodyIn).faultstring;
                    Log.i(TAG+"22222", str);

                } else {
                    SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
                    Log.d(TAG+"22333222", String.valueOf(resultsRequestSOAP));
                }




            } catch (SoapFault sfe) {
                Log.d(TAG, " SoapFault ");
                sfe.printStackTrace();
            } catch (IOException ioe) {
                Log.d(TAG, " IOException ");
                ioe.printStackTrace();
            } catch (XmlPullParserException xppe) {
                Log.d(TAG, " XmlPullParserException ");
                xppe.printStackTrace();
            }

0 个答案:

没有答案