BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-16-2009, 11:20 AM   #1 (permalink)
New Member
 
Join Date: Sep 2009
Model: 7100T
PIN: N/A
Carrier: Verizon
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
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 (permalink)
New Member
 
Join Date: Sep 2009
Model: 7100T
PIN: N/A
Carrier: Verizon
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
New Member
 
Join Date: Mar 2010
Model: 7100
PIN: N/A
Carrier: SA
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
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 (permalink)
New Member
 
Join Date: May 2010
Model: 8320
PIN: N/A
Carrier: JDE 4.3
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi
im having exception XMLPARSEREXCEPTION....Can any body help
here is my code:
Offline  
Old 05-26-2010, 12:55 AM   #6 (permalink)
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Post Thanks: 0
Thanked 0 Times in 0 Posts
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


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





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