BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 09-16-2009, 11:20 AM   #1
xtqw420
New Member
 
Join Date: Sep 2009
Model: 7100T
PIN: N/A
Carrier: Verizon
Posts: 3
Default org.xmlpull.v1.XmlPullParserException: expected: START_TAG

Please Login to Remove!

Hello all,

Please help me out with this.
I am using KSOAP2 to connect to a webservice.

I have written following code for calling webservice through KSOAP:-
-----------------------------------------------------------
public void CallWebService(){
HttpTransport ht = null;
try {

String NAMESPACE = "urn:sap-om:document:sap:rfc:functions"

String URL = "h t t p : / / x.x.x.x:xxxx/sap/bc/soap/wsdl11?services=ZAV_TICKETSFM;deviceside=true;inte rface=wifi";
String SOAP_ACTION = "h t t p : / / w w w . s ap. com/ZAV_TICKETSFM;deviceside=true;interface=wifi";
String METHOD_NAME1 = "ZAV_TICKETSFM";


SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME1);


request.addProperty("I_UNAME", "666110");
request.addProperty("I_FLAG", "O");




SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = request;
envelope.setOutputSoapObject(request);

ht = new HttpTransport(URL);

envelope.encodingStyle = SoapSerializationEnvelope.ENC;
envelope.env = "h t t p : / / schemas.xmlsoap.org/soap/envelope/";
//set header

Element[] header = new Element[1];
header[0] = new Element().createElement(NAMESPACE, "Logon");
Element username = new Element().createElement(NAMESPACE, "Username");
username.addChild(Node.TEXT, "xxxxxx");
header[0].addChild(Node.ELEMENT, username);
Element pass = new Element().createElement(NAMESPACE, "Password");
pass.addChild(Node.TEXT, "xxxxxxx");
header[0].addChild(Node.ELEMENT, pass);
envelope.headerOut = header;//set header


ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
ht.call(SOAP_ACTION, envelope);


SoapObject result = (SoapObject)envelope.getResponse();
System.out.println(result.getName());
add(new RichTextField(result.getName()));
add(new RichTextField("DONE!!!"));
System.out.println("response: "+ht.responseDump);
}
catch (XmlPullParserException ex) {
ex.printStackTrace();
ex.getDetail();
ex.getLineNumber();
add(new RichTextField(ex.getMessage()));
add(new RichTextField("NOT Done 1 !!!"));
System.out.println("request: "+ht.requestDump);
System.out.println("response: "+ht.responseDump);

} catch (IOException ex) {
ex.printStackTrace();
add(new RichTextField(ex.getMessage()));
add(new RichTextField("NOT Done 2 !!!"));
}
catch (Exception e) {
System.out.println("i am here in catch");
e.printStackTrace();
add(new RichTextField(e.getMessage()));
add(new RichTextField("NOT Done 3 !!!"));
}

}
--------------------------------------------------------------------

When I run this application on simulator 8320 with wi-fi connection , I get following error:-
expected START_TAG{h t t p :/ / schemas . xmlsoap . org/soap/envelope/} Envelope(position:START_TAG<html>@1:6 in java.io.InputStreamReader@d3el2cc4)


Please help me.
Offline  
Old 09-16-2009, 01:02 PM   #2
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

I think this is usually because you didn't get anything back fron the server.
Offline  
Old 09-17-2009, 07:24 AM   #3
xtqw420
New Member
 
Join Date: Sep 2009
Model: 7100T
PIN: N/A
Carrier: Verizon
Posts: 3
Default

Response is null. I think its login error. I am not able to send basic authentication using KSOAP2. Does anybody know how to send basic authentication data in KSOAP2 ??
Offline  
Old 03-14-2010, 05:51 AM   #4
amramrhh
New Member
 
Join Date: Mar 2010
Model: 7100
PIN: N/A
Carrier: SA
Posts: 2
Unhappy Please help

I have the same error for 3 weeks ago can any body send the solution regarding my web service on server need windows credential
Offline  
Old 05-21-2010, 05:43 AM   #5
aka47
New Member
 
Join Date: May 2010
Model: 8320
PIN: N/A
Carrier: JDE 4.3
Posts: 4
Default

hi
im having exception XMLPARSEREXCEPTION....Can any body help
here is my code:
Offline  
Old 05-26-2010, 12:55 AM   #6
baran_khan
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Default Target URL of the webservice

Hi All,

This might sound silly, but please confirm if the webservice that we are using is located on some remote server or on the same system that you are developing the application on. I faced this issue and in the end was sorted by replacing the "localhost" with the IP of the system.

The blackberry device consider localhost as its own IP adress and hence try to search the webservice on itself. this is my first guess, we can discuss this further if you still face this issue.

Thanks,
Baran
__________________
Smart People ask for Help!!!
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


GE (Datex Ohmeda) Flow Sensor Transducer for Aestiva 5, Aespire, Avance, Aisys  picture

GE (Datex Ohmeda) Flow Sensor Transducer for Aestiva 5, Aespire, Avance, Aisys

$309.95



Novotechnik Linear Transducer Type TRS 25 picture

Novotechnik Linear Transducer Type TRS 25

$60.00



100PSI 5V Pressure Transducer or Sender 1/8NPT for Fuel Diesel Oil Air Water picture

100PSI 5V Pressure Transducer or Sender 1/8NPT for Fuel Diesel Oil Air Water

$12.82



1/8NPT Stainless Pressure Transducer Sender Sensor For Oil Air Fuel Gas 150Psi picture

1/8NPT Stainless Pressure Transducer Sender Sensor For Oil Air Fuel Gas 150Psi

$13.98



790260025-5B Cleveland-Kidder Transducer picture

790260025-5B Cleveland-Kidder Transducer

$99.99



SETRA 2671025WB11A1HD DIFFERENTIAL PRESSURE TRANSDUCER, 0-.25

SETRA 2671025WB11A1HD DIFFERENTIAL PRESSURE TRANSDUCER, 0-.25" WC, LCD DIS, 24V

$249.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.