получение XmlPullParserException при попытке подключения к веб-сервису GetCountryByCountryCode - PullRequest
1 голос
/ 17 мая 2011

я получаю этот вывод при попытке подключения к веб-сервису

org.xmlpull.v1.XmlPullParserException: непредвиденный тип (position: END_DOCUMENT null @ 1: 0 i [0.0] n java.io.InputStreamReader @ 6cf4fb80)

package com.rim.SoapRequest;

import net.rim.device.api.io.parser.soap.SOAPBody;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransport;

public class TSOAPRequest
{   

    public String fnSendRequest(String strServerUrl,String strServiceNamespace,String strSoapAction,String strMethodName,String strLablelText)
    {
        System.out.println("inside method !!!!!!!!");

        String strRequestData = "";

        SoapObject oSoapObject = new SoapObject(strServiceNamespace, strMethodName);
        SoapSerializationEnvelope oSoapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
//      oSoapObject.addProperty("GetCountryByCountryCode",strLablelText);
        oSoapObject.addProperty("CountryCode",strLablelText);
        oSoapEnvelope.bodyOut = oSoapObject;
        oSoapEnvelope.dotNet = true;
        oSoapEnvelope.encodingStyle = SoapSerializationEnvelope.XSD;
        oSoapEnvelope.enc = SoapSerializationEnvelope.ENC;

        System.out.println("soap Object !!!!!!________"+oSoapObject.toString());
        System.out.println("soap envelope !!!!++++++"+oSoapEnvelope.toString());

        HttpTransport httpTransport = new HttpTransport(strServerUrl);
        httpTransport.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");   
        httpTransport.debug = true; 
        System.out.println("---------BEFORE TRY BLOCK....");
        try
        {
            httpTransport.call(strSoapAction, oSoapEnvelope);
            System.out.println("INSIDE TRY BLOCK.......");
            strRequestData = (oSoapEnvelope.getResponse()).toString()+"inside try........";         
        }
        catch (Exception e)
        {
            e.printStackTrace();
            strRequestData = e.toString()+"Exception!!!!!!!!!!!!!!!!!!!!!";
        }       
        System.out.println("Request Data======" + strRequestData);
//      System.out.println("request dump ========"+httpTransport.requestDump);

//      strRequestData = httpTransport.requestDump+"=======DUMP=======";
        System.out.println("====dump report is=============="+httpTransport.requestDump);

        return strRequestData;
    }
}

с моего главного экрана я передаю код страны методу, используя этот вызов метода.

oTsoapRequest.fnSendRequest ("http://www.webservicex.net/country.asmx","http://www.webserviceX.NET","http://www.webservicex.net/country.asmx/GetCountryByCountryCode","GetCountryByCountryCode",m_oZipCodeEditField.getText());

пожалуйста, помогите мне выбраться из этого исключения.

...