BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 01-17-2008, 12:50 AM   #1
BB1364
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Default Calling web service using ksoap2

Please Login to Remove!

hi

i have tried the following code to call the getQuote service in my localhost system , but it gives the following error. If anybody knows how to fix it plz let me know.

<code>
// Create the outgoing message
SoapObject requestObject = new SoapObject("urnmltoday-delayed-quotes", "getQuote");
// ask for the specially encoded symbol in the included service
requestObject.addProperty("symbol", "XXX");

// use version 1.1 of soap
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

// add the outgoing object as the request
envelope.setOutputSoapObject(requestObject);
//new MarshalFloat().register(envelope); // not really needed for j2se version

// Create a transport layer for the J2SE platform. You should change this for
// another transport on midp or j2me devices.
HttpTransport transportSE = new HttpTransport("http://199.63.61.114:8086/axis/services/urnmltoday-delayed-quotes");
// turn on debug mode if you want to see what is happening over the wire.
transportSE.debug = true;
System.out.println("Calling");
try {
// call and print out the result
System.out.println("Calling called");
transportSE.call("getQuote", envelope);

System.out.println("Calling called");
System.out.println("Env "+((Float)envelope.getResponse()).toString());
System.out.println("Res "+envelope.getResponse());
//stockQuoteTextField.setText(((Float)envelope.getRe sponse()).toString());
//stockQuoteTextField.setText(stockQuoteTextField.ge tText() + " called ");
//stockQuoteTextField = new RichTextField("gotResponse");
} catch (Exception e)
{
// if we get an error print the stacktrace and dump the response out.
//e.printStackTrace();
System.out.println(e.toString());
//System.out.println(transportSE.responseDump);
//stockQuoteTextField.setText(stockQuoteTextField.ge tText() + e);
//stockQuoteTextField = new RichTextField(transportSE.responseDump);
}


</Code>

Error:

Calling
Calling called
GME Rx Cid: IPPP
org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:0 in java.io.InputStreamReader@689cd12b)

can anyone plz tell me the reason of this error:

SoapFault - faultcode: 'soapenv:Server.userException' faultstring: 'org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.' faultactor: 'null' detail: org.kxml2.kdom.Node@89b3290d


thanks.

Last edited by BB1364; 01-17-2008 at 01:56 AM..
Offline  
Old 01-17-2008, 07:39 AM   #2
BB1364
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Default

hi

i have tried again to run the above program but now it gives the folowing error:

Connection refused 99.63.61.114:8086
org.xmlpull.v1.XmlPullParserException: unexpected type (position:TEXT Connection refus...@1:36 in java.io.InputStreamReader@f0318cd6)

have someone of u encountered such error, plz help wat will be the solution for this. I really need it .

Thanks in advance.
Offline  
Old 01-17-2008, 11:47 PM   #3
BB1364
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Default

huh!

Someone plz give me some hints to solve it. Im really in need of this.
Plz share some of ur knowledge about this to me.


Thanks .
Offline  
Old 01-19-2008, 06:47 AM   #4
BB1364
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Default

This thread is still open

if anybody knows the solution, plz give me some light. Im stucked here.


Thanks
Offline  
Old 08-23-2008, 06:17 PM   #5
baran_khan
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Default

Hey,

have you found the solution, I guess the its something related to xmlPullParser having some issue with reading spaces...I am stuck with that...
__________________
Smart People ask for Help!!!
Offline  
Old 10-07-2008, 08:52 PM   #6
PymbleSoftware
Knows Where the Search Button Is
 
Join Date: Oct 2008
Model: 7100T
PIN: N/A
Carrier: internal
Posts: 15
Default

Quote:
Originally Posted by BB1364 View Post
SoapFault - faultcode: 'soapenv:Server.userException' faultstring: 'org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.' faultactor: 'null' detail: org.kxml2.kdom.Node@89b3290d
SAX is an API for parsing XML, this error is looks like malformed data sent.

I found this while looking for anything about SOAP on the blackberry.
Is there any tools outthere that actually work?

Regan
__________________
www.pymblesoftware.com
P.O. Box 121,
Pymble,
NSW 2073
AUSTRALIA. +61 2 99830308
Offline  
Old 10-08-2008, 12:04 PM   #7
CJLopez
Thumbs Must Hurt
 
Join Date: May 2008
Model: 8700
PIN: N/A
Carrier: Telcel
Posts: 69
Default

What kind of response does the webservice has to give?

Also, you should see either if the request of the webservice is done correctly. You can print the request of the transport with the method requestDump and then see the response with responseDump. Thats the whole reason to set the debug to true on the transport

i'm guessing here that its a complex type response, which is kinda tricky to manage.
Offline  
Old 10-09-2008, 02:54 AM   #8
goulamass
Talking BlackBerry Encyclopedia
 
Join Date: Jan 2008
Location: France
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 217
Default

Hum I have no problem to connect with KSOAP2.

Show me the WSDL of your web service.
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


Nice Vintage Working RIM Blackberry 857, with Cradle, Collector's Item R857D-2-5 picture

Nice Vintage Working RIM Blackberry 857, with Cradle, Collector's Item R857D-2-5

$124.95



Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh picture

Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh

$219.95



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL

$118.19



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL

$118.19



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL

$118.19



Vintage Working RIM Blackberry 857, Collector's Item R857D-2-5 - SEE DESCRIPTION picture

Vintage Working RIM Blackberry 857, Collector's Item R857D-2-5 - SEE DESCRIPTION

$54.95







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