Error: org.xmlpull.v1.XmlPullParserException: expected: START_TAG

764 views
Skip to first unread message

Gourav Kapoor

unread,
Aug 20, 2013, 8:07:01 AM8/20/13
to ksoap2-...@googlegroups.com
Hi All, I'm using the KSOAP2 and got the following error. Please help me to fix this issue.

org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <definitions name='PaymentechGateway' targetNamespace='https://ws.paymentech.net/PaymentechGateway/wsdl/PaymentechGateway.wsdl'>@12:43 in java.io.InputStreamReader@417c3af8) 


Code:  

 SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        soapEnvelope.implicitTypes = true;
        soapEnvelope.dotNet = true;
        SoapObject soapReq = new SoapObject("https://wswar.paymentech.net/PaymentechGateway/wsdl/PaymentechGateway.wsdl","NewOrder");
        soapEnvelope.addMapping("https://wsvar.paymentech.net/PaymentechGateway/wsdl/PaymentechGateway.wsdl","newOrderRequest",new NewOrderRequestElement().getClass());
        soapReq.addProperty("newOrderRequest",newOrderRequest);
        soapEnvelope.setOutputSoapObject(soapReq);
        HttpTransportSE httpTransport = new HttpTransportSE(url,timeOut);
        try{
            if (headers!=null){
                httpTransport.call("https://ws.paymentech.net/PaymentechGateway/wsdl/PaymentechGateway.wsdl/NewOrder", soapEnvelope,headers);
            }else{
                httpTransport.call("https://wsvar.paymentech.net/PaymentechGateway/wsdl/PaymentechGateway.wsdl/NewOrder", soapEnvelope);
            }
            Object retObj = soapEnvelope.bodyIn;
            if (retObj instanceof SoapFault){
                SoapFault fault = (SoapFault)retObj;
                Exception ex = new Exception(fault.faultstring);
                if (eventHandler != null)
                    eventHandler.Wsdl2CodeFinishedWithException(ex);
            }else{
                SoapObject result=(SoapObject)retObj;
                if (result.getPropertyCount() > 0){
                    Object obj = result.getProperty(0);
                    SoapObject j = (SoapObject)obj;
                    NewOrderResponseElement resultVariable =  new NewOrderResponseElement (j);
                    return resultVariable;
                    
                }
            }
        }catch (Exception e) {
            if (eventHandler != null)
                eventHandler.Wsdl2CodeFinishedWithException(e);
            e.printStackTrace();
        }
        return null;
    

Thanks,
Gaurav Kapoor

Anatoliy Shuba

unread,
Sep 4, 2013, 11:46:44 AM9/4/13
to ksoap2-...@googlegroups.com
Hi, Gaurav

I usually get this error (expected: START_TAG) in case of physical network problem. For example when network accidently went down.

вторник, 20 августа 2013 г., 15:07:01 UTC+3 пользователь Gourav Kapoor написал:
Reply all
Reply to author
Forward
0 new messages