XmlpullparserException: Expected a quoted String(position:DOCDECL @1:62 in java.io.Inputstreamreader)

后端 未结 4 1774
面向向阳花
面向向阳花 2021-01-29 07:32

Code:

            SoapObject request = new SoapObject(NAMESPACE, SOAP_METHOD_GETDATATBL);

            request.addProperty(\"TName\", ttnm);
            request.         


        
相关标签:
4条回答
  • 2021-01-29 08:03

    The Problem was in internet Security.. due to set Firewall in internet or Proxy, i couldn't connect that webservice which was in server side.

    0 讨论(0)
  • 2021-01-29 08:05

    Something similar happened to me, use

    envelope = new SoapSerializationEnvelope (SoapEnvelope.VER12); 
    

    and it worked,

    0 讨论(0)
  • 2021-01-29 08:10

    In my case that error arose because of a change in URL from http to https. Hence, you may want to ensure you are getting a response code 200 before processing the response.

    0 讨论(0)
  • 2021-01-29 08:19

    Try below code..

        HttpTransportSE transporter;
        SoapSerializationEnvelope envelope;
        SoapObject mSoapObject = null;
        String METHOD_NAME = getString(R.string.soap_method_authentication);
        try {
    
            mSoapObject = new SoapObject(getString(R.string.soap_namespace),METHOD_NAME);
            mSoapObject.addProperty("TName", "test");
            mSoapObject.addProperty("ColumnNameStr", "*");
    
    
            transporter = new HttpTransportSE(getString(R.string.soap_main_url));
            envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
            envelope.dotNet = true;
            envelope.setOutputSoapObject(mSoapObject);
            transporter.call(getString(R.string.soap_namespace) + METHOD_NAME, envelope);
    
    
            SoapObject response = (SoapObject) envelope.bodyIn;
            System.out.println("Response : " + response);
    
        } catch (Exception e) {
            mTextView.setText("Error...");
            e.printStackTrace();
        }
    

    String.xml

    <string name="soap_main_url">your_main_url</string>
    <string name="soap_namespace">http://tempuri.org/GetDataTbl/</string>
    <string name="soap_method_authentication">GetDataTbl</string>
    
    0 讨论(0)
提交回复
热议问题